From 1cc41c8722d87c875cf469741c5514a62df654e0 Mon Sep 17 00:00:00 2001 From: aidancbrady Date: Wed, 22 Jun 2016 12:13:18 -0400 Subject: [PATCH] Update IC2 API --- src/api/java/ic2/api/Direction.class | Bin 3644 -> 0 bytes src/api/java/ic2/api/crops/BaseSeed.class | Bin 1336 -> 639 bytes src/api/java/ic2/api/crops/BaseSeed.java | 34 +- src/api/java/ic2/api/crops/CropCard.class | Bin 6036 -> 5826 bytes src/api/java/ic2/api/crops/CropCard.java | 210 ++- .../java/ic2/api/crops/CropProperties.class | Bin 0 -> 1229 bytes .../java/ic2/api/crops/CropProperties.java | 78 + src/api/java/ic2/api/crops/Crops.class | Bin 1702 -> 1187 bytes src/api/java/ic2/api/crops/Crops.java | 39 +- src/api/java/ic2/api/crops/ICropSeed.class | Bin 0 -> 669 bytes src/api/java/ic2/api/crops/ICropSeed.java | 81 + src/api/java/ic2/api/crops/ICropTile.class | Bin 1388 -> 1397 bytes src/api/java/ic2/api/crops/ICropTile.java | 169 +- src/api/java/ic2/api/crops/package-info.class | Bin 255 -> 265 bytes src/api/java/ic2/api/energy/IEnergyNet.class | Bin 727 -> 582 bytes src/api/java/ic2/api/energy/IEnergyNet.java | 86 +- .../api/energy/event/EnergyTileEvent.class | Bin 846 -> 923 bytes .../ic2/api/energy/event/EnergyTileEvent.java | 15 +- .../ic2/api/energy/event/package-info.class | Bin 262 -> 272 bytes .../java/ic2/api/energy/package-info.class | Bin 256 -> 266 bytes .../ic2/api/energy/prefab/BasicSink.class | Bin 5524 -> 5710 bytes .../java/ic2/api/energy/prefab/BasicSink.java | 374 +++++ .../ic2/api/energy/prefab/BasicSource.class | Bin 5601 -> 5805 bytes .../ic2/api/energy/prefab/BasicSource.java | 376 +++++ .../ic2/api/energy/prefab/package-info.class | Bin 263 -> 273 bytes .../ic2/api/energy/tile/IEnergyAcceptor.class | Bin 288 -> 271 bytes .../ic2/api/energy/tile/IEnergyAcceptor.java | 11 +- .../ic2/api/energy/tile/IEnergyEmitter.class | Bin 282 -> 266 bytes .../ic2/api/energy/tile/IEnergyEmitter.java | 11 +- .../ic2/api/energy/tile/IEnergySink.class | Bin 306 -> 290 bytes .../energy/tile/IExplosionPowerOverride.class | Bin 0 -> 213 bytes .../energy/tile/IExplosionPowerOverride.java | 25 + .../ic2/api/energy/tile/IHeatSource.class | Bin 281 -> 249 bytes .../ic2/api/energy/tile/IKineticSource.class | Bin 305 -> 273 bytes .../ic2/api/energy/tile/IMetaDelegate.class | Bin 289 -> 285 bytes .../ic2/api/energy/tile/IMetaDelegate.java | 22 +- .../api/energy/tile/IMultiEnergySource.class | Bin 0 -> 266 bytes .../api/energy/tile/IMultiEnergySource.java | 24 + .../api/energy/tile/IOverloadHandler.class | Bin 0 -> 161 bytes .../ic2/api/energy/tile/IOverloadHandler.java | 17 + .../ic2/api/energy/tile/package-info.class | Bin 261 -> 271 bytes src/api/java/ic2/api/energy/usage.txt | 2 +- .../java/ic2/api/event/ExplosionEvent.class | Bin 1048 -> 1038 bytes .../java/ic2/api/event/ExplosionEvent.java | 14 +- .../event/LaserEvent$LaserExplodesEvent.class | Bin 1128 -> 1120 bytes .../LaserEvent$LaserHitsBlockEvent.class | Bin 1285 -> 1264 bytes .../LaserEvent$LaserHitsEntityEvent.class | Bin 984 -> 975 bytes .../event/LaserEvent$LaserShootEvent.class | Bin 1003 -> 994 bytes src/api/java/ic2/api/event/LaserEvent.class | Bin 1415 -> 1347 bytes src/api/java/ic2/api/event/LaserEvent.java | 82 +- src/api/java/ic2/api/event/PaintEvent.class | Bin 807 -> 0 bytes src/api/java/ic2/api/event/PaintEvent.java | 30 - .../java/ic2/api/event/RetextureEvent.class | Bin 1024 -> 2143 bytes .../java/ic2/api/event/RetextureEvent.java | 59 +- src/api/java/ic2/api/event/package-info.class | Bin 255 -> 265 bytes .../ic2/api/info/IEnergyValueProvider.class | Bin 195 -> 0 bytes .../ic2/api/info/IEnergyValueProvider.java | 17 - .../ic2/api/info/IFuelValueProvider.class | Bin 190 -> 0 bytes .../java/ic2/api/info/IFuelValueProvider.java | 15 - src/api/java/ic2/api/info/IInfoProvider.class | Bin 0 -> 241 bytes src/api/java/ic2/api/info/IInfoProvider.java | 27 + src/api/java/ic2/api/info/Info.class | Bin 1222 -> 1267 bytes src/api/java/ic2/api/info/Info.java | 11 +- src/api/java/ic2/api/info/package-info.class | Bin 254 -> 264 bytes src/api/java/ic2/api/item/ElectricItem.class | Bin 1407 -> 1369 bytes .../ic2/api/item/IBlockCuttingBlade.class | Bin 158 -> 188 bytes .../java/ic2/api/item/IBlockCuttingBlade.java | 3 +- src/api/java/ic2/api/item/IBoxable.java | 6 +- src/api/java/ic2/api/item/IC2Items.class | Bin 1797 -> 1693 bytes src/api/java/ic2/api/item/IC2Items.java | 1381 ++++++++++------- src/api/java/ic2/api/item/IElectricItem.class | Bin 431 -> 323 bytes src/api/java/ic2/api/item/IElectricItem.java | 27 +- .../ic2/api/item/IElectricItemManager.class | Bin 627 -> 704 bytes .../ic2/api/item/IElectricItemManager.java | 61 +- src/api/java/ic2/api/item/IItemAPI.class | Bin 0 -> 339 bytes src/api/java/ic2/api/item/IItemAPI.java | 43 + src/api/java/ic2/api/item/IItemHudInfo.java | 6 +- .../api/item/IKineticRotor$GearboxType.class | Bin 0 -> 1125 bytes src/api/java/ic2/api/item/IKineticRotor.class | Bin 0 -> 590 bytes ...neticWindRotor.java => IKineticRotor.java} | 9 +- .../java/ic2/api/item/IKineticWindRotor.class | Bin 408 -> 0 bytes src/api/java/ic2/api/item/ILatheItem.class | Bin 669 -> 0 bytes src/api/java/ic2/api/item/ILatheItem.java | 46 - .../ic2/api/item/ISpecialElectricItem.class | Bin 259 -> 225 bytes .../ic2/api/item/ISpecialElectricItem.java | 8 +- .../java/ic2/api/item/ITerraformingBP.class | Bin 226 -> 512 bytes .../java/ic2/api/item/ITerraformingBP.java | 24 +- src/api/java/ic2/api/item/ItemWrapper.class | Bin 2451 -> 2403 bytes src/api/java/ic2/api/item/ItemWrapper.java | 6 +- src/api/java/ic2/api/item/package-info.class | Bin 254 -> 264 bytes .../ic2/api/network/ClientModifiable.class | Bin 0 -> 400 bytes .../ic2/api/network/ClientModifiable.java | 10 + .../ic2/api/network/INetworkDataProvider.java | 7 +- .../network/INetworkItemEventListener.java | 2 +- .../ic2/api/network/INetworkManager.class | Bin 0 -> 562 bytes .../java/ic2/api/network/INetworkManager.java | 28 + .../java/ic2/api/network/NetworkHelper.class | Bin 4190 -> 2775 bytes .../java/ic2/api/network/NetworkHelper.java | 109 +- .../java/ic2/api/network/package-info.class | Bin 257 -> 267 bytes src/api/java/ic2/api/package-info.class | Bin 249 -> 259 bytes src/api/java/ic2/api/reactor/IReactor.class | Bin 0 -> 706 bytes src/api/java/ic2/api/reactor/IReactor.java | 144 ++ .../ic2/api/reactor/IReactorComponent.class | Bin 0 -> 720 bytes .../ic2/api/reactor/IReactorComponent.java | 98 ++ .../java/ic2/api/reactor/package-info.class | Bin 0 -> 267 bytes .../java/ic2/api/reactor/package-info.java | 4 + .../ICannerEnrichRecipeManager$Input.class | Bin 1143 -> 1147 bytes .../recipe/ICannerEnrichRecipeManager.java | 1 + ...erRecipeManager$FermentationProperty.class | Bin 0 -> 1104 bytes .../api/recipe/IFermenterRecipeManager.class | Bin 0 -> 765 bytes .../api/recipe/IFermenterRecipeManager.java | 64 + ...RecipeManager$RecipeIoContainerFluid.class | Bin 0 -> 687 bytes .../ic2/api/recipe/IFluidRecipeManager.class | Bin 0 -> 654 bytes .../ic2/api/recipe/IFluidRecipeManager.java | 60 + ...xchangerManager$HeatExchangeProperty.class | Bin 0 -> 662 bytes .../recipe/ILiquidHeatExchangerManager.class | Bin 0 -> 780 bytes .../recipe/ILiquidHeatExchangerManager.java | 39 + ...chineRecipeManager$RecipeIoContainer.class | Bin 0 -> 670 bytes .../api/recipe/IMachineRecipeManager.class | Bin 487 -> 634 bytes .../ic2/api/recipe/IMachineRecipeManager.java | 50 +- .../api/recipe/IMachineRecipeManagerExt.class | Bin 309 -> 0 bytes .../api/recipe/IMachineRecipeManagerExt.java | 22 - .../recipe/RecipeInputFluidContainer.class | Bin 2669 -> 3048 bytes .../api/recipe/RecipeInputFluidContainer.java | 14 +- .../ic2/api/recipe/RecipeInputItemStack.class | Bin 1899 -> 1949 bytes .../ic2/api/recipe/RecipeInputItemStack.java | 1 + .../ic2/api/recipe/RecipeInputOreDict.class | Bin 3508 -> 3465 bytes .../ic2/api/recipe/RecipeInputOreDict.java | 1 + .../java/ic2/api/recipe/RecipeOutput.class | Bin 2596 -> 2599 bytes src/api/java/ic2/api/recipe/RecipeOutput.java | 3 +- .../ic2/api/recipe/RecipeOutputFluid.class | Bin 0 -> 2632 bytes .../ic2/api/recipe/RecipeOutputFluid.java | 57 + src/api/java/ic2/api/recipe/Recipes.class | Bin 1090 -> 1280 bytes src/api/java/ic2/api/recipe/Recipes.java | 22 +- .../java/ic2/api/recipe/package-info.class | Bin 256 -> 266 bytes .../ic2/api/tile/ExplosionWhitelist.class | Bin 987 -> 1086 bytes .../java/ic2/api/tile/ExplosionWhitelist.java | 17 +- .../java/ic2/api/tile/IEnergyStorage.class | Bin 374 -> 358 bytes .../java/ic2/api/tile/IRotorProvider.class | Bin 0 -> 310 bytes src/api/java/ic2/api/tile/IRotorProvider.java | 33 + src/api/java/ic2/api/tile/IWrenchable.class | Bin 456 -> 1007 bytes src/api/java/ic2/api/tile/IWrenchable.java | 80 +- .../tile/RotorRegistry$IRotorRegistry.class | Bin 0 -> 389 bytes src/api/java/ic2/api/tile/RotorRegistry.class | Bin 0 -> 1701 bytes src/api/java/ic2/api/tile/RotorRegistry.java | 43 + src/api/java/ic2/api/tile/package-info.class | Bin 254 -> 264 bytes src/api/java/ic2/api/util/package-info.class | Bin 254 -> 264 bytes .../common/integration/IC2ItemManager.java | 24 +- .../common/integration/MekanismHooks.java | 26 +- .../common/integration/OreDictManager.java | 2 +- .../common/item/ItemBlockEnergyCube.java | 43 - .../common/item/ItemBlockMachine.java | 43 - .../mekanism/common/item/ItemEnergized.java | 42 - .../mekanism/common/item/ItemFreeRunners.java | 42 - .../tile/TileEntityAdvancedBoundingBlock.java | 3 +- .../common/tile/TileEntityBasicBlock.java | 41 +- .../common/tile/TileEntityElectricBlock.java | 14 +- .../common/tile/TileEntityInductionPort.java | 14 +- .../common/tile/TileEntityPersonalChest.java | 7 - .../java/mekanism/common/util/CableUtils.java | 7 +- .../common/item/ItemBlockGenerator.java | 43 - .../tile/turbine/TileEntityTurbineValve.java | 15 +- 162 files changed, 3107 insertions(+), 1617 deletions(-) delete mode 100644 src/api/java/ic2/api/Direction.class create mode 100644 src/api/java/ic2/api/crops/CropProperties.class create mode 100644 src/api/java/ic2/api/crops/CropProperties.java create mode 100644 src/api/java/ic2/api/crops/ICropSeed.class create mode 100644 src/api/java/ic2/api/crops/ICropSeed.java create mode 100644 src/api/java/ic2/api/energy/prefab/BasicSink.java create mode 100644 src/api/java/ic2/api/energy/prefab/BasicSource.java create mode 100644 src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.class create mode 100644 src/api/java/ic2/api/energy/tile/IExplosionPowerOverride.java create mode 100644 src/api/java/ic2/api/energy/tile/IMultiEnergySource.class create mode 100644 src/api/java/ic2/api/energy/tile/IMultiEnergySource.java create mode 100644 src/api/java/ic2/api/energy/tile/IOverloadHandler.class create mode 100644 src/api/java/ic2/api/energy/tile/IOverloadHandler.java delete mode 100644 src/api/java/ic2/api/event/PaintEvent.class delete mode 100644 src/api/java/ic2/api/event/PaintEvent.java delete mode 100644 src/api/java/ic2/api/info/IEnergyValueProvider.class delete mode 100644 src/api/java/ic2/api/info/IEnergyValueProvider.java delete mode 100644 src/api/java/ic2/api/info/IFuelValueProvider.class delete mode 100644 src/api/java/ic2/api/info/IFuelValueProvider.java create mode 100644 src/api/java/ic2/api/info/IInfoProvider.class create mode 100644 src/api/java/ic2/api/info/IInfoProvider.java create mode 100644 src/api/java/ic2/api/item/IItemAPI.class create mode 100644 src/api/java/ic2/api/item/IItemAPI.java create mode 100644 src/api/java/ic2/api/item/IKineticRotor$GearboxType.class create mode 100644 src/api/java/ic2/api/item/IKineticRotor.class rename src/api/java/ic2/api/item/{IKineticWindRotor.java => IKineticRotor.java} (68%) delete mode 100644 src/api/java/ic2/api/item/IKineticWindRotor.class delete mode 100644 src/api/java/ic2/api/item/ILatheItem.class delete mode 100644 src/api/java/ic2/api/item/ILatheItem.java create mode 100644 src/api/java/ic2/api/network/ClientModifiable.class create mode 100644 src/api/java/ic2/api/network/ClientModifiable.java create mode 100644 src/api/java/ic2/api/network/INetworkManager.class create mode 100644 src/api/java/ic2/api/network/INetworkManager.java create mode 100644 src/api/java/ic2/api/reactor/IReactor.class create mode 100644 src/api/java/ic2/api/reactor/IReactor.java create mode 100644 src/api/java/ic2/api/reactor/IReactorComponent.class create mode 100644 src/api/java/ic2/api/reactor/IReactorComponent.java create mode 100644 src/api/java/ic2/api/reactor/package-info.class create mode 100644 src/api/java/ic2/api/reactor/package-info.java create mode 100644 src/api/java/ic2/api/recipe/IFermenterRecipeManager$FermentationProperty.class create mode 100644 src/api/java/ic2/api/recipe/IFermenterRecipeManager.class create mode 100644 src/api/java/ic2/api/recipe/IFermenterRecipeManager.java create mode 100644 src/api/java/ic2/api/recipe/IFluidRecipeManager$RecipeIoContainerFluid.class create mode 100644 src/api/java/ic2/api/recipe/IFluidRecipeManager.class create mode 100644 src/api/java/ic2/api/recipe/IFluidRecipeManager.java create mode 100644 src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager$HeatExchangeProperty.class create mode 100644 src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.class create mode 100644 src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java create mode 100644 src/api/java/ic2/api/recipe/IMachineRecipeManager$RecipeIoContainer.class delete mode 100644 src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.class delete mode 100644 src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.java create mode 100644 src/api/java/ic2/api/recipe/RecipeOutputFluid.class create mode 100644 src/api/java/ic2/api/recipe/RecipeOutputFluid.java create mode 100644 src/api/java/ic2/api/tile/IRotorProvider.class create mode 100644 src/api/java/ic2/api/tile/IRotorProvider.java create mode 100644 src/api/java/ic2/api/tile/RotorRegistry$IRotorRegistry.class create mode 100644 src/api/java/ic2/api/tile/RotorRegistry.class create mode 100644 src/api/java/ic2/api/tile/RotorRegistry.java diff --git a/src/api/java/ic2/api/Direction.class b/src/api/java/ic2/api/Direction.class deleted file mode 100644 index 9377993096c313361c53c27b9bc69fea24947f82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3644 zcmb7G`&$&}6@EYVGPBF5fMNn-iW(}H$QGiBg0&`!aT5fSRm@`AIxGW@?(S@dS%UVG zn%>)_O-gU+{hHp=maGP7Oxyg_ANnu#dD^~bn6R_U<}rn5&i9@9&UwH0JLi07_Fw;b z`|kjT@lFC!d@2bS3mQf=cu5SQEMieso=;#2HyddK9vT#d; zZ}MUiU%(edd`ZKXHGD7@i-#y3U%mX23+yeiXgC(({&0s4+? z_+1^tqI^$yd|$_58GoSTh>Wl4ctpk@>UdPfAL%$Mwb-wt|q~al2@HCxqYD<#gYaLe#rzlYb&(&lgRv>=G%`D+}A^ zT&Iw+XRRqYq9CLjlZr0TNI|8^L43|Q?!2`bYlYLj<3-C$6&Qe=YtDIdvYyI0g@RK| zl|4J3s`YrEvqzX1h1CCv#dBmlGk5)*Sqj3{YL-g*8yB1lcHSB*dbW2%VZ4rFimWWl zUrbf)NUY`{?_E!`PtMZk)!D}!~emySKPfllFZ^c|L@nKxlO_os3aoky!NYmvsn}dd*X)t-Oc~#~uFI`-;+y&XNw{dke zdrqi`SXwL-jgC@p3N4;fn|y^K0@a-Jp7o-jAJ653LhlJ5yjU(AZ*Y-LumL19PT9>_ zXP9V(?VIH~C^yl-s5HV613$+v6k4}55CbRiO9Nv#W8j#W{>s3w@w9>8z&7wCp3?BT zf#2eH27Zro2L2%8k0LJNSp(N#GmHk_z@H5K8Gm7usy2YlY$w@)H16So#Z{u!o;$b{&;IN1zA|4U(sEDH?j^m>YXqDU;lc3O1lhRbE+!SKD zyi;Trb}{o+zsZ?v?AFZGk#Orel{Xg_Mnh(s{j%yQJJRn^&6fA7B39+aiKiweFY!a5 zvEc2ZnO8VagVFfHD>O68{w*bEg}wC!96l|1#g|UWjpF3Sdy|{NqVyIYpR&jwJ;WR0A$v35%xGfCWJN(aKeQgBnrR!{QAC-^Sc1CQ{wb{Z= zX?zO9vQrJedlkg!$szub7~)SP{bUD!COr&rWZC;8E8ibk{Qk)L_eWjf32DJC-GQde*{e%Z+9ZvzmC|uh>Al~ zjl<)7V+78paN1vIf1;IaIfMxR0j+P}7L{PVM~zt7sm$1B1^tKHFEZqn_eXA9eSJLvUK~hv!91 z5l%^u-hfpjgw?p;a{QfSHqtejjqaVy#@eHkBe9McdAG#!&kgpkq4mn-z&}wO=!iuI zJ7Q5jvB6cey@tzmuXe7C#P6a#dl$R2Yq+oN{#A64W#=92Sw&adUaEp2^9THSG&C2? zu2p|4kF`pPPW{Plo>jslahar56|2<7kA zT|~2O2O?{D@HTpU<-<{5Ip{0BF<jtDrBFjaM*`$!ZlG%4GElQkmOO>-flRXwm>S8qR*`obSLk>_jK-$3b+l$?aqF W>EW$y#!W0R${Wp~2#2;!DE$xjbxpbe diff --git a/src/api/java/ic2/api/crops/BaseSeed.class b/src/api/java/ic2/api/crops/BaseSeed.class index fd4b77b55b8a6758d544e3fdfcc874b424213fbe..988c7c6656fe0afe444f97855d7347329f7fe957 100644 GIT binary patch delta 375 zcmX9&F;2rk5S+W5ZO%9$B-q3d6OuR-M+cvPk{2Kf3Tiqe#2X@if)=3@h=MK+Kj9O= z?9$B4-tElJd;aUrzkWVG0i0o#!{g9n3sZqc;7DL5a4ay-u*k4nU$x%d-#y$Kn9KF% zwfid{XI_4u*k?K;SDC7M%XZo=!GW2h0;YNp-dvuP^J;t3pXuFJOT?A0D~N(JfjAD x9-~5yeatYyimKwq#eY0sC!Bal>l#&3*s7AsJylZLsgl}>Dk+|_aLvi$;1AQ8AM*eJ literal 1336 zcmZ`(YflqV5Iwg~wv@*L8 zujWP`AM`En`H|l7R&`ykZF}>+A4G1X1HZ1&UEOluxutE_-zc5s$Ypi?!DFF1L!X7g z`)E_4$sAnmE3}Hc?A0}`Ut^#}r}lQmB&BAxucJAIk^E&`EAlC<@}6?A&h)mb_Pv*T zJ8NF}+9gSaj%rYIw^!Xz%lYJCBHGks{jUTIZrxk)Jdwc4o6@Fs%Z3+;I!j@&Q=t$8 z`AXq3LJCPEC*^u`c}&ZSbos*FHGI;Tph7FbURd*%w2*E&WilzUW-*A_EZSkG@i>b) zJjvoI=CkNPXBIsIy#jp#{Q?65p%$1tJdfbjWj>cG@|Fa*7SaoUe!% z50Gde=?pfIa)ug6J2{@4oLsU2%gLo0$b4Z^3|ENPVG%o#ASsKKx=5#wWQIAQae5BN zGsWqQFzWg7Wo&GeCthpXQpOYdG2=-CapOq~3FAoS zL`JsoMBg>uE46y4>H%7+{hwg<7mq$8srHNgGyD80Zd7bF7frB_0?QT+$?oG+Lrs>T Zomx+@aGqHfVn5~GDDY2<63Z}(zX1u}@0I`n diff --git a/src/api/java/ic2/api/crops/BaseSeed.java b/src/api/java/ic2/api/crops/BaseSeed.java index 89e7865fa..8770bcfcf 100644 --- a/src/api/java/ic2/api/crops/BaseSeed.java +++ b/src/api/java/ic2/api/crops/BaseSeed.java @@ -9,16 +9,14 @@ public class BaseSeed { * * @param crop plant * @param size plant size - * @param statGrowth1 plant growth stat - * @param statGain1 plant gain stat - * @param statResistance1 plant resistance stat - * @param stackSize1 for internal usage only + * @param statGrowth plant growth stat + * @param statGain plant gain stat + * @param statResistance plant resistance stat + * @param stackSize for internal usage only */ - @SuppressWarnings("deprecation") public BaseSeed(CropCard crop, int size, int statGrowth, int statGain, int statResistance, int stackSize) { super(); this.crop = crop; - this.id = Crops.instance.getIdFor(crop); this.size = size; this.statGrowth = statGrowth; this.statGain = statGain; @@ -26,35 +24,11 @@ public class BaseSeed { this.stackSize = stackSize; } - /** - * @deprecated Use the CropCard version. - */ - @Deprecated - public BaseSeed(int id, int size, int statGrowth, int statGain, int statResistance, int stackSize) { - this(getCropFromId(id), size, statGrowth, statGain, statResistance, stackSize); - } - - @SuppressWarnings("deprecation") - private static CropCard getCropFromId(int id) { - CropCard[] crops = Crops.instance.getCropList(); - - if (id < 0 || id >= crops.length) return null; - - return crops[id]; - } - - /** * Plant. */ public final CropCard crop; - /** - * @deprecated IDs aren't used anymore. - */ - @Deprecated - public int id; - /** * Plant size. */ diff --git a/src/api/java/ic2/api/crops/CropCard.class b/src/api/java/ic2/api/crops/CropCard.class index e117b0c958114f63ac80433c027c5433c3a6b8d2..ed102068e5be51836b98c81c42b5ab25506aeddf 100644 GIT binary patch literal 5826 zcma)AX?RrC8GcV@Wpc?z0-}k4f=M7Sm0AUYELp(R321^)v{r8>H_0`VJL$|#BDU2Q zsoKTXF1Cekf>pa%MB4_Did9={?cUmb`QQHN^YpI|UEc4Un_)7U0QqswowI!B{l4!# z?{}WO@!uED09cQ|C2%z!O5knyNE{!P{$p``Jcfr8h{|{rpNQj=(mxW%r(*cDEcr|V zpT(n<_#8ejKffSfhof8nHKhL%ID#+A(3iqnc}8^WKMu>^5gGcjG+&YCtI|9s%~5HN z#qf9nU&9j%@Fbp+k*~+`jX1s;!?zMxg@Cs+$Tss#-HUx^@#+Iyv8Uh$UIh zckdwvW|g37IkYpEo$^PzCUUm#W<6#mZF@3yevfWtw77Yn;|`DbJ>F1e!tv5_`m*`M z(9_c+hlV8*49LjDm^c_g;RHj@Ao(#!FL&Cm*EwP{GCJa2hW9e6uyKAzT1ybQzB88WVWXMIluPL4-0efY zlM4=2sLXmPXJ{r+8bH6}49);JA3=98EdzF*Fcm-L?#WI@zc%abk{l0YCvswFm`l!Q zh*Gh{&G&JypY@!6ci6Kt-D9p#oYVu_H9rPtuTZGTdL5Z;dbEoX&1DZr1m%_ot5ZS% z4aTIgGn>h{c}>^zgs~)w0UwM7Ljg0S&~)CVjE%3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* @param crop reference to ICropTile + * @param cropTile reference to ICropTile * @param player player rightclicking the crop * @return Whether the plant has changed */ - public boolean rightclick(ICropTile crop, EntityPlayer player) { - return crop.harvest(true); + public boolean onRightClick(ICropTile cropTile, EntityPlayer player) { + return cropTile.performManualHarvest(); } /** - * Use in Crop Havester with insert Cropnalyzer to get best Output. + * Use in Crop Harvester with insert Cropnalyzer to get best Output. * - * @param crop reference to ICropTile - * @return need crop size for best output. + * @param cropTile reference to ICropTile + * @return need crop size for best output. */ - public abstract int getOptimalHavestSize(ICropTile crop); + public int getOptimalHarvestSize(ICropTile cropTile) { + return getMaxSize(); + } /** * Check whether the crop can be harvested. * - * @param crop reference to ICropTile + * @param cropTile reference to ICropTile * @return Whether the crop can be harvested in its current state. */ - public abstract boolean canBeHarvested(ICropTile crop); + public boolean canBeHarvested(ICropTile cropTile) { + return cropTile.getCurrentSize() == getMaxSize(); + } /** * Base chance for dropping the plant's gains, specify values greater than 1 for multiple drops. @@ -227,10 +218,8 @@ public abstract class CropCard { * * @return Chance to drop the gains */ - public float dropGainChance() { - float base = 1F; - for (int i = 0; i < tier(); i++) {base*=0.95;} - return base; + public double dropGainChance() { + return Math.pow(0.95, getProperties().getTier()); } /** @@ -245,24 +234,26 @@ public abstract class CropCard { * Get the size of the plant after harvesting. * Default is 1. * - * @param crop reference to ICropTile + * @param cropTile reference to ICropTile * @return Plant size after harvesting */ - public byte getSizeAfterHarvest(ICropTile crop) {return 1;} + public int getSizeAfterHarvest(ICropTile cropTile) { + return 1; + } /** - * Called when the plant is leftclicked by a player. + * Called when the plant is left clicked by a player. * Default action is picking the plant. * - * Only called Serverside. + * Only called server side. * - * @param crop reference to ICropTile - * @param player player leftclicked the crop + * @param cropTile reference to ICropTile + * @param player player left clicked the crop * @return Whether the plant has changed */ - public boolean leftclick(ICropTile crop, EntityPlayer player) { - return crop.pick(true); + public boolean onLeftClick(ICropTile cropTile, EntityPlayer player) { + return cropTile.pick(); } /** @@ -273,10 +264,12 @@ public abstract class CropCard { * @return Chance to drop the seeds */ public float dropSeedChance(ICropTile crop) { - if (crop.getSize() == 1) return 0; + if (crop.getCurrentSize() == 1) return 0; float base = 0.5F; - if (crop.getSize() == 2) base/=2F; - for (int i = 0; i < tier(); i++) {base*=0.8;} + if (crop.getCurrentSize() == 2) base/=2F; + for (int i = 0; i < getProperties().getTier(); i++) { + base*=0.8; + } return base; } @@ -289,7 +282,7 @@ public abstract class CropCard { * @return Seeds */ public ItemStack getSeeds(ICropTile crop) { - return crop.generateSeeds(crop.getCrop(), crop.getGrowth(), crop.getGain(), crop.getResistance(), crop.getScanLevel()); + return crop.generateSeeds(crop.getCrop(), crop.getStatGrowth(), crop.getStatGain(), crop.getStatResistance(), crop.getScanLevel()); } /** @@ -302,11 +295,22 @@ public abstract class CropCard { } /** - * Check if the crop should emit redstone. + * Check if the crop emits a redstone signal. * - * @return Whether the crop should emit redstone + * @return Whether the crop emits a redstone signal. */ - public int emitRedstone(ICropTile crop) {return 0;} + public boolean isRedstoneSignalEmitter(ICropTile cropTile) { + return false; + } + + /*** + * Get the emitted redstone signal strength. + * + * @return The redstone signal strength. + */ + public int getEmittedRedstoneSignal(ICropTile cropTile) { + return 0; + } /** * Called when the crop is destroyed. @@ -335,11 +339,7 @@ public abstract class CropCard { * @return Whether trampling calculation should happen, return false if the plant is no longer valid. */ public boolean onEntityCollision(ICropTile crop, Entity entity) { - if (entity instanceof EntityLivingBase) { - return ((EntityLivingBase) entity).isSprinting(); - } - - return false; + return (entity instanceof EntityLivingBase && entity.isSprinting()); } @@ -347,9 +347,9 @@ public abstract class CropCard { * Called every time the crop ticks. * Should be called every 256 ticks or around 13 seconds. * - * @param crop reference to ICropTile + * @param cropTile reference to ICropTile */ - public void tick(ICropTile crop) { + public void tick(ICropTile cropTile) { // nothing by default } @@ -357,38 +357,36 @@ public abstract class CropCard { * Check whether this plant spreads weed to surrounding tiles. * Default is true if the plant has a high growth stat (or is weeds) and size greater or equal than 2. * - * @param crop reference to ICropTile + * @param cropTile reference to ICropTile * @return Whether the plant spreads weed */ - public boolean isWeed(ICropTile crop) { - return crop.getSize() >= 2 && - (crop == Crops.weed || crop.getGrowth() >= 24); + public boolean isWeed(ICropTile cropTile) { + return cropTile.getCurrentSize() >= 2 && + (cropTile.getCrop() == Crops.weed || cropTile.getStatGrowth() >= 24); } - /** - * Get this plant's ID. - * - * @return ID of this CropCard or -1 if it's not registered - * @deprecated IDs aren't used anymore. + * Retrieve the crop world. + * @param cropTile reference to ICropTile. + * @return The crop world object. */ - @Deprecated - public final int getId() { - return Crops.instance.getIdFor(this); + public World getWorld(ICropTile cropTile) { + return cropTile.getWorld(); } - private static String getModId() { - ModContainer modContainer = Loader.instance().activeModContainer(); + /** + * Retrieve the crop's unlocalized name. + * @return Unlocalized name + */ + public String getUnlocalizedName() { + return "crop." + getName() + ".name"; + } - if (modContainer != null) { - return modContainer.getModId(); - } else { - // this is bad if you are not actually IC2 - assert false; - - return "unknown"; + public List getModelLocation() { + List ret = new ArrayList(); + for (int i = 1; i <= getMaxSize(); i++) { + ret.add(new ResourceLocation(getOwner().toLowerCase(Locale.ENGLISH), "blocks/crop/"+getName()+"_"+i)); } + return ret; } - - private final String modId; // TODO: make owner abstract, remove modId auto detection } diff --git a/src/api/java/ic2/api/crops/CropProperties.class b/src/api/java/ic2/api/crops/CropProperties.class new file mode 100644 index 0000000000000000000000000000000000000000..31cd7c24f988951f5a2bd8211de8ad1e11ad60b5 GIT binary patch literal 1229 zcmaJcuA^u2-|B+XW5-`|Ww9&Cl%VY3w-(k}){ zoTS^GnACS+xTRn|jG9sVF~h2>`l)U3Y$e%Z^w3(=3}1BiH^X$jmuqA#3H*4&Pa|0$ zZ5r*}sHIR@i-JYZKZv{_O%7V#3h^bsFr~=W0|jd*Y_Ds*`D%@d9j;eSL=VdHlx{hG zdLn&5AOBS^x!&johUqQG@ku4huh!l&zx^udq(S&Bl3N)4SI+#Nf9N|nkGl?rFzn#0 zz=*)8z&U}kz-3e%ToJe`FePve6@`i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crops.java +++ b/src/api/java/ic2/api/crops/Crops.java @@ -4,6 +4,7 @@ import java.util.Collection; import net.minecraft.item.ItemStack; import net.minecraft.world.biome.Biome; + import net.minecraftforge.common.BiomeDictionary.Type; /** @@ -75,42 +76,18 @@ public abstract class Crops { */ public abstract Collection getCrops(); - /** - * Returns the list of registered crops. - * - * @return Registered crops by ID - */ - @Deprecated - public abstract CropCard[] getCropList(); - - /** - * Register a plant. - * - * @param crop Plant to register. - * @return Autoassigned id for legacy compatibility, TODO: change to void. - */ - public abstract short registerCrop(CropCard crop); - /** * Register a plant and provide a legacy id for migration. * * @param crop Plant to register. - * @param legacyId ID previously used for this crop. - * @return true, TODO: change to void. */ - public abstract boolean registerCrop(CropCard crop, int legacyId); - - /** - * @deprecated use the CropCard version. - */ - @Deprecated - public abstract boolean registerBaseSeed(ItemStack stack, int id, int size, int growth, int gain, int resistance); + public abstract void registerCrop(CropCard crop); /** * Registers a base seed, an item used to plant a crop. * * @param stack item - * @param id plant ID + * @param crop crop * @param size initial size * @param growth initial growth stat * @param gain initial gain stat @@ -127,12 +104,10 @@ public abstract class Crops { public abstract BaseSeed getBaseSeed(ItemStack stack); /** - * Returns the ID for the given crop. + * Execute registerSprites for all registered crop cards. * - * @param crop Crop to look up - * @return ID, or -1 if not found - * @deprecated IDs aren't used anymore. + * This method will get called by IC2, don't call it yourself. */ - @Deprecated - public abstract int getIdFor(CropCard crop); + //@SideOnly(Side.CLIENT) + //public abstract void startSpriteRegistration(IIconRegister iconRegister); } diff --git a/src/api/java/ic2/api/crops/ICropSeed.class b/src/api/java/ic2/api/crops/ICropSeed.class new file mode 100644 index 0000000000000000000000000000000000000000..21e648ea1b38655a546f6c79aef92dce1f25d128 GIT binary patch literal 669 zcmah{!A=4(5Pd}i1w{mfc+`_zY{E&ykwmfyiHVzduVus{+a=wi|K`CD@S}{gn~hlo zvzM8?&U>#joqm43e*hSwU&m=3J%RR|{Mf~-TNg*6SNcWZ`f_T?%g9*LPCa>PJVi3# zkP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#8H1~qk%w_>Cmf!1_?pAl9iDP{+Tj}x&p12_b2iUS zn74KTZdrTV;X4j5I=tlYvdgpL>|JM9!L#uNxM%Hs7xw@jTD<10505NJ=*12e1DCaS~6< diff --git a/src/api/java/ic2/api/crops/ICropTile.java b/src/api/java/ic2/api/crops/ICropTile.java index 0d50f8e9a..8df7968d6 100644 --- a/src/api/java/ic2/api/crops/ICropTile.java +++ b/src/api/java/ic2/api/crops/ICropTile.java @@ -1,5 +1,7 @@ package ic2.api.crops; +import java.util.List; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -24,31 +26,19 @@ public interface ICropTile { */ public void setCrop(CropCard cropCard); - /** - * @deprecated IDs have been removed. - */ - @Deprecated - public short getID(); - - /** - * @deprecated IDs have been removed. - */ - @Deprecated - public void setID(short id); - /** * Get the crop's plant size. * * @return Plant size, starting with 1 and maximum varies depending on plant */ - public byte getSize(); + public int getCurrentSize(); /** * Set the crop's plant size. * * @param size Plant size */ - public void setSize(byte size); + public void setCurrentSize(int size); /** * Get the crop's plant growth stat. @@ -56,14 +46,14 @@ public interface ICropTile { * * @return Plant growth stat */ - public byte getGrowth(); + public int getStatGrowth(); /** * Set the crop's plant growth stat. * * @param growth Plant growth stat */ - public void setGrowth(byte growth); + public void setStatGrowth(int growth); /** * Get the crop's plant gain stat. @@ -71,14 +61,14 @@ public interface ICropTile { * * @return Plant gain stat */ - public byte getGain(); + public int getStatGain(); /** * Set the crop's plant gain stat. * * @param gain Plant gain stat */ - public void setGain(byte gain); + public void setStatGain(int gain); /** * Get the crop's plant resistance stat. @@ -86,14 +76,58 @@ public interface ICropTile { * * @return Plant resistance stat */ - public byte getResistance(); + public int getStatResistance(); /** * Set the crop's plant resistance stat. * * @param resistance Plant resistance stat */ - public void setResistance(byte resistance); + public void setStatResistance(int resistance); + + /** + * Get the crop's nutrient storage. + * Ranges from 0 to 100. + * + * @return Crop nutrient storage + */ + public int getStorageNutrient(); + + /** + * Set the crop's nutrient storage. + * + * @param storageNutrient Crop nutrient storage + */ + public void setStorageNutrient(int storageNutrient); + + /** + * Get the crop's hydration storage. + * 0 indicates nothing, 1-10 indicate water hydration and 11-100 for hydration cells. + * + * @return Crop hydration storage + */ + public int getStorageWater(); + + /** + * Set the crop's water storage. + * + * @param storageWater Crop water storage + */ + public void setStorageWater(int storageWater); + + /** + * Get the crop's Weed-Ex storage. + * + * @return Crop Weed-Ex storage + */ + public int getStorageWeedEX(); + + /** + * Set the crop's Weed-Ex storage. + * + * @param storageWeedEX Crop Weed-Ex storage + */ + public void setStorageWeedEX(int storageWeedEX); /** * Get the crop's plant scan level. @@ -101,14 +135,22 @@ public interface ICropTile { * * @return Plant scan level */ - public byte getScanLevel(); + public int getScanLevel(); /** * Set the crop's plant scan level. * * @param scanLevel Plant scan level */ - public void setScanLevel(byte scanLevel); + public void setScanLevel(int scanLevel); + + public int getGrowthPoints(); + + public void setGrowthPoints(int growthPoints); + + public boolean isCrossingBase(); + + public void setCrossingBase(boolean crossingBase); /** * Get the crop's plant custom data, stored alongside the crop. @@ -118,50 +160,6 @@ public interface ICropTile { */ public NBTTagCompound getCustomData(); - /** - * Get the crop's nutrient storage. - * Ranges from 0 to 100. - * - * @return Crop nutrient storage - */ - public int getNutrientStorage(); - - /** - * Set the crop's nutrient storage. - * - * @param nutrientStorage Crop nutrient storage - */ - public void setNutrientStorage(int nutrientStorage); - - /** - * Get the crop's hydration storage. - * 0 indicates nothing, 1-10 indicate water hydration and 11-100 for hydration cells. - * - * @return Crop hydration storage - */ - public int getHydrationStorage(); - - /** - * Set the crop's hydration storage. - * - * @param hydrationStorage Crop hydration storage - */ - public void setHydrationStorage(int hydrationStorage); - - /** - * Get the crop's Weed-Ex storage. - * - * @return Crop Weed-Ex storage - */ - public int getWeedExStorage(); - - /** - * Set the crop's Weed-Ex storage. - * - * @param weedExStorage Crop Weed-Ex storage - */ - public void setWeedExStorage(int weedExStorage); - /** * Get the crop's humidity. * Ranges from 0 (dry) to 10 (humid). @@ -171,7 +169,7 @@ public interface ICropTile { * * @return Crop humidity level */ - public byte getHumidity(); + public int getHumidity(); /** * Get the crop's nutrient level. @@ -182,7 +180,7 @@ public interface ICropTile { * * @return Crop nutrient level */ - public byte getNutrients(); + public int getNutrients(); /** * Get the crop's air quality. @@ -193,7 +191,7 @@ public interface ICropTile { * * @return Crop air quality */ - public byte getAirQuality(); + public int getAirQuality(); /** * Get the crop's world. @@ -219,27 +217,23 @@ public interface ICropTile { /** * Pick the crop, removing and giving seeds for the plant. * - * @param manual whether it was done by hand (not automated) * @return true if successfully picked */ - public boolean pick(boolean manual); + public boolean pick(); /** * Harvest the crop, turning it into gain and resetting its size. * drop output on ground - * @param manual - * @return true if successfully harvested */ - public boolean harvest(boolean manual); + public boolean performManualHarvest(); /** * Harvest the crop, turning it into gain and resetting its size. * drop output on ground - * @param Optimal force check getOptimalHavestSize() for harvest - * @return ItemStack[] of harvest output + * @return List of harvest output */ - ItemStack[] harvest_automated(boolean Optimal); + public List performHarvest(); /** * Fully clears the crop without dropping anything. @@ -253,28 +247,31 @@ public interface ICropTile { /** * Check if a block is under the farmland containing the crop. - * Searches up to 2 blocks below the farmland or an air space, whichever appears first. + * Searches up to 4 blocks below the farmland or an air space, whichever appears first. * * @param block block to search * @return Whether the block was found */ public boolean isBlockBelow(Block block); + /** + * Check if a block is under the farmland containing the crop. + * Searches up to 4 blocks below the farmland or an air space, whichever appears first. + * + * @param oreDictionaryName blocks to search + * @return Whether the blocks were found + */ + public boolean isBlockBelow(String oreDictionaryName); + /** * Generate plant seeds with the given parameters. * * @param crop plant * @param growth plant growth stat * @param gain plant gain stat - * @param resis plant resistance stat + * @param resistance plant resistance stat * @param scan plant scan level * @return Plant seed item */ - public ItemStack generateSeeds(CropCard crop, byte growth, byte gain, byte resis, byte scan); - - /** - * @deprecated Use the CropCard version instead. - */ - @Deprecated - public ItemStack generateSeeds(short plant, byte growth, byte gain, byte resis, byte scan); + public ItemStack generateSeeds(CropCard crop, int growth, int gain, int resistance, int scan); } diff --git a/src/api/java/ic2/api/crops/package-info.class b/src/api/java/ic2/api/crops/package-info.class index 1c2c0e11984088047c361a7591da7bbcffd08763..3ca3f3754d9db5e42c32b940a7f55e1f1c94d9e9 100644 GIT binary patch delta 30 lcmey**vT}(Uqsm_FSSHJH#09axhOHMBrU%vJ#}K_G61XX3%~#X delta 20 bcmeBV`p-DQpG(pwxu9G>H$SC#V)8NoN~;H; diff --git a/src/api/java/ic2/api/energy/IEnergyNet.class b/src/api/java/ic2/api/energy/IEnergyNet.class index 76b57463009c67c5633516769459b0f2e79b80f4..1880b7d3ecd099481294f73f2eb5c60b6d2943df 100644 GIT binary patch literal 582 zcmb7BO;5r=5PgeC5mEfQ_z&pCO}I9CFhJ6TAPFR1UCLOCZP%<@iGR(5KfoVloGwI7 zW1?Q>Wp-xXdo%m?{_+Z-hZ7G+9*zaPnCvV`N#LeC%E`(s$tg1G*2IcJqM`eo&gPI~vS&;6qy$bYa$gNhTDHhk<*~e)FDbGO0f8F- lJmA#@wonHcw>Q{;=kg|Y9Ja9Qu#G*3`{?i_^Kz`=@B@}>r=S1; literal 727 zcma)4O-}+b5S=1|@*${z;UB=oCR{m@?2>Fk&J-8`Cvj{B))fmlGBc%$9-Q8A&ue6%r#IE)3r&oy_@@ zjr|}9x(Bc!E;=sX$@CeNNq3AQex51K;O$WLZ`!{0Lg^TJq|#JLo)Lo&?TaTgMn)*v zKX#U;^{7mk_!4!z^;2OC&KY!$o2u(ED0#S|wxQ#-A2M>B;-grLS%L#8N!(7fX3!cf z!`F}}p^W*CLknr_4>8H)3rYqRyC*fr2`LbLaO6lM5%qYu5*(c+{wqP9>LhuuHmHYM zrBi{l|9mH~E-YdnEZ{0E;&lV^H&L06a7fo=Pz!z*HAZu5-7sh$wA&Ss=+5xnY)Pjn zFkq0QZw64zGdO`f0OeCCxLkxYLeCvuqFA8nvO_BWB2~C>6*Z{4d?WN=L}2aRuQ C0@Pao diff --git a/src/api/java/ic2/api/energy/IEnergyNet.java b/src/api/java/ic2/api/energy/IEnergyNet.java index cee3344d1..fc2dc58a0 100644 --- a/src/api/java/ic2/api/energy/IEnergyNet.java +++ b/src/api/java/ic2/api/energy/IEnergyNet.java @@ -1,76 +1,66 @@ package ic2.api.energy; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import ic2.api.energy.tile.IEnergyTile; + /** * Interface representing the methods provided by the global EnergyNet class. - * + * * See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyNet { /** - * Get the EnergyNet-registered tile entity at the specified position. - * - * This is not the same as World.getTileEntity(), it's possible to register delegate tile - * entities with the energy net which are different from what's actually in the world. Those - * delegates allow to use separate TileEntity objects just for the EnergyNet interfaces, - * simplifying cross-mod dependencies and multi-blocks. - * - * @param world World containing the tile entity - * @param x x-coordinate - * @param y y-coordinate - * @param z z-coordinate - * @return tile entity registered to the energy net or null if none is registered + * Get the EnergyNet-registered tile for the specified position. + * + * The returned tile is always the main tile implementing IEnergySource/-Sink/-Conductor, which + * is also what was registered to the energy net. + * + * For multi-blocks (IMetaDelegate) the connectivity handling is being done by sub tiles that + * may or may not include the main tile. Sub tiles have to be queried separately through the + * getSubTile method. + * + * As a consequence of always returning the main tile, the supplied position may not match the + * returned tile's position. + * + * Connectivity checking -> IEnergyEmitter/IEnergyAcceptor -> getSubTile + * Logic like energy I/O -> IEnergySource/IEnergySink/IEnergyConductor -> getTile + * + * @param world World containing the tile + * @param pos position + * @return main tile for the specified position or null if none is registered */ - TileEntity getTileEntity(World world, BlockPos pos); + IEnergyTile getTile(World world, BlockPos pos); /** - * Get the EnergyNet-registered neighbor tile entity at the specified position. - * - * @param te TileEntity indicating the world and position to search from - * @param dir direction the neighbor is to be found - * @return neighbor tile entity registered to the energy net or null if none is registered + * Get the sub tile at the specified position. + * + * See the description of {@link #getTile} about whether getTile or getSubTile is applicable. + * + * @param world World containing the tile + * @param pos position + * @return sub tile at the specified position or null if none is registered */ - TileEntity getNeighbor(TileEntity te, EnumFacing dir); + IEnergyTile getSubTile(World world, BlockPos pos); - /** - * determine how much energy has been emitted by the EnergyEmitter specified - * - * @note call this twice with x ticks delay to get the avg. emitted power p = (call2 - call1) / x EU/tick - * - * @param tileEntity energy emitter - * @deprecated Discontinued, use getNodeStats instead. - */ - @Deprecated - double getTotalEnergyEmitted(TileEntity tileEntity); + World getWorld(IEnergyTile tile); - /** - * determine how much energy has been sunken by the EnergySink specified - * - * @note call this twice with x ticks delay to get the avg. sunken power p = (call2 - call1) / x EU/tick - * - * @param tileEntity energy emitter - * @deprecated Discontinued, use getNodeStats instead. - */ - @Deprecated - double getTotalEnergySunken(TileEntity tileEntity); + BlockPos getPos(IEnergyTile tile); /** * Retrieve statistics for the tile entity specified. - * + * * The statistics apply to the last simulated tick. - * - * @param te Tile entity to check. + * + * @param tile Tile entity to check. * @return Statistics for the tile entity. */ - NodeStats getNodeStats(TileEntity te); + NodeStats getNodeStats(IEnergyTile tile); /** * Determine the typical power used by the specific tier, e.g. 128 eu/t for tier 2. - * + * * @param tier tier * @return power in eu/t */ @@ -78,7 +68,7 @@ public interface IEnergyNet { /** * Determine minimum tier required to handle the specified power, e.g. tier 2 for 128 eu/t. - * + * * @param power in eu/t * @return tier */ diff --git a/src/api/java/ic2/api/energy/event/EnergyTileEvent.class b/src/api/java/ic2/api/energy/event/EnergyTileEvent.class index 25e3e25e4fea284b72ff2c8617e22006c07c9d2c..5d1523da6b2a9968d1b7617d3ac6d95b4f6c2a11 100644 GIT binary patch delta 352 zcmZ{f%}N4c6o#Mgv-+HIL@F(R$}FcpEr*0CDBJ}F)uy2JWP?aDip@soCS+*Uwkv3n z)S?S$(M5D2)u%y=ptCsVJ?DKmobx_$uXf))UtWPKjzNZOj2v?&Ci5l+dBsAMg2_0G zhVGXXMTIRG3;O$mWc(~}>(?i4=iI$)c_VK*ObI)ySg}}TO|foKqHGaoW2iPmUu=s? z_#kdu>1Ms^xSgis`Chlta}Gx3)C&aBrhgN-e%%w~j{jgszucZ6^RKCwG`!%V-ECb7 zYW;RG+>*7hA`9W2+)4L{AobgJ=@C(WMoI=mN>Aa3v=0;d+DY2Mi>De%B XVps_6LIUxnVW~(d4Wh@hI!n^uTPZ~% delta 320 zcmYLF%Syvg5Iy&Xdd;JVRpX=eku<*2MNsI%rGnr_Tv%|aX}y-z7$sZ?1wTT$OBdol zh=Pma+J&Fsr>N7qa5J1abIxIA9>nL^-pBXb0KhgH0t*%xsunENOqf^{SQ^K&g%VbV zy(i!c)EO+9$-LWdC8=ca^cnZ=Pw#yDpWR|8AFH@?c^Kcc;&v)W&OjS1Xfo6@siLbS zlbt-iP?4e-nW;qeqhaFy2s&8Bnu9Xd9c*Az@3JNfb-`{OyDQbnb)KFdwR?KNef`Ki zvs4TjT3$c#s{Z0TZUF3swLC delta 20 bcmbQh)W$TypG(pwxu9G>H$SC#V)9x5Ld^#@ diff --git a/src/api/java/ic2/api/energy/package-info.class b/src/api/java/ic2/api/energy/package-info.class index baaed208f9a33befaa16ebb85ab6260da0b3fd52..68a0db695e2cbb94f24c0b0745b9fbeee2c26975 100644 GIT binary patch delta 30 lcmZo*>SCJUFQV*|ms+Bqo0*rIT$Gqrl9peTo;opdIRKqS3q$|_ delta 20 bcmeBTYG9h+&n4-TTu`o`o1aoVF?l%vLE{G` diff --git a/src/api/java/ic2/api/energy/prefab/BasicSink.class b/src/api/java/ic2/api/energy/prefab/BasicSink.class index b0b895ce08c74517c0b1f0242022fa36dce9cd87..35d58ecb53ac25ab67e0eea5d582f88213172419 100644 GIT binary patch literal 5710 zcma)9YkVA4760GtW+%IyBs7%PwrOe8mL?m@KoJB3r6k$3TayA!+R|#l$!3yFvpW+v zn*b_Lk>VQxftHu}Lb39aY|BGbR8)N7ThLE_)sKGDANW6ab~l^JmgdWyyZ3R<|D5wb z=iGhcotIt(uoeGEU<+=J<6PV#!>uyhCd2Is4tL1zr{cI1pHAQ|9FdK?W$iOE`)nMa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%RHfMB*s=QhXCBV#xxH%JvyFFQ6sdwl3hTaJzH?ZBOIuQ&_f# zVL7LW<-1d{1vD(e>qHYReTu=n4eM|_({Kladnety3u8EpJ-E99_IL&C2B`n=wUQ|p z0`KKhfX8WU1;cReV&GdC4)DKG4ENCDy%jp+p-v@}GE`)T5$Kc%9K~ww^$P9DO7Y}8 z?MbxClQx~c2hfa%(2j>msYfcTbXFi|`qt7A$86bLRKr`5>N$Z`J#FnptR6{iXj@an z`3vY+^dhkF7)kUvOguq4J*jPU1lL0wzzU3D2bG&l`}N#KxaXt}%^e|9iAI;0Tl*+t zBd5@{=LFV`&?G(XDB=Qw*igiUPw@(9t_hvIA`D&wgX?oVd!DDK$l@1SF)v{iUZ%_| z8jdhIPN^Gkqh?=M8CX{cY$@78V8TEHk!uZ%g2u+MGel|esf`m+^f;x03To7cuUCY& zp`5^7*d1QpOz8;kG^SRu2p0nwRKpuY|EAWkJdi5mYlKvq7`~}4kXS8{f7AuCr#_I1 zMi2n`CxQIy9e_xo3y^Vqn5)#KMX;rabUaZLk$=|(@)7I}FK=f4BHitf{z+9L+1=|Jpwg*jao>TE1i%dkc*M~6DM!gQ(hsI$T} zi?D-+Cy)-EdW&?H=DfG(Rm55F$IuWxF5EjTUQTcCZaMOx9JN1$=JvzgM;<_9`{C_R zBiYkUff$d2D8!=AqPq#(HP-Glv39rIS9&S*si-5>1yfys73xBquadY(rErbffE(1s z8hMTN{ug=C8he?PvtTP$uVBe@~Pm}RoPRk z@@lI5z!|Fa>#D41^_tOYD^+egLzS~^je+BfeWRy{4Ye=_StZwKou^kx&~WR;;N$hR zUsS98I%*$&&)RdyGtSZ;w(u#H6RB-d>L#r<7!r{(n<6NL-xm?g@#{dE%YkyUxk_gd zXl+@nfs?qnrtPS`6(KIwxWYjk3PIh(nrb8{Q> + + /** + * Forward for the base TileEntity's update(), used for creating the energy net link. + * Either updateEntity or onLoaded have to be used. + */ + @Override + public void update() { + if (!addedToEnet) onLoaded(); + } + + /** + * Notification that the base TileEntity finished loaded, for advanced uses. + * Either updateEntity or onLoaded have to be used. + */ + public void onLoaded() { + if (!addedToEnet && + !parent.getWorld().isRemote && + Info.isIc2Available()) { + worldObj = parent.getWorld(); + pos = parent.getPos(); + + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + + addedToEnet = true; + } + } + + /** + * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void invalidate() { + super.invalidate(); + + onChunkUnload(); + } + + /** + * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void onChunkUnload() { + if (addedToEnet && + Info.isIc2Available()) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + + addedToEnet = false; + } + } + + /** + * Forward for the base TileEntity's readFromNBT(), used for loading the state. + * + * @param tag Compound tag as supplied by TileEntity.readFromNBT() + */ + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + + NBTTagCompound data = tag.getCompoundTag("IC2BasicSink"); + + energyStored = data.getDouble("energy"); + } + + /** + * Forward for the base TileEntity's writeToNBT(), used for saving the state. + * + * @param tag Compound tag as supplied by TileEntity.writeToNBT() + */ + @Override + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + try { + super.writeToNBT(tag); + } catch (RuntimeException e) { + // happens if this is a delegate, ignore + } + + NBTTagCompound data = new NBTTagCompound(); + + data.setDouble("energy", energyStored); + + tag.setTag("IC2BasicSink", data); + + return tag; + } + + // << in-world te forwards + // methods for using this adapter >> + + /** + * Get the maximum amount of energy this sink can hold in its buffer. + * + * @return Capacity in EU. + */ + public int getCapacity() { + return capacity; + } + + /** + * Set the maximum amount of energy this sink can hold in its buffer. + * + * @param capacity1 Capacity in EU. + */ + public void setCapacity(int capacity1) { + this.capacity = capacity1; + } + + /** + * Get the IC2 energy tier for this sink. + * + * @return IC2 Tier. + */ + public int getTier() { + return tier; + } + + /** + * Set the IC2 energy tier for this sink. + * + * @param tier1 IC2 Tier. + */ + public void setTier(int tier1) { + this.tier = tier1; + } + + /** + * Determine the energy stored in the sink's input buffer. + * + * @return amount in EU, may be above capacity + */ + public double getEnergyStored() { + return energyStored; + } + + /** + * Set the stored energy to the specified amount. + * + * This is intended for server -> client synchronization, e.g. to display the stored energy in + * a GUI through getEnergyStored(). + * + * @param amount + */ + public void setEnergyStored(double amount) { + energyStored = amount; + } + + /** + * Determine if the specified amount of energy is available. + * + * @param amount in EU + * @return true if the amount is available + */ + public boolean canUseEnergy(double amount) { + return energyStored >= amount; + } + + /** + * Use the specified amount of energy, if available. + * + * @param amount amount to use + * @return true if the amount was available + */ + public boolean useEnergy(double amount) { + if (canUseEnergy(amount) && !FMLCommonHandler.instance().getEffectiveSide().isClient()) { + energyStored -= amount; + + return true; + } + return false; + } + + /** + * Discharge the supplied ItemStack into this sink's energy buffer. + * + * @param stack ItemStack to discharge (null is ignored) + * @param limit Transfer limit, values <= 0 will use the battery's limit + * @return true if energy was transferred + */ + public boolean discharge(ItemStack stack, int limit) { + if (stack == null || !Info.isIc2Available()) return false; + + double amount = capacity - energyStored; + if (amount <= 0) return false; + + if (limit > 0 && limit < amount) amount = limit; + + amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, true, false); + + energyStored += amount; + + return amount > 0; + } + + // << methods for using this adapter + + // backwards compatibility (ignore these) >> + + @Deprecated + public void onupdate() { + update(); + } + + @Deprecated + public void onInvalidate() { + invalidate(); + } + + @Deprecated + public void onOnChunkUnload() { + onChunkUnload(); + } + + @Deprecated + public void onReadFromNbt(NBTTagCompound tag) { + readFromNBT(tag); + } + + @Deprecated + public void onWriteToNbt(NBTTagCompound tag) { + writeToNBT(tag); + } + + // << backwards compatibility + + // ****************************** + // *** Methods for use by ic2 *** + // ****************************** + + // energy net interface >> + + @Override + public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing direction) { + return true; + } + + @Override + public double getDemandedEnergy() { + return Math.max(0, capacity - energyStored); + } + + @Override + public double injectEnergy(EnumFacing directionFrom, double amount, double voltage) { + energyStored += amount; + + return 0; + } + + @Override + public int getSinkTier() { + return tier; + } + + // << energy net interface + + + public final TileEntity parent; + + protected int capacity; + protected int tier; + protected double energyStored; + protected boolean addedToEnet; +} diff --git a/src/api/java/ic2/api/energy/prefab/BasicSource.class b/src/api/java/ic2/api/energy/prefab/BasicSource.class index 164213b2c6374ebd4c8f35f686458dbfed330fa9..1ac62875a907c50a9108021693013e9ddfd9f680 100644 GIT binary patch literal 5805 zcma)9X?R>^6@Kq*H#50SA>C3+N}7^(Iw_r!(kcc^+bncS($*$zZAI~Ba+6#-b8nnX zQV@_;MBGr>T3JL?T#%)bv{0;wh>E!3E`rMs|N8i-zw`m$^W8g>o5_^s$9&&+zvZ0w zobNs7eDm^~&z=I%hQB3{#nVk!Y5?zlQQ~L9G}K#bljQ1+4yV%pTp;6?JhZaw~l)fSS-_N+*^bD5@^Da8XT4W z3v&8?S$ROmgE}6P$!n$gqBIXD@FhGV&6gAS3cec0qxf1azK(B*(me_+E#(XjE3l_dsxPXb%5u?BZq( zspOoLc4pS>qoxjb(9$r!hY)v;=Lf7pzd4ZOOnr}=HFNvSf-T?vWTZG^k7-!hV`tma z=BScdGvSK~T8u1P~RBy4BG%-P=RJlE+M8Fvotb#h#$Hwu6H#} z28wB}^qa#SZhq7qcLv)7I+4GYcmHX~3{m z>?l)!#*+lKW5KydvQseY+}N+k!A+!x&Q0ETB&jZRJ~xmQ0jkXBmYFj#GfyXwH?q0A zU|G|u)xZSYBax#a4B-rMpga zS|m`G_s*+ax`)W@ytU6Bvq`+Ij^h^1qU}25-Qu3B%n37{Go9h|^chmkaGgwm9`jvi z*Gz(tFndZA8KB`ju;0H*`J89v?c$hccfYIQvScO0C2-RjZ^zbb)*59TwpZ9V&Q0kq zXFT7{P0Wlu;1x6DZt0BDG)Z_L-L!{?0};DUd~4tm?9g${z_;{|JlG_@K;7yg>AF*DwFR_2tv$R6=k-h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G-qkST=BX8i_O=zAnC5LiGSkTwE9V3;7j< z?kqOURhYnOmms0KB8IM{Sb?CxK1XNsvd3A$ugmh>T9%iQ<>pglIbN4#q?!jPd&si) z6j{EP)h|$d6Acp+4YD1xIIk9FAH(%>%`+$j(QplFYCRj2>T|bhx$hwNo&PuY36yE) z&BVN!vjlf6QB!QxRhnxM60vGX#4s7YJz|)`H1$?|22?8S#xU9B;UEENoWS|D>2^)T zzGgMu4px)DoApQ#H3f+zL0qe}gR~lnDBVKCuX{{}04x Bus{F+ diff --git a/src/api/java/ic2/api/energy/prefab/BasicSource.java b/src/api/java/ic2/api/energy/prefab/BasicSource.java new file mode 100644 index 000000000..9715cd4bd --- /dev/null +++ b/src/api/java/ic2/api/energy/prefab/BasicSource.java @@ -0,0 +1,376 @@ +package ic2.api.energy.prefab; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ITickable; + +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.FMLCommonHandler; + +import ic2.api.energy.EnergyNet; +import ic2.api.energy.event.EnergyTileLoadEvent; +import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergyAcceptor; +import ic2.api.energy.tile.IEnergySource; +import ic2.api.info.Info; +import ic2.api.item.ElectricItem; + +/** + * BasicSource is a simple adapter to provide an ic2 energy source. + * + * It's designed to be attached to a tile entity as a delegate. Functionally BasicSource acts as a + * one-time configurable output energy buffer, thus providing a common use case for generators. + * + * Sub-classing BasicSource instead of using it as a delegate works as well, but isn't recommended. + * The delegate can be extended with additional functionality through a sub class though. + * + * The constraints set by BasicSource like the strict tank-like energy buffering should provide a + * more easy to use and stable interface than using IEnergySource directly while aiming for + * optimal performance. + * + * Using BasicSource involves the following steps: + * - create a BasicSource instance in your TileEntity, typically in a field + * - forward invalidate, onChunkUnload, readFromNBT, writeToNBT and updateEntity to the BasicSource + * instance. + * If you have other means of determining when the tile entity is fully loaded, notify onLoaded + * that way instead of forwarding updateEntity. + * - call addEnergy whenever appropriate, using getFreeCapacity may determine if e.g. the generator + * should run + * - optionally use getEnergyStored to display the output buffer charge level + * - optionally use setEnergyStored to sync the stored energy to the client (e.g. in the Container) + * + * Example implementation code: + * @code{.java} + * public class SomeTileEntity extends TileEntity { + * // new basic energy source, 1000 EU buffer, tier 1 (32 EU/t, LV) + * private BasicSource ic2EnergySource = new BasicSource(this, 1000, 1); + * + * @Override + * public void invalidate() { + * ic2EnergySource.invalidate(); // notify the energy source + * ... + * super.invalidate(); // this is important for mc! + * } + * + * @Override + * public void onChunkUnload() { + * ic2EnergySource.onChunkUnload(); // notify the energy source + * ... + * } + * + * @Override + * public void readFromNBT(NBTTagCompound tag) { + * super.readFromNBT(tag); + * + * ic2EnergySource.readFromNBT(tag); + * ... + * } + * + * @Override + * public void writeToNBT(NBTTagCompound tag) { + * super.writeToNBT(tag); + * + * ic2EnergySource.writeToNBT(tag); + * ... + * } + * + * @Override + * public void update() { + * ic2EnergySource.update(); // notify the energy source + * ... + * ic2EnergySource.addEnergy(5); // add 5 eu to the source's buffer this tick + * ... + * } + * + * ... + * } + * @endcode + */ +public class BasicSource extends TileEntity implements IEnergySource, ITickable { + // ********************************** + // *** Methods for use by the mod *** + // ********************************** + + /** + * Constructor for a new BasicSource delegate. + * + * @param parent1 Base TileEntity represented by this energy source. + * @param capacity1 Maximum amount of eu to store. + * @param tier1 IC2 tier, 1 = LV, 2 = MV, ... + */ + public BasicSource(TileEntity parent1, double capacity1, int tier1) { + double power = EnergyNet.instance.getPowerFromTier(tier1); + + this.parent = parent1; + this.capacity = capacity1 < power ? power : capacity1; + this.tier = tier1; + this.power = power; + } + + // in-world te forwards >> + + /** + * Forward for the base TileEntity's update(), used for creating the energy net link. + * Either updateEntity or onLoaded have to be used. + */ + @Override + public void update() { + if (!addedToEnet) onLoaded(); + } + + /** + * Notification that the base TileEntity finished loading, for advanced uses. + * Either updateEntity or onLoaded have to be used. + */ + public void onLoaded() { + if (!addedToEnet && + !parent.getWorld().isRemote && + Info.isIc2Available()) { + worldObj = parent.getWorld(); + pos = parent.getPos(); + + MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); + + addedToEnet = true; + } + } + + /** + * Forward for the base TileEntity's invalidate(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void invalidate() { + super.invalidate(); + + onChunkUnload(); + } + + /** + * Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link. + * Both invalidate and onChunkUnload have to be used. + */ + @Override + public void onChunkUnload() { + if (addedToEnet && + Info.isIc2Available()) { + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); + + addedToEnet = false; + } + } + + /** + * Forward for the base TileEntity's readFromNBT(), used for loading the state. + * + * @param tag Compound tag as supplied by TileEntity.readFromNBT() + */ + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + + NBTTagCompound data = tag.getCompoundTag("IC2BasicSource"); + + energyStored = data.getDouble("energy"); + } + + /** + * Forward for the base TileEntity's writeToNBT(), used for saving the state. + * + * @param tag Compound tag as supplied by TileEntity.writeToNBT() + */ + @Override + public NBTTagCompound writeToNBT(NBTTagCompound tag) { + try { + super.writeToNBT(tag); + } catch (RuntimeException e) { + // happens if this is a delegate, ignore + } + + NBTTagCompound data = new NBTTagCompound(); + + data.setDouble("energy", energyStored); + + tag.setTag("IC2BasicSource", data); + + return tag; + } + + // << in-world te forwards + // methods for using this adapter >> + + /** + * Get the maximum amount of energy this source can hold in its buffer. + * + * @return Capacity in EU. + */ + public double getCapacity() { + return capacity; + } + + /** + * Set the maximum amount of energy this source can hold in its buffer. + * + * @param capacity1 Capacity in EU. + */ + public void setCapacity(double capacity1) { + if (capacity1 < power) capacity1 = power; + + this.capacity = capacity1; + } + + /** + * Get the IC2 energy tier for this source. + * + * @return IC2 Tier. + */ + public int getTier() { + return tier; + } + + /** + * Set the IC2 energy tier for this source. + * + * @param tier1 IC2 Tier. + */ + public void setTier(int tier1) { + double power = EnergyNet.instance.getPowerFromTier(tier1); + + if (capacity < power) capacity = power; + + this.tier = tier1; + this.power = power; + } + + + /** + * Determine the energy stored in the source's output buffer. + * + * @return amount in EU + */ + public double getEnergyStored() { + return energyStored; + } + + /** + * Set the stored energy to the specified amount. + * + * This is intended for server -> client synchronization, e.g. to display the stored energy in + * a GUI through getEnergyStored(). + * + * @param amount + */ + public void setEnergyStored(double amount) { + energyStored = amount; + } + + /** + * Determine the free capacity in the source's output buffer. + * + * @return amount in EU + */ + public double getFreeCapacity() { + return capacity - energyStored; + } + + /** + * Add some energy to the output buffer. + * + * @param amount maximum amount of energy to add + * @return amount added/used, NOT remaining + */ + public double addEnergy(double amount) { + if (FMLCommonHandler.instance().getEffectiveSide().isClient()) return 0; + if (amount > capacity - energyStored) amount = capacity - energyStored; + + energyStored += amount; + + return amount; + } + + /** + * Charge the supplied ItemStack from this source's energy buffer. + * + * @param stack ItemStack to charge (null is ignored) + * @return true if energy was transferred + */ + public boolean charge(ItemStack stack) { + if (stack == null || !Info.isIc2Available()) return false; + + double amount = ElectricItem.manager.charge(stack, energyStored, tier, false, false); + + energyStored -= amount; + + return amount > 0; + } + + // << methods for using this adapter + + // backwards compatibility (ignore these) >> + + @Deprecated + public void onupdate() { + update(); + } + + @Deprecated + public void onInvalidate() { + invalidate(); + } + + @Deprecated + public void onOnChunkUnload() { + onChunkUnload(); + } + + @Deprecated + public void onReadFromNbt(NBTTagCompound tag) { + readFromNBT(tag); + } + + @Deprecated + public void onWriteToNbt(NBTTagCompound tag) { + writeToNBT(tag); + } + + // << backwards compatibility + + // ****************************** + // *** Methods for use by ic2 *** + // ****************************** + + // energy net interface >> + + @Override + public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) { + return true; + } + + @Override + public double getOfferedEnergy() { + return Math.min(energyStored, power); + } + + @Override + public void drawEnergy(double amount) { + energyStored -= amount; + } + + @Override + public int getSourceTier() { + return tier; + } + + // << energy net interface + + + public final TileEntity parent; + + protected double capacity; + protected int tier; + protected double power; + protected double energyStored; + protected boolean addedToEnet; +} diff --git a/src/api/java/ic2/api/energy/prefab/package-info.class b/src/api/java/ic2/api/energy/prefab/package-info.class index 52651b15adb54ce6146d24edb6714f9508e6b5d0..59b4c1ff879f16ef8878ae4c590a191925aa5ba2 100644 GIT binary patch delta 30 lcmZo?n#eT4Uqsm_FSSHJH#09axhOHMBrU%vJ#}K_Isl&H3t0dF delta 20 bcmbQp)Xp@)pG(pwxu9G>H$SC#V)8lwLi7hY diff --git a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.class b/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.class index ddc8f3af228619c0e58cf847518ebc4c433fc9d0..5347aea0ce9b412c900e9f5969a7629e0793de8b 100644 GIT binary patch delta 55 zcmZ3$)Xy|Qli5wfXW~O?HP_tCl9JRSYoEN-68+rFywv2P#IzFq(vr*^eb>CwT(`vJ K%)Io8b&CKUx)hfH delta 95 zcmeBYTEH|xGc;VoCoi=`KQ}WkHMuA;twg^hGbc4QuOzdiQa=R9bOkf5Q5B`-7p14_ fC+Fwp=I7~`0(I!Sfka#~i&B$IGV}8$<}LyNtE?o! diff --git a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java b/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java index 0ecd6c8cc..652330116 100644 --- a/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java +++ b/src/api/java/ic2/api/energy/tile/IEnergyAcceptor.java @@ -1,6 +1,5 @@ package ic2.api.energy.tile; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; /** @@ -8,19 +7,19 @@ import net.minecraft.util.EnumFacing; * * @see IEnergySink * @see IEnergyConductor - * + * * See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IEnergyAcceptor extends IEnergyTile { /** * Determine if this acceptor can accept current from an adjacent emitter in a direction. - * + * * The TileEntity in the emitter parameter is what was originally added to the energy net, * which may be normal in-world TileEntity, a delegate or an IMetaDelegate. - * + * * @param emitter energy emitter, may also be null or an IMetaDelegate - * @param direction direction the energy is being received from + * @param side side the energy is being received from */ - boolean acceptsEnergyFrom(TileEntity emitter, EnumFacing direction); + boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing side); } diff --git a/src/api/java/ic2/api/energy/tile/IEnergyEmitter.class b/src/api/java/ic2/api/energy/tile/IEnergyEmitter.class index eab917d66683b4b916efa52fa5457a7bd83f9271..a7394c85565766f40b805547b16e84416096bae7 100644 GIT binary patch delta 56 zcmbQm)WtMGmDydxXX0&Xb;so7)Pj=yB5R+#)Dr#N%)Hd(qQtZk{nC=m9DUck(pqvZvjfs1NV^N$e>v>(+_(hK6(CBTWin)T2%CG)}Yaa!#!|b z@5d8Bh=q%}3y-jDFRHKd{jI4~&V-2{oCxcJyDw^`st@YQn&9|x6hs8?sCu1oBr9{@ z#J{&>V6A1&yD}Y8!d7OXNE<1*W?kGxXC(1QA*@D8RB2s^YY%2x;Y!Wd^ diff --git a/src/api/java/ic2/api/energy/tile/IKineticSource.class b/src/api/java/ic2/api/energy/tile/IKineticSource.class index 225191cc3f787f9d6a872998973eefd07a5fafab..05257b06fc6f622126d026067f9474aa14d0b53f 100644 GIT binary patch delta 78 zcmdnUG?8h7fr65TPhM(?er{%7YI0FxT8VyXNoJ0|YhG!tTVir%Ui!oY83koRYSy#@ E05rlJlK=n! delta 110 zcmbQpw2^6ofq{{RPhM(?er{%7YI0FxT1i@dQF^L=a(-@Zex815NoJ0|8%V?@vnVyW RBr`v6Vt|Z+F{yfbS^>ZyDW?Dc diff --git a/src/api/java/ic2/api/energy/tile/IMetaDelegate.class b/src/api/java/ic2/api/energy/tile/IMetaDelegate.class index 98228465c6f22f55ac88812d4a0ca305daf6db9a..16e51c133ed55f14a87229ccf460974b98ecabdc 100644 GIT binary patch delta 33 pcmZ3;G?!_Di-@U)rcYL4S)zVvNoJ0|PiAq6jnBke@)N6<0RXsw3>yFd delta 65 zcmbQsw2*0ni@BwSrcYL4S)zVvNoJ0|PiAq6jZa=`iGFToUTShtVp@qlP&_p?uOzdi PQa=R9bOkdfmM;SU_K_Hu diff --git a/src/api/java/ic2/api/energy/tile/IMetaDelegate.java b/src/api/java/ic2/api/energy/tile/IMetaDelegate.java index f7319d0e1..1bb9b1e92 100644 --- a/src/api/java/ic2/api/energy/tile/IMetaDelegate.java +++ b/src/api/java/ic2/api/energy/tile/IMetaDelegate.java @@ -2,35 +2,33 @@ package ic2.api.energy.tile; import java.util.List; -import net.minecraft.tileentity.TileEntity; - /** * Interface for grouping multi-block structures to a single energy net delegate. - * + * * The energy net uses TileEntity to refer to a specific xyz+world position. If multiple of those * positions should belong to the same functional structure, i.e. they consume or produce energy * only once for the whole multi-block instead of once per every single block, this interface * allows to do so. - * + * * The tile entity implementing IMetaDelegate has to be added/removed to/from the energy net * instead of every single sub-TileEntity. The energy net interaction will be handled by the * IMetaDelegate TileEntity as well. - * + * * The sub tile array TileEntity[] just provides optional connectivity (IEnergyAcceptor, * IEnergyEmitter) and mandatory position (x, y, z, World) data. * If the connectivity data on the sub tile is missing, the meta delegate is queried instead. - * + * * See ic2/api/energy/usage.txt for an overall description of the energy net api. */ public interface IMetaDelegate extends IEnergyTile { /** - * Get the sub-TileEntities belonging to this Meta TileEntity. - * + * Get the sub-Tiles belonging to this Meta Tile. + * * @note The list has to be consistent between the EnergyNet Load and Unload events. * @note The list must have at least 1 element. - * @note The parent te implementing IMetaDelegate isn't automatically included. - * - * @return sub-TileEntity array + * @note The parent tile implementing IMetaDelegate isn't automatically included. + * + * @return sub-Tile array */ - List getSubTiles(); + List getSubTiles(); } diff --git a/src/api/java/ic2/api/energy/tile/IMultiEnergySource.class b/src/api/java/ic2/api/energy/tile/IMultiEnergySource.class new file mode 100644 index 0000000000000000000000000000000000000000..09b4b0f78e0d75e244def583247a905c6732372c GIT binary patch literal 266 zcmX^0Z`VEs1_mPrUUmj9b_Q;C1|CKR$>P+!6yMUElFWjfRM))JqV&pu#N_PMl43>% zW)00KMh4mR)Dmn89CPza^Gd*~JQ*3dg7Zs@l2hF>b5a=@#67_pAjUx?^s*Am5*ZoP zGLwz;6ALo+Q^8j0mjKo4W2$Ck5CEyy&q>Tn*Y{7#N=*h@q=;27vL$Sc42%p+K+FvE bCld=J0}BHy0|Ss|V_*l0Ffwp}#2GjNQ=>_J literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/energy/tile/IMultiEnergySource.java b/src/api/java/ic2/api/energy/tile/IMultiEnergySource.java new file mode 100644 index 000000000..ef63f1927 --- /dev/null +++ b/src/api/java/ic2/api/energy/tile/IMultiEnergySource.java @@ -0,0 +1,24 @@ +package ic2.api.energy.tile; + +/** + * Allows an {@link IEnergySource} to emit more than one EU packet per tick. + * Note: support for this will be dropped in a future version of IC2. + * @author Aroma1997 + */ +public interface IMultiEnergySource extends IEnergySource +{ + + /** + * If you want your machine to emit more than one EU packets per tick return true here. + * @return if the machine in its current state can emit more than one EU packet per tick. + */ + public boolean sendMultipleEnergyPackets(); + + /** + * If {@link #sendMultipleEnergyPackets()} returned true, this will get called. + * The value returned by this method will determine the amount of EU packets, this machine can emit. + * @return the amount of EU packets, this machine can emit per tick. + */ + public int getMultipleEnergyPacketAmount(); + +} \ No newline at end of file diff --git a/src/api/java/ic2/api/energy/tile/IOverloadHandler.class b/src/api/java/ic2/api/energy/tile/IOverloadHandler.class new file mode 100644 index 0000000000000000000000000000000000000000..46ed18ca7092b2cbcfdce8ea70454ea4494e3e1c GIT binary patch literal 161 zcmX^0Z`VEs1_mPrPId-%b_Nbc2Cn=(|FYDgoczQTMg|rQPt7QxSa5!6QF5wVW=<+2 zgQzD=-Xk$DB`38=FDtPuk&!_qGucQ#u^>}FH7~U&y;8pfs9GOgEhB>fNVR@WVqUtw ke^ORzatRwF10w?y&=Cv_j4X@{%nU3b76U7gWMW_g0BJ-ho&W#< literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/energy/tile/IOverloadHandler.java b/src/api/java/ic2/api/energy/tile/IOverloadHandler.java new file mode 100644 index 000000000..db2f39caf --- /dev/null +++ b/src/api/java/ic2/api/energy/tile/IOverloadHandler.java @@ -0,0 +1,17 @@ +package ic2.api.energy.tile; + +/** + * Complete control for when an {@link IEnergySink} is overloaded. + */ +public interface IOverloadHandler { + + /** + * Called when overloaded. This will override the default explosion. + * The default explosion will therefore NOT happen, when you return true here. + * If you return false, you can use this as a onExplode hook, but still let the default explosion happen. + * @note Would set the block to air and cause an explosion of power 2.5 by default + * @param tier The tier of power, that was injected into the energy sink, that caused it to explode. + * @return Whether you the default explosion should be cancelled. + */ + boolean onOverload(int tier); +} \ No newline at end of file diff --git a/src/api/java/ic2/api/energy/tile/package-info.class b/src/api/java/ic2/api/energy/tile/package-info.class index fdee4a7722bb0bb10b3c1e810e23cc2cb4aafa3c..8f2d38743c29627d37816e8054d1c7fd30eb4840 100644 GIT binary patch delta 30 lcmZo=>SvnZFQV*|ms+Bqo0*rIT$Gqrl9peTo;opd4FH~O3sV39 delta 20 bcmeBYYGs<>&n4-TTu`o`o1aoVF?kIDLZ$~Z diff --git a/src/api/java/ic2/api/energy/usage.txt b/src/api/java/ic2/api/energy/usage.txt index 49bd9955e..e3c9de817 100644 --- a/src/api/java/ic2/api/energy/usage.txt +++ b/src/api/java/ic2/api/energy/usage.txt @@ -38,7 +38,7 @@ loading the chunk which contains it or after the user placing the block. The energy net implementation will use the event to add it to its energy grid map, taking it into account for further energy transfers. -You can detect the loading by either using the 1st iteration of updateEntity() or by waiting for +You can detect the loading by either using the 1st iteration of update() or by waiting for the next world tick after TileEntity.validate(). The 2nd approach is obviously more sophisticated and requires to use some tick queuing mechanism. diff --git a/src/api/java/ic2/api/event/ExplosionEvent.class b/src/api/java/ic2/api/event/ExplosionEvent.class index 68a268d875218dd01b072d2fc2067794bd8ea212..59a2f8c0df6c02ff8e3af7ccba13331d16b43a3c 100644 GIT binary patch delta 462 zcmah_y-or_7@WO3?iO4{6ciLiP!Si*B~Tb+>@2M;EKLX=NFqPt89QyPO~^IAhKUyw z3m?Fzu=OR3-?yEW&CKkVnQv$JSw6|u=g<2GfF>F#BvDC1Vv}KuVVj}Ku)|REuU3|r@&7>+KuF%mlG#c*|A#_(Rq zYatIfs6a+TyF4h+=#>7AmS6>|#H@-~qbpc(JgYtAu`ws5Te1b&9KAJWY7#PhBiaT!>)&J z+-nuZoq!n7x~KIZ;Eslqi*fvNDz1{5tRy*6O%3RYk1Fv;CK-$Guyb-Ynsl#+=eNnR zY&0Y6DJWzWa+p(?XUH=wFf3w8p@5=7DS47NQ~piBr!UAtO0df^87-67GTDjqT){FG zv0VDU7l=?M|1zD<;Mmi?ZoNb3wt>`514l=$K}tuSfvcmypqAFM%D~rA)*yJJ z0un2P8e#J2)TbTV^-!S~xTJXjeN?eZ%xVoaYRifvNUJ!6V-?46t>Pe_RU9R-io@^# Z`aBczv*JKpr%pSGb!>3MG_}|S{s5)1GYkL# diff --git a/src/api/java/ic2/api/event/ExplosionEvent.java b/src/api/java/ic2/api/event/ExplosionEvent.java index 091c8d9ec..7d670aa97 100644 --- a/src/api/java/ic2/api/event/ExplosionEvent.java +++ b/src/api/java/ic2/api/event/ExplosionEvent.java @@ -2,23 +2,23 @@ package ic2.api.event; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; + import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.Cancelable; @Cancelable public class ExplosionEvent extends WorldEvent { public ExplosionEvent(World world, Entity entity, - double x, double y, double z, + Vec3d pos, double power, EntityLivingBase igniter, int radiationRange, double rangeLimit) { super(world); this.entity = entity; - this.x = x; - this.y = y; - this.z = z; + this.pos = pos;; this.power = power; this.igniter = igniter; this.radiationRange = radiationRange; @@ -29,10 +29,8 @@ public class ExplosionEvent extends WorldEvent { * Entity representing the explosive, may be null. */ public final Entity entity; - public double x; - public double y; - public double z; - public double power; + public final Vec3d pos; + public final double power; /** * Entity causing the explosion, may be null. */ diff --git a/src/api/java/ic2/api/event/LaserEvent$LaserExplodesEvent.class b/src/api/java/ic2/api/event/LaserEvent$LaserExplodesEvent.class index 27664e99d901a13be293033aed527c0ae859bec1..ea9d54941face6edb1646086ae33f788ed7be46c 100644 GIT binary patch delta 168 zcmaFC@qlB30b{^KLlJ40qWprO#FA7-2GP`tf}H%~%=|ppypqh4N|%iZY>aHI<@rT9 zDU)*<6?i#w5{pxdiZk*{7#U2C6ypqh4%9M=>Y>ez|<@rT9 zDTb4C7!~-qauSPEi;6SyOAHwqWG5eFl;N^wWMIoL&r2;boV<@w$Cj-qF)uw8D9cum zUk(&xWZ+54$xqI9DoRbvE(UTLJsBCepca*Z6f#Bu6&L5G=9Cz2R$`jWDCo!_$l$~v T&fv@-%izMG%-}lt81pOuXiqYf diff --git a/src/api/java/ic2/api/event/LaserEvent$LaserHitsBlockEvent.class b/src/api/java/ic2/api/event/LaserEvent$LaserHitsBlockEvent.class index a41b7f28b47486d4d749d8b0d30977ad0670bbf9..1b3b0d955e13a3d05d25e23be903ee7abf3e8e7e 100644 GIT binary patch literal 1264 zcmcgrTTc@~6#l04Lbr=3SPLQ|7lkgDExclUfY3UVUcf>^#u{a&g=za!JOzZaU|?5Rn11+s}gQ34C2Y7e4br!E5> zol;>bRvpt0ZPRh!&TVBM9;hVIi^dooeG_4;A6IW%Yl)ln6f2-cg;>M_Z&Z&;4W2C4R>*J-KvnQVph zWvXEU86L}6bA0hJo3=FxJ>8%^;>S8otQrS>;vwK3Mv;p5LzyIsinba$*zsjo`-=0v z?XjgRBic#uoE1u7ZfNt%`q3rOd=)2cLnqD;RsJa_O*H4Uk-+Lzb(fT-j#x&g#6H(G z=iFIp@ypqZl{_O#;!wa*@4BH$bYE@Lr6(N~rUaZL(~ARD*DT%SZ>n2wWna3O!nTVd z92X_HE+%lz#Uz{SxFN9dFG2~-{HM<7S?;EE-GzYp7ID|+mxYiRp>xrQC z#L;?sQ<$c@n-qPgF3#4x^^MI+wvsF7%Z2jzX9#b$I6%gmbp{yo%I*MJuRJk8&a0FL z$bX`q49aBh(gwf_n*94tHn+M)NcwW6=Wc zVa%dMnwGU_iBQg>Wvn1?(S4f6XV&n55VNmY?nR53J?l{8J0&d`u@bCFjW3&`3|1-1 PU=6e69omFdoI&v?DrP%_ literal 1285 zcmcgr+fEZv6kVtELZ<^oa4ZUVMWDlF1jSoNA0RX~X?)S3*6UD?Fw)L6Gefz2j(^}o zW8#A!;71wPIg*G(NqljVS$pks_TFdjHD|tk|MC^U5*`>Zu#`t0Hx=Acu&m&=f;$TC zD!7-!{TwO+VxMn~?*ZRKfpqL|N`XQo+hJF(w8G{NHyQ%@%_!^~`G(@F+g{LQsHh5L zT|e-XhXTP&J&=jh_5<0By!VN-7e=j3=b6IFi7go;mk-S7Ir)`}O)O0`;R zG-`aRjYfH${jP?p-(sC7KHhC_$mprJ(c;Q*J#2cdbuaRjf3%oRw*6ROq|Q>&BR`4t zKxR>w!8@F1 z)W@Ia;sT@8EvRb^#(LsVD6x14q1^s+@P1jBF1SAcBj-IL;eSOP9yRF diff --git a/src/api/java/ic2/api/event/LaserEvent$LaserHitsEntityEvent.class b/src/api/java/ic2/api/event/LaserEvent$LaserHitsEntityEvent.class index 627a8ea49dd37e0e85f31217441ad42097c22fa6..deec489bf41def58d010192d8af8be7e0e771554 100644 GIT binary patch delta 138 zcmcb?ex7}T0;B6jMHfak*7E$KoRrBqj0!@WIf=!oMa3EUC5#NL`Q>@3MUxjW>Ugjg zCFZ54GBPl_0fh_l%TtRO8Mu>j@{_Zjic%A^i-9tpj0~Kq6$Lr@#hGOwl~F*I#kr|D kK!Z3lGD}kPN-|3-H%l?;GjbL(2r?8ih%=N-4q|Qt0O&6!cmMzZ delta 152 zcmX@leuI620%Ph%MHfbPw(|U!*^CO}TseuwsYS&Z`6Y&o3~c%3d8tJ}hWg}# zOzHtZfuh8`^i-e#qZ^P@kY5g#%;d_*EJ@8P$ti;;n~C^0WRm63tb4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EXc;$11k4hI^Fp>aslUQ!cL_mMKR# l)h1(}Qyo$zr@ExdPOXyiomwLmQ06*C9<{zf98ir-;5TGRql5qe diff --git a/src/api/java/ic2/api/event/PaintEvent.java b/src/api/java/ic2/api/event/PaintEvent.java deleted file mode 100644 index fc01535c8..000000000 --- a/src/api/java/ic2/api/event/PaintEvent.java +++ /dev/null @@ -1,30 +0,0 @@ -package ic2.api.event; - -import net.minecraft.world.World; -import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.eventhandler.Cancelable; - -@Cancelable -public class PaintEvent extends WorldEvent { - // target block - public final int x; - public final int y; - public final int z; - public final int side; - - // color to paint the block - public final int color; - - // set to true to confirm the operation - public boolean painted = false; - - public PaintEvent(World world1, int x1, int y1, int z1, int side1, int color1) { - super(world1); - - this.x = x1; - this.y = y1; - this.z = z1; - this.side = side1; - this.color = color1; - } -} diff --git a/src/api/java/ic2/api/event/RetextureEvent.class b/src/api/java/ic2/api/event/RetextureEvent.class index e3df863a47226a008f75d6488846a833644f34ea..be92cb32a76f80cb1268c004943fbf22b19c5721 100644 GIT binary patch literal 2143 zcmaJ?-&Y$&6#j;U%qDIM1Zau<0aj~afv#37Dz(~TP&6O{QW1YGn+dGl?B;AXwSDwI z@Wlsx@~Kb0=rIS6o>N{t$8-Fn)O%-*kVVMD%>8EWow@UU_iq0D>(|EsuA^4KlenEn z8FwTW47^!D29-P(@s`Bf29^qts2F(1z`F*j29^!17fvYL! z9d@zxroE*7*V&OGvMsMh0pqCveR?HmHx?b&3wFsd*Yur-DiW|#t}2MV_@SL_+ZByg zwJ${(k*e#f1PWwsI+5oDu|TQ%g>&DreJ9wp*W)O;Lb9_?XPB&o&<~^KwjX;<-%}A$ z(6_xLAe|=Tnt&i~ayPxei*E^0m`tVhWf=K2`!0|3sjdH^F6D6&Un#dVOR4Qsm`Qn_ zc;7LWQi16VwwIbci# zr|H@1K4osNsaQRT+mWg;Z}_$w zHX31&ykXA?YQBo>1t)No&lJp?n1*9w3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yValueProvider.class deleted file mode 100644 index abe05e1c2e82dd94791e27a89ab7de5fb5ed7843..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 195 zcmZvWu?oU47=$miw(20Rj&8d6LswT73W7qxJ;uK!wM`|Y1z*j<2k@c9baQYyZuq|A z-k;|SK!S0MIL1g|TCm$0w#DNttCj^8%Y$J@wKlA*%pGaRHKjf>C)I7U+6qjvrnQRq zy7Iz2{qaw>>GYNDx|E&tV_GF7@0zs98~O(d%zBh6X$m@CN>(ls5D5HDK!gGVgnh%% HXMpGn`MNdi diff --git a/src/api/java/ic2/api/info/IEnergyValueProvider.java b/src/api/java/ic2/api/info/IEnergyValueProvider.java deleted file mode 100644 index 1e7b2cc57..000000000 --- a/src/api/java/ic2/api/info/IEnergyValueProvider.java +++ /dev/null @@ -1,17 +0,0 @@ -package ic2.api.info; - -import net.minecraft.item.ItemStack; - -public interface IEnergyValueProvider { - /** - * Determine the energy value for a single item in the supplied stack. - * The value is used by most machines in the discharge slot. - * - * This only applies to basic single use items, others are to be queried - * through e.g. ElectricItem.manager.getCharge(). - * - * @param itemStack ItemStack containing the item to evaluate. - * @return energy in EU - */ - double getEnergyValue(ItemStack itemStack); -} diff --git a/src/api/java/ic2/api/info/IFuelValueProvider.class b/src/api/java/ic2/api/info/IFuelValueProvider.class deleted file mode 100644 index 57f9f4bfc06dcf15caa31b662b682c186e9ed89c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 190 zcmZXOu?oU46h-f=wN-I&a}=C(G0@e$P!JRf4sJ2NmejPBkoMyo`~W{nOcxiI!yV3n z`~Ey%01`}N#4#p>dC4yA*qo*5n6Ta)8g`=A4J#`PC$!^QWFEPb>b}2hGr}xyJF7U= z#uv-%m!E9g>l@o$C3{I&X_W~1&_XvwEB-aYVi1LqO(~Aoij|89gup)pC?t#!4hv(? G0MQqP2s5kz diff --git a/src/api/java/ic2/api/info/IFuelValueProvider.java b/src/api/java/ic2/api/info/IFuelValueProvider.java deleted file mode 100644 index 7c7fe0f4c..000000000 --- a/src/api/java/ic2/api/info/IFuelValueProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -package ic2.api.info; - -import net.minecraft.item.ItemStack; - -public interface IFuelValueProvider { - /** - * Determine the fuel value for a single item in the supplied stack. - * The information currently applies to Generators and the Iron Furnace. - * - * @param itemStack ItemStack containing the item to evaluate. - * @param allowLava Determine if lava has a fuel value, currently only true for the Iron Furnace. - * @return fuel value - */ - int getFuelValue(ItemStack itemStack, boolean allowLava); -} diff --git a/src/api/java/ic2/api/info/IInfoProvider.class b/src/api/java/ic2/api/info/IInfoProvider.class new file mode 100644 index 0000000000000000000000000000000000000000..95ce6945f7e50185d31acf76156bea84f4c92d39 GIT binary patch literal 241 zcmaivy$ZrW5QJy_N&G{^(oQRFJg~LZKtNCkSlFHCCY;8L92db?v+x0YDDeavE1OxE znU7_julobQ4DArj5G_JCW4APHv)fkYB@>3@m0>5&+OV=RbwWEni`Yxzq&m$f3qr?3 zQOWri8T~bs)|;gnqZox%P?V(Q7p138u48f) z)6mdF)eVt4&m=0WiA9S%v-o5dWRR%@|RiG{=1~mYsiBsH$SC#V)9Y|N`wcU diff --git a/src/api/java/ic2/api/item/ElectricItem.class b/src/api/java/ic2/api/item/ElectricItem.class index be926067550b2d7ce764f495e3d74f985a79ac2f..ad45f925c74c3fe51a546f46087a4ce26455032d 100644 GIT binary patch delta 187 zcmWlSIT8Uu07YLns?AJGC6=;}ZS4CpgihclVrNiu5+$RGOyCAWcMvIs7X0^r)eHXD zzT5uob36kbmNpvK!lCR?q54P7p^o=QL(z0lv=nU{3s=!mboc&41XDQ{y(zJ7R+ZBDjK}xWKZjxFClx;Ruu-!_v$FID@gXkdA^ANXa#f zQHSFFB=05fZS|kdH@_dBK+H^IX@wZthATRI>Kd-O*;7w(Yf!|Bz9yul7$}Bs`A!t& zq9G``=it~?WhN3gmuY!qNy#jC+$$2xm! o5vNE$P^ZQj!e8rpf9|#6VF`W+70t@GZyj>s>V=+)d?LC02bL@y?f?J) diff --git a/src/api/java/ic2/api/item/IBlockCuttingBlade.class b/src/api/java/ic2/api/item/IBlockCuttingBlade.class index 8654649e7e6d85e2ac5b5fce6e8977824b84828a..6602efc17aacfd62f89fc9e20f7083383450bd02 100644 GIT binary patch delta 52 zcmbQoxQB6qn3hLkQA%EFaWNxPtM^+g0{JU$;Ko-4vX$zVKyEE;GybUM2F|@bf7^*3$!(9G zvK89W+mey1o>ONo{?6@=qpvj;ewXN4$BC6KaI<1PmHX24WY94;8;wf)9v1hqA+4}2e12WyRqkbZHI3r-C#d_=Cl`gqR?M7a32rU^3cF0 zEXC-N!1UpE@?1RvT&k8}%5&P3Kv_NSl@nfWX-|V_Kn1PEuia-zAa* zSeAC|?mNTX5oo+Me>k2f1=6Ie)fPCx+<_SB%@`4=@8eZd!HC9MhC98#|D z@yX;al(%*O@e_>g+{iUSU>4eU6SLIx;x_FB1Hawg3PC literal 1797 zcma)6ZBrXn6n<_JvYTar5Fns^acON0i6j!=fFRmp(MU?EDaHD}Nj70&*<>~wM}La{ z0_#lLsWXm#(HZ}P|D>Zn`w|j59d$Cfckj99D_KgAW=12w(j;ELtysV`;F`-RpJ|_ zZMvHR(ah3)f!J2NLFK86X&bw}lbYe&(`yzbsY<)9TlaOx^v@dY4*;>){h9W=7&yUB|RrrKO5(xP=pjsylkq4XvqOb@lo&&7+RtdZCAz z-KiZJb(dFynC3<E{rHJ;rqU=cl;DcqJ(|&E}#(V9>eM_ zn$BjHMtq+ck9PuvUEhDSbKDY`8Bq-FOA<(>Qf>E~y0L9~^i2#%$$OYoT*74)FW^Oz z_bkYpJ=1C!j*8c?qT&Fb2u$YdZO6zDiml=SRwR6?;xl}%;tPB!;VTtiLl?OCZR4FF&`hh8BU7kW==C z?6wDfr-oYoz_4AJVo=*_|KWBpVKO<|HVx~4AaRVQ#ojIW>O?Y9_;XhzhfW2qk3tCh zezYskMqz}->UUj#+M?|qJ%saNwhMclHkb!au5C2q|CB+d$q1V>jLRaxjYI#^otcfj0=16 z3U5xhzC=lZyWl>SeFX7?ucC2{`@$p^`K<;DxPq%ZCGaw?QQ{f@NoNu62M-bX9hZMX z^uZ&<9%HPJcuL~Zhx{0c9}%HKwhu-0F<#023iW%)xnH23iqpzNOooQ3DVk8tGwUNM zPJQRAC}9F?SoilRGzPo^nd=3@yM$#zd4tk5N=t;eL4fuNK<4;XgsJur^U++L!E_&~o$PN|Ak>*kE}H9O zHZ{kk(MS3;HGfK%0n9YU$axu3WC!Ds3X+jsXpy@ metadata 0 - block, no resin spot -> metadata 0 or 1 - block, wet resin spot -> metadata 2-5 (according to the side) - block, dry resin spot -> metadata 8-11 (wet state + 6) - - rubberWood; - rubberLeaves; // Rubber Leaves block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber = false - rubberSapling; // Rubber Sapling block, currently not meta sensitive, meta in ItemStack set to 0, null with enableWorldGenTreeRubber = false - resinSheet; // Resin Sheet block, currently not meta sensitive - rubberTrampoline; // Rubber Trampoline block, meta reflects internal state, meta in ItemStack set to 0 - - // building/storage - ironFence; // Iron Fence block, currently not meta sensitive - - reinforcedStone; // Reinforced Stone block, currently not meta sensitive - reinforcedGlass; // Reinforced Glass block, currently not meta sensitive - reinforcedDoorBlock; // Reinforced Door block, meta reflects the state (see vanilla doors), meta in ItemStack set to 0 - - constructionreinforcedFoam; // Construction Reinforced Foam block, currently not meta sensitive - constructionFoam; // Construction Foam block, currently not meta sensitive - constructionFoamWall; // Construction Foam Wall block, meta = color, implements IPaintableBlock - scaffold; // Scaffold block, meta reflects internal physical model data - ironScaffold; // Scaffold block, meta reflects internal physical model data - - bronzeBlock; // Bronze block, meta sensitive - copperBlock; // Copper block, meta sensitive - tinBlock; // Tin block, meta sensitive - uraniumBlock; // Uranium block, meta sensitive - leadBlock; // Uranium block, meta sensitive - - // cables (when placed as a block, inventory items are different; TE implements IEnergyConductor) - - copperCableBlock; // Copper Cable block, meta sensitive - insulatedCopperCableBlock; // Insulated Copper Cable block, meta sensitive - - goldCableBlock; // Gold Cable block, meta sensitive - insulatedGoldCableBlock; // Insulated Gold Cable block, meta sensitive - doubleInsulatedGoldCableBlock; // Double Insulated Gold Cable block, meta sensitive - - ironCableBlock; // Iron Cable block, meta sensitive - insulatedIronCableBlock; // Insulated Iron Cable block, meta sensitive - doubleInsulatedIronCableBlock; // Double Insulated Iron Cable block, meta sensitive - trippleInsulatedIronCableBlock; // Tripple Insulated Iron Cable block, meta sensitive - - glassFiberCableBlock; // Glass Fiber Cable block, meta sensitive - - tinCableBlock; // Tin Cable block, meta sensitive - insulatedtinCableBlock; // Insulated Tin Cable item, meta sensitive - detectorCableBlock; // Detector Cable block, meta sensitive - splitterCableBlock; // Splitter Cable block, meta sensitive - - // generators + related (TE implements IEnergySource ex. reactorChamber) - - generator; // Generator block, meta sensitive - geothermalGenerator; // Geothermal Generator block, meta sensitive - waterMill; // Water Mill block, meta sensitive - solarPanel; // Solar Panel block, meta sensitive - windMill; // Wind Mill block, meta sensitive - nuclearReactor; // Nuclear Reactor block, meta sensitive - reactorChamber; // Reactor Chamber block, currently not meta sensitive - RTGenerator; // Radioisotope Thermoelectric Generator block, meta sensitive - semifluidGenerator; // Semifluid Generator block, meta sensitive - - - // energy storages (TE implements IEnergySource and IEnergyConductor) - - batBox; // BatBox block, meta sensitive - cesuUnit; // CESU Unit block, meta sensitive - mfeUnit; // MFE Unit block, meta sensitive - mfsUnit; // MFS Unit block, meta sensitive - - // transformers (TE implements IEnergySource and IEnergyConductor) - - lvTransformer; // LV Transformer block, meta sensitive - mvTransformer; // MV Transformer block, meta sensitive - hvTransformer; // HV Transformer block, meta sensitive - evTransformer; // EV Transformer block, meta sensitive - - // machines + related (TE implements IEnergySink ex. machine, miningPipe, miningPipeTip) - - machine; // Machine block, meta sensitive - advancedMachine; // Advanced Machine block, meta sensitive - - ironFurnace; // Iron Furnace block, meta sensitive - electroFurnace; // Electro Furnace block, meta sensitive - macerator; // Macerator block, meta sensitive - extractor; // Extractor block, meta sensitive - compressor; // Compressor block, meta sensitive - canner; // Canner block, meta sensitive - miner; // Miner block, meta sensitive - pump; // Pump block, meta sensitive - magnetizer; // Magnetizer block, meta sensitive - electrolyzer; // Electrolyzer block, meta sensitive - recycler; // Recycler block, meta sensitive - inductionFurnace; // Induction Furnace block, meta sensitive - massFabricator; // Mass Fabricator block, meta sensitive - terraformer; // Terraformer block, meta sensitive - teleporter; // Teleporter block, meta sensitive - teslaCoil; // Tesla Coil block, meta sensitive - luminator; // Passive (dark) Luminator block, meta = facing - activeLuminator; // Active (bright) Luminator block, meta = facing - centrifuge; // Centrifuge block, meta sensitive - metalformer; // MetalFormer block , meta sensitive - orewashingplant; // Ore Wasching Plant, Meta sensitive - patternstorage; // Pattern Storage, Meta sensitive - scanner; // Scanner, Meta sensitive - replicator; // Replicator, Meta sensitive - - miningPipe; // Mining Pipe block, currently not meta sensitive, meta in ItemStack set to 0 - miningPipeTip; // Mining Pipe Tip block, currently not meta sensitive, meta in ItemStack set to 0 - - - // personal blocks - - personalSafe; // Personal Safe block, meta sensitive - tradeOMat; // Trade-O-Mat block, meta sensitive - energyOMat; // Energy-O-Mat block, meta sensitive - - // explosives - - industrialTnt; // Industrial TNT block, currently not meta sensitive - nuke; // Nuke block, currently not meta sensitive - dynamiteStick; // Dynamite Stick block, meta = placement, meta in ItemStack set to 0 - dynamiteStickWithRemote; // Dynamite Stick with Remote block, meta = placement, meta in ItemStack set to 0 - - // Agriculture Stuff - - crop; // Crop Block, empty, not meta sensitive - cropmatron; // Cropmatron machien block, meta sensititve - - // ----- items ----- - - // rubber + related - resin; // Resin item, currently not meta sensitive - rubber; // Rubber item, currently not meta sensitive, ore dictionary: itemRubber - - FluidCell; - - // Lithium -> Tritium - - reactorLithiumCell; // LithiumCell use in Reaktor, , meta = damage value - TritiumCell; // Tritium, currently not meta sensitive - - // Nuclear Fuel - - UranFuel; // , currently not meta sensitive - MOXFuel; // , currently not meta sensitive - Plutonium; // , currently not meta sensitive - smallPlutonium; // , currently not meta sensitive - Uran235; // , currently not meta sensitive - smallUran235; // , currently not meta sensitive - Uran238; // , currently not meta sensitive - - reactorDepletedUraniumSimple; // Depleted Uranium Cell items, currently not meta sensitive - reactorDepletedUraniumDual; - reactorDepletedUraniumQuad; - reactorDepletedMOXSimple; // Depleted MOX Cell items, currently not meta sensitive - reactorDepletedMOXDual; - reactorDepletedMOXQuad; - reactorMOXSimple; // Depleted MOX Cell items, currently not meta sensitive - reactorMOXDual; - reactorMOXQuad; - RTGPellets; - - - // Recipe Parts - - coil; // Coil, meta sensitive - elemotor; // electric motor, meta sensitive - powerunit; // Item Power Unit, meta sensitive - powerunitsmall; // Item Power Unit, meta sensitive - - - // ItemCasing - - casingcopper; // Copper ItemCasing, meta sensitive - casingtin; // Tin ItemCasing, meta sensitive - casingbronze; // Bronze ItemCasing, meta sensitive - casinggold; // Gold ItemCasing, meta sensitive - casingiron; // Iron ItemCasing, meta sensitive - @Deprecated - casingadviron; // Refined Iron ItemCasing, meta sensitive - casinglead; // Lead ItemCasing, meta sensitive - - // Crushed Ore - crushedIronOre; // Crushed Iron Ore, meta sensitive - crushedCopperOre; // Crushed Copper Ore, meta sensitive - crushedGoldOre; // Crushed Gold Ore, meta sensitive - crushedTinOre; // Crushed Tin Ore, meta sensitive - crushedUraniumOre; // Crushed Uranium Ore, meta sensitive - crushedSilverOre; // Crushed Silver Ore, meta sensitive - crushedLeadOre; // Crushed Lead Ore, meta sensitive - - - //Purify Crushed Ore - purifiedCrushedIronOre; // Purify Crushed Iron Ore, meta sensitive - purifiedCrushedCopperOre; // Purify Crushed Copper Ore, meta sensitive - purifiedCrushedGoldOre; // Purify Crushed Gold Ore, meta sensitive - purifiedCrushedTinOre; // Purify Crushed Tin Ore, meta sensitive - purifiedCrushedUraniumOre; // Purify Crushed Uranium Ore, meta sensitive - purifiedCrushedSilverOre; // Purify Crushed Silver Ore, meta sensitive - purifiedCrushedLeadOre; // Purify Crushed Lead Ore, meta sensitive - - // dusts - stoneDust; - bronzeDust; // Bronze Dust item, meta sensitive, ore dictionary: dustBronze - clayDust; // Clay Dust item, meta sensitive, ore dictionary: dustClay - coalDust; // Coal Dust item, meta sensitive, ore dictionary: dustCoal - copperDust; // Copper Dust item, meta sensitive, ore dictionary: dustCopper - goldDust; // Gold Dust item, meta sensitive, ore dictionary: dustGold - ironDust; // Iron Dust item, meta sensitive, ore dictionary: dustIron - silverDust; // Silver Dust item, meta sensitive, ore dictionary: dustSilver - tinDust; // Tin Dust item, meta sensitive, ore dictionary: dustTin - hydratedCoalDust; // Hydrated Coal Dust item, meta sensitive - leadDust; // Lead Dust item, meta sensitive, ore dictionary: dustLead - obsidianDust; // Obsidian Dust item, meta sensitive, ore dictionary: dustObsidian - lapiDust; // Lapi Dust item, meta sensitive, ore dictionary: dustLapi - sulfurDust; // Sulfur Dust item, meta sensitive, ore dictionary: dustSulfur - lithiumDust; // Lithium dust, meta sensitive, ore dictionary: dustLithium - - // small dusts - - smallIronDust; // Small Iron Dust item, meta sensitive - smallCopperDust; // Small Copper Dust item, meta sensitive - smallGoldDust; // Small Gold Dust item, meta sensitive - smallTinDust; // Small Tin Dust item, meta sensitive - smallSilverDust; // Small Silver Dust item, meta sensitive - smallLeadDust; // Small Lead Dust item, meta sensitive - smallSulfurDust; // Small Sulfur Dust item, meta sensitive - smallLithiumDust; // Small Lithium Dust item, meta sensitive - - - // ingots - @Deprecated - refinedIronIngot; // Refined Iron Ingot item, currently not meta sensitive, ore dictionary: ingotRefinedIron - copperIngot; // Copper Ingot item, currently not meta sensitive, ore dictionary: ingotCopper - tinIngot; // Tin Ingot item, currently not meta sensitive, ore dictionary: ingotTin - bronzeIngot; // Bronze Ingot item, currently not meta sensitive, ore dictionary: ingotBronze - mixedMetalIngot; // Mixed Metal Ingot item, currently not meta sensitive - leadIngot; // Lead Ingot item, currently not meta sensitive - - - // tools/weapons (without electric tools) - treetap; // Treetap item, meta = damage value - wrench; // Wrench item, meta = damage value - cutter; // Insulation Cutter item, meta = damage value - constructionFoamSprayer; // Construction Foam Sprayer item, meta = charges (as of v1.45) - - bronzePickaxe; // Bronze Pickaxe item, meta = damage value - bronzeAxe; // Bronze Axe item, meta = damage value - bronzeSword; // Bronze Sword item, meta = damage value - bronzeShovel; // Bronze Shovel item, meta = damage value - bronzeHoe; // Bronze Hoe item, meta = damage value - - ForgeHammer; // Refine Iron Hammer item, meta = damage value - - // el. tools/devices/weapons - miningDrill; // Mining Drill item, meta = damage value for charge level - diamondDrill; // Diamond Tipped Mining Drill item, meta = damage value for charge level - iridiumDrill; // Iridium Tipped Mining Drill item, meta = damage value for charge level - chainsaw; // Chainsaw item, meta = damage value for charge level - electricWrench; // Electric Wrench item, meta = damage value for charge level - electricTreetap; // Electric Treetap item, meta = damage value for charge level - miningLaser; // Mining Laser item, meta = damage value for charge level - - ecMeter; // EC-Mater item, meta = itemdata db index (as of v1.45) - odScanner; // Ore Density Scanner item, meta = damage value for charge level - ovScanner; // Ore Value Scanner item, meta = damage value for charge level - obscurator; // Obscurator item, meta = damage value for charge level - - frequencyTransmitter; // Frequency Transmitter item, meta = itemdata db index (as of v1.45) - - nanoSaber; // Idle Nano Saber item, meta = damage value for charge level - enabledNanoSaber; // Enabled Nano Saber item, meta = damage value for charge level - - toolbox; // Open/Empty toolbox, meta = Open (0) / Closed (1) - - // armor/wearable - hazmatHelmet; // Hazmat Helmet item, meta = damage value - hazmatChestplate; // Hazmat Chestplate item, meta = damage value - hazmatLeggings; // Hazmat Leggings item, meta = damage value - hazmatBoots; // Hazmat Boots item, meta = damage value - - bronzeHelmet; // Bronze Helmet Armor item, meta = damage value - bronzeChestplate; // Bronze Chestplate Armor item, meta = damage value - bronzeLeggings; // Bronze Leggings Armor item, meta = damage value - bronzeBoots; // Bronze Boots Armor item, meta = damage value - - compositeArmor; // Composite Armor item, meta = damage value for charge level - - nanoHelmet; // Nano Helmet Armor item, meta = damage value for charge level - nanoBodyarmor; // Nano Bodyarmor item, meta = damage value for charge level - nanoLeggings; // Nano Leggings Armor item, meta = damage value for charge level - nanoBoots; // Nano Boots Armor item, meta = damage value for charge level - - quantumHelmet; // Quantum Helmet Armor item, meta = damage value for charge level - quantumBodyarmor; // Quantum Bodyarmor item, meta = damage value for charge level - quantumLeggings; // Quantum Leggings Armor item, meta = damage value for charge level - quantumBoots; // Quantum Boots Armor item, meta = damage value for charge level - - jetpack; // Jetpack item, meta = damage value for fuel level - electricJetpack; // Electric Jetpack item, meta = damage value for charge level - - batPack; // BatPack item, meta = damage value for charge level - advbatPack; // Adv.BatPack item, meta = damage value for charge level - lapPack; // LapPack item, meta = damage value for charge level - energyPack; // EnergyPack item, meta = damage value for charge level - - cfPack; // CF Pack item, meta = charges (as of v1.45) - solarHelmet; // Solar Helmet, currently not meta sensitive - staticBoots; // Static Boots, currently not meta sensitive - nightvisionGoggles; // Nightvision Goggles, meta = damage value for charge level - - // batteries - reBattery; // Empty RE Battery item, currently not meta sensitive - chargedReBattery; // RE Battery item, meta = damage value for charge level - advBattery; // Adv Batteryitem, meta = damage value for charge level - energyCrystal; // Energy Crystal item, meta = damage value for charge level - lapotronCrystal; // Lapotron Crystal item, meta = damage value for charge level - suBattery; // SU Battery item, meta = damage value for charge level - - // cables - copperCableItem; // Copper Cable item, meta sensitive - insulatedCopperCableItem; // Insulated Copper Cable item, meta sensitive - - goldCableItem; // Gold Cable item, meta sensitive - insulatedGoldCableItem; // Insulated Gold Cable item, meta sensitive - - @Deprecated - doubleInsulatedGoldCableItem; // Double Insulated Gold Cable item, meta sensitive - - ironCableItem; // Iron Cable item, meta sensitive - insulatedIronCableItem; // Insulated Iron Cable item, meta sensitive - - @Deprecated - doubleInsulatedIronCableItem; // Double Insulated Iron Cable item, meta sensitive - @Deprecated - trippleInsulatedIronCableItem; // Tripple Insulated Iron Cable item, meta sensitive - insulatedTinCableItem; - glassFiberCableItem; // Glass Fiber Cable item, meta sensitive - tinCableItem; // Tin Cable item, meta sensitive - - - detectorCableItem; // Detector Cable item, meta sensitive - splitterCableItem; // Splitter Cable item, meta sensitive - - // cells/containers (without reactor components) - - cell; // Empty Cell item, meta sensitive - lavaCell; // Lava Cell item, meta sensitive - waterCell; // Water Cell item, meta sensitive - UuMatterCell; // UUMatter Cell item, meta sensitive - CFCell; // constructionFoam Cell item, meta sensitive - - - fuelRod; // Empy Fuel Rod item, currently not meta sensitive - hydratedCoalCell; // Hydrated Coal Cell item, currently not meta sensitive - bioCell; // Bio Cell item, currently not meta sensitive - coalfuelCell; // Coalfuel Cell item, currently not meta sensitive - biofuelCell; // Biofuel Cell item, currently not meta sensitive - electrolyzedWaterCell; // Electrolyzed Water Cell item, currently not meta sensitive - airCell; // Compressed Air item, currently not meta sensitive - - fuelCan; // Empty Fuel Can item, currently not meta sensitive - filledFuelCan; // Fuel Can item, meta = fuel value (as of v1.45) - - tinCan; // Empty Tin Can item, currently not meta sensitive - filledTinCan; // Filled Tin Can item, currently not meta sensitive - - // reactor components - reactorUraniumSimple; // Uranium Cell items, meta = consumed uranium ticks - reactorUraniumDual; - reactorUraniumQuad; - - reactorCoolantSimple; - reactorCoolantTriple ; // Coolant Cell item, NBT for heat-storage, meta is 0-10000 for display - reactorCoolantSix; - - reactorPlating; // Integrated Reactor Plating item, currently not meta sensitive - reactorPlatingHeat; - reactorPlatingExplosive; - - reactorHeatSwitch; // Integrated Heat Disperser item, NBT for heat-storage, meta is 0-10000 for display - reactorHeatSwitchCore; - reactorHeatSwitchSpread; - reactorHeatSwitchDiamond; - - reactorVent; // Heat Venting component, NBT for heat-storage, meta is 0-10000 for display - reactorVentCore; - reactorVentGold; - reactorVentSpread;// Special: Does not store heat - reactorVentDiamond; - - reactorReflector; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display - reactorReflectorThick; // Increase efficiency without additional ticks, NBT for heat-storage, meta is 0-10000 for display - reactorCondensator; // Consumes redstone to absorb heat, NBT for storage, meta is 0-10000 for display - reactorCondensatorLap; // Consumes redstone/lapis to absorb heat, mNBT for storage, meta is 0-10000 for display - - // terraformer blueprints - terraformerBlueprint; // Empty Terraformer Blueprint item, currently not meta sensitive - cultivationTerraformerBlueprint; // Cultivation Terraformer Blueprint item, currently not meta sensitive - irrigationTerraformerBlueprint; // Irrigation Terraformer Blueprint item, currently not meta sensitive - chillingTerraformerBlueprint; // Chilling Terraformer Blueprint item, currently not meta sensitive - desertificationTerraformerBlueprint; // Desertification Terraformer Blueprint item, currently not meta sensitive - flatificatorTerraformerBlueprint; // Flatificator Terraformer Blueprint item, currently not meta sensitive - mushroomTerraformerBlueprint; // Mushroom Terraformer Blueprint item, currently not meta sensitive - - // diamond chain - coalBall; // Coal Ball item, currently not meta sensitive - compressedCoalBall; // Compressed Coal Ball item, currently not meta sensitive - coalChunk; // Coal Chunk item, currently not meta sensitive - industrialDiamond; // Industrial Diamond item, currently not meta sensitive, DEPRECATED - - // recycler chain - scrap; // Scrap item, currently not meta sensitive - scrapBox; // Scrap Box item, currently not meta sensitive - - // fuel production chain - hydratedCoalClump; // Hydrated Coal Clump item, currently not meta sensitive - plantBall; // Plant Ball item, currently not meta sensitive - compressedPlantBall; // Compressed Plant Ball item, currently not meta sensitive - - // painting - painter; // Painter item, currently not meta sensitive - - blackPainter; // Black Painter item, meta = damage value - redPainter; // Red Painter item, meta = damage value - greenPainter; // Green Painter item, meta = damage value - brownPainter; // Brown Painter item, meta = damage value - bluePainter; // Blue Painter item, meta = damage value - purplePainter; // Purple Painter item, meta = damage value - cyanPainter; // Cyan Painter item, meta = damage value - lightGreyPainter; // Light Grey Painter item, meta = damage value - darkGreyPainter; // Dark Grey Painter item, meta = damage value - pinkPainter; // Pink Painter item, meta = damage value - limePainter; // Lime Painter item, meta = damage value - yellowPainter; // Yellow Painter item, meta = damage value - cloudPainter; // Cloud Painter item, meta = damage value - magentaPainter; // Magenta Painter item, meta = damage value - orangePainter; // Orange Painter item, meta = damage value - whitePainter; // White Painter item, meta = damage value - - // explosives + related - dynamite; // Throwable Dynamite item, currently not meta sensitive - stickyDynamite; // Throwable Sticky Dynamite item, currently not meta sensitive - - remote; // Dynamite Remote item, currently not meta sensitive - - // misc intermediate recipe ingredients - electronicCircuit; // Electronic Circuit item, currently not meta sensitive - advancedCircuit; // Advanced Circuit item, currently not meta sensitive - - advancedAlloy; // Advanced Alloy item, currently not meta sensitive - - carbonFiber; // Raw Carbon Fiber item, currently not meta sensitive - carbonMesh; // Raw Carbon Mesh item, currently not meta sensitive - carbonPlate; // Carbon Plate item, currently not meta sensitive - - matter; // UUA item, currently not meta sensitive - iridiumOre; // Iridium Ore item, currently not meta sensitive - iridiumPlate; // Iridium Plate item, currently not meta sensitive - - - // Metal Plates - - platecopper; // Metal plate item, meta sensitive - platetin; // Metal plate item, meta sensitive - platebronze; // Metal plate item, meta sensitive - plategold; // Metal plate item, meta sensitive - plateiron; // Metal plate item, meta sensitive - platelead; // Metal plate item, meta sensitive - platelapi; // Metal plate item, meta sensitive - plateobsidian; // Metal plate item, meta sensitive - plateadviron; // Metal plate item, meta sensitive - - // Metal Dense Plates - denseplatecopper; // Metal dense plate item, meta sensitive - denseplatetin; // Metal dense plate item, meta sensitive - denseplatebronze; // Metal dense plate item, meta sensitive - denseplategold; // Metal dense plate item, meta sensitive - denseplateiron; // Metal dense plate item, meta sensitive - @Deprecated - denseplateadviron; // Metal dense plate item, meta sensitive - denseplatelead; // Metal dense plate item, meta sensitive - denseplatelapi; // Metal dense plate item, meta sensitive - denseplateobsidian; // Metal dense plate item, meta sensitive - - - // upgrade modules - overclockerUpgrade; // overclocker upgrade item, meta sensitive - transformerUpgrade; // transformer upgrade item, meta sensitive - energyStorageUpgrade; // energy storage upgrade item, meta sensitive - ejectorUpgrade; // ejector upgrade item, meta sensitive - - // misc - coin; // Coin item, currently not meta sensitive - reinforcedDoor; // Reinforced Door item, currently not meta sensitive - constructionFoamPowder; // Construction Foam Powder item, currently not meta sensitive - grinPowder; // Poisonous ingrident, currently not meta sensitive - debug; // Debug item, currently not meta sensitive - boatCarbon; // Carbon Fiber Canoe item, meta sensitive - boatRubber; // Rubber Dinghy item, meta sensitive - boatRubberBroken; // Damaged Rubber Dinghy item, meta sensitive - boatElectric; // Electric Boat item, meta sensitive - - //Agriculture - cropSeed; // Crop seeds, stuff stored in NBT, don't use for crafting recipes! - cropnalyzer; // Cropnalyzer handheld device - fertilizer; // Basic IC2Item, used to provide nutrients toCropBlocks - hydratingCell; // Cell used to hydrate Crops, meta = Content, 0= Full, 9999 = Near empty - electricHoe; // Electric Hoe, Metadata indicates charge level - terraWart; // Mystic opposite of NEtherWart, cures StatusEffects, simply consumeable - weedEx; // Spraying can of WEED-EX, meta indicates usages left - - //Boozeception - mugEmpty; // Simple stone mug - coffeeBeans; // Harvested CoffeeBeans - coffeePowder; // Processed Coffee Beans, used to craft drinkable Coffee - mugCoffee; // Mug of Coffee, Meta indicates status 0 = cold, 1 = Normal, 2 = Sugar'd - hops; // Hops, harvested freshly from crop - barrel; // Carried Barrel, metadata encrypts the information about the liquid inside - blockBarrel; // Unobtainable "placed barrel", TileEntity controlling the Fermentation process - mugBooze; // Mug filled with booze, metadata encrypts the information about the liquid inside - - */ - /** - * Get the base IC2 package name, used internally. - * - * @return IC2 package name, if unable to be determined defaults to ic2 + * Get the ItemAPI Instance. + * @return the ItemAPI instance. */ - private static String getPackage() { - Package pkg = IC2Items.class.getPackage(); - - if (pkg != null) { - String packageName = pkg.getName(); - - return packageName.substring(0, packageName.length() - ".api.item".length()); - } - - return "ic2"; + public static IItemAPI getItemAPI() { + return instance; + } + + + private static IItemAPI instance; + + /** + * Sets the internal IItemAPI instance. + * ONLY IC2 CAN DO THIS!!!!!!! + */ + public static void setInstance(IItemAPI api) { + ModContainer mc = Loader.instance().activeModContainer(); + + if (mc == null || !"IC2".equals(mc.getModId())) { + throw new IllegalAccessError("invoked from "+mc); + } + + instance = api; } - private static Class Ic2Items; } +/* +================================================= +Info +================================================= + +The different Items are separaed by an empty line. +The first entry is always the itemname followed by a ":" +If you only want to access the Item, you have to use getItemAPI().getItem() with that name. +If you only want to access the Block, you have to use getItemAPI().getBlock() with that name. +Then come the different variants as follows: +If the item has variants, it is displayed like that: +itemname,variant Display name +Otherwise, it is displayed like that: +itemname Display name +You can access ItemStacks of Items without variants using the variant null + + +================================================= +Items +================================================= + +boat: +boat,broken_rubber Damaged Rubber Dinghy +boat,rubber Rubber Dinghy +boat,carbon Carbon Fiber Canoe +boat,electric Electric Boat + +crushed: +crushed,copper Crushed Copper Ore +crushed,gold Crushed Gold Ore +crushed,iron Crushed Iron Ore +crushed,lead Crushed Lead Ore +crushed,silver Crushed Silver Ore +crushed,tin Crushed Tin Ore +crushed,uranium Crushed Uranium Ore + +purified: +purified,copper Purified Crushed Copper Ore +purified,gold Purified Crushed Gold Ore +purified,iron Purified Crushed Iron Ore +purified,lead Purified Crushed Lead Ore +purified,silver Purified Crushed Silver Ore +purified,tin Purified Crushed Tin Ore +purified,uranium Purified Crushed Uranium Ore + +dust: +dust,bronze Bronze Dust +dust,clay Clay Dust +dust,coal Coal Dust +dust,coal_fuel Hydrated Coal Dust +dust,copper Copper Dust +dust,diamond Diamond Dust +dust,energium Energium Dust +dust,gold Gold Dust +dust,iron Iron Dust +dust,lapis Lapis Lazuli Dust +dust,lead Lead Dust +dust,lithium Lithium Dust +dust,obsidian Obsidian Dust +dust,silicon_dioxide Silicon Dioxide +dust,silver Silver Dust +dust,stone Stone Dust +dust,sulfur Sulfur Dust +dust,tin Tin Dust +dust,small_bronze Tiny Pile of Bronze Dust +dust,small_copper Tiny Pile of Copper Dust +dust,small_gold Tiny Pile of Gold Dust +dust,small_iron Tiny Pile of Iron Dust +dust,small_lapis Tiny Pile of Lapis Dust +dust,small_lead Tiny Pile of Lead Dust +dust,small_lithium Tiny Pile of Lithium Dust +dust,small_obsidian Tiny Pile of Obsidian Dust +dust,small_silver Tiny Pile of Silver Dust +dust,small_sulfur Tiny Pile of Sulfur Dust +dust,small_tin Tiny Pile of Tin Dust + +ingot: +ingot,alloy Mixed Metal Ingot +ingot,bronze Bronze Ingot +ingot,copper Copper Ingot +ingot,lead Lead Ingot +ingot,silver Silver Ingot +ingot,steel Steel Ingot +ingot,tin Tin Ingot + +plate: +plate,bronze Bronze Plate +plate,copper Copper Plate +plate,gold Gold Plate +plate,iron Iron Plate +plate,lapis Lapis Lazuli Plate +plate,lead Lead Plate +plate,obsidian Obsidian Plate +plate,steel Steel Plate +plate,tin Tin Plate +plate,dense_bronze Dense Bronze Plate +plate,dense_copper Dense Copper Plate +plate,dense_gold Dense Gold Plate +plate,dense_iron Dense Iron Plate +plate,dense_lapis Dense Lapis Lazuli Plate +plate,dense_lead Dense Lead Plate +plate,dense_obsidian Dense Obsidian Plate +plate,dense_steel Dense Steel Plate +plate,dense_tin Dense Tin Plate + +casing: +casing,bronze Bronze Item Casing +casing,copper Copper Item Casing +casing,gold Gold Item Casing +casing,iron Iron Item Casing +casing,lead Lead Item Casing +casing,steel Steel Item Casing +casing,tin Tin Item Casing + +nuclear: +nuclear,uranium Enriched Uranium Nuclear Fuel +nuclear,uranium_235 Uranium 235 +nuclear,uranium_238 Uranium 238 +nuclear,plutonium Plutonium +nuclear,mox MOX Nuclear Fuel +nuclear,small_uranium_235 Tiny Pile of Uranium 235 +nuclear,small_uranium_238 Tiny Pile of Uranium 238 +nuclear,small_plutonium Tiny Pile of Plutonium +nuclear,uranium_pellet Pellets of Enriched Uranium Nuclear Fuel +nuclear,mox_pellet Pellets of MOX Nuclear Fuel +nuclear,rtg_pellet Pellets of RTG Fuel +nuclear,depleted_uranium Fuel Rod (Depleted Uranium) +nuclear,depleted_dual_uranium Dual Fuel Rod (Depleted Uranium) +nuclear,depleted_quad_uranium Quad Fuel Rod (Depleted Uranium) +nuclear,depleted_mox Fuel Rod (Depleted MOX) +nuclear,depleted_dual_mox Dual Fuel Rod (Depleted MOX) +nuclear,depleted_quad_mox Quad Fuel Rod (Depleted MOX) + +misc_resource: +misc_resource,ashes Ashes +misc_resource,iridium_ore Iridium Ore +misc_resource,iridium_shard Iridium Shard +misc_resource,matter UU-Matter +misc_resource,resin Sticky Resin +misc_resource,slag Slag + +block_cutting_blade: +block_cutting_blade,iron Block Cutting Blade (Iron) +block_cutting_blade,steel Block Cutting Blade (Steel) +block_cutting_blade,diamond Block Cutting Blade (Diamond) + +crafting: +crafting,rubber Rubber +crafting,circuit Electronic Circuit +crafting,advanced_circuit Advanced Circuit +crafting,alloy Advanced Alloy +crafting,iridium Iridium Reinforced Plate +crafting,coil Coil +crafting,electric_motor Electric Motor +crafting,heat_conductor Heat Conductor +crafting,copper_boiler Copper Boiler +crafting,fuel_rod Fuel Rod (Empty) +crafting,tin_can Tin Can +crafting,small_power_unit Small Power Unit +crafting,power_unit Power Unit +crafting,carbon_fibre Raw Carbon Fibre +crafting,carbon_mesh Raw Carbon Mesh +crafting,carbon_plate Carbon Plate +crafting,coal_ball Coal Ball +crafting,coal_block Compressed Coal Ball +crafting,coal_chunk Coal Chunk +crafting,industrial_diamond Industrial Diamond +crafting,plant_ball Plantball +crafting,bio_chaff Bio Chaff +crafting,compressed_hydrated_coal H. Coal +crafting,scrap Scrap +crafting,scrap_box Scrap Box +crafting,cf_powder CF Powder +crafting,pellet CF Pellet +crafting,raw_crystal_memory Crystal Memory (raw) +crafting,iron_shaft Shaft (Iron) +crafting,steel_shaft Shaft (Steel) +crafting,wood_rotor_blade Wood Rotor Blade +crafting,iron_rotor_blade Iron Rotor Blade +crafting,steel_rotor_blade Steel Rotor Blade +crafting,carbon_rotor_blade Carbon Rotor Blade +crafting,steam_turbine_blade Steam Turbine Blade +crafting,steam_turbine Steam Turbine + +crystal_memory: +crystal_memory Crystal Memory + +upgrade_kit: +upgrade_kit,mfsu MFSU Upgrade Kit + +crop_res: +crop_res,coffee_beans Coffee Beans +crop_res,coffee_powder Coffee Powder +crop_res,fertilizer Fertilizer +crop_res,grin_powder Grin Powder +crop_res,hops Hops +crop_res,weed Weed + +terra_wart: +terra_wart item.terra_wart + +re_battery: +re_battery RE-Battery + +advanced_re_battery: +advanced_re_battery Advanced RE-Battery + +energy_crystal: +energy_crystal Energy Crystal + +lapotron_crystal: +lapotron_crystal Lapotron Crystal + +single_use_battery: +single_use_battery Single-Use Battery + +charging_re_battery: +charging_re_battery Charging RE Battery + +advanced_charging_re_battery: +advanced_charging_re_battery Advanced Charging Battery + +charging_energy_crystal: +charging_energy_crystal Charging Energy Crystal + +charging_lapotron_crystal: +charging_lapotron_crystal Charging Lapotron Crystal + +heat_storage: +heat_storage 10k Coolant Cell + +tri_heat_storage: +tri_heat_storage 30k Coolant Cell + +hex_heat_storage: +hex_heat_storage 60k Coolant Cell + +plating: +plating Reactor Plating + +heat_plating: +heat_plating Heat-Capacity Reactor Plating + +containment_plating: +containment_plating Containment Reactor Plating + +heat_exchanger: +heat_exchanger Heat Exchanger + +reactor_heat_exchanger: +reactor_heat_exchanger Reactor Heat Exchanger + +component_heat_exchanger: +component_heat_exchanger Component Heat Exchanger + +advanced_heat_exchanger: +advanced_heat_exchanger Advanced Heat Exchanger + +heat_vent: +heat_vent Heat Vent + +reactor_heat_vent: +reactor_heat_vent Reactor Heat Vent + +overclocked_heat_vent: +overclocked_heat_vent Overclocked Heat Vent + +component_heat_vent: +component_heat_vent Component Heat Vent + +advanced_heat_vent: +advanced_heat_vent Advanced Heat Vent + +neutron_reflector: +neutron_reflector Neutron Reflector + +thick_neutron_reflector: +thick_neutron_reflector Thick Neutron Reflector + +rsh_condensator: +rsh_condensator RSH-Condensator + +lzh_condensator: +lzh_condensator LZH-Condensator + +uranium_fuel_rod: +uranium_fuel_rod Fuel Rod (Uranium) + +dual_uranium_fuel_rod: +dual_uranium_fuel_rod Dual Fuel Rod (Uranium) + +quad_uranium_fuel_rod: +quad_uranium_fuel_rod Quad Fuel Rod (Uranium) + +mox_fuel_rod: +mox_fuel_rod Fuel Rod (MOX) + +dual_mox_fuel_rod: +dual_mox_fuel_rod Dual Fuel Rod (MOX) + +quad_mox_fuel_rod: +quad_mox_fuel_rod Quad Fuel Rod (MOX) + +lithium_fuel_rod: +lithium_fuel_rod Fuel Rod (Lithium) + +tfbp: +tfbp,blank TFBP - Empty +tfbp,chilling TFBP - Chilling +tfbp,cultivation TFBP - Cultivation +tfbp,desertification TFBP - Desertification +tfbp,flatification TFBP - Flatification +tfbp,irrigation TFBP - Irrigation +tfbp,mushroom TFBP - Mushroom + +bronze_axe: +bronze_axe Bronze Axe + +bronze_hoe: +bronze_hoe Bronze Hoe + +bronze_pickaxe: +bronze_pickaxe Bronze Pickaxe + +bronze_shovel: +bronze_shovel Bronze Shovel + +bronze_sword: +bronze_sword Bronze Sword + +containment_box: +containment_box Containment Box + +cutter: +cutter Cutter + +debug_item: +debug_item Debug Item + +foam_sprayer: +foam_sprayer CF Sprayer + +forge_hammer: +forge_hammer Forge Hammer + +frequency_transmitter: +frequency_transmitter Frequency Transmitter + +meter: +meter EU-Reader + +tool_box: +tool_box Tool Box + +treetap: +treetap Treetap + +wrench: +wrench Wrench + +barrel: +barrel Empty Booze Barrel + +booze_mug: +booze_mug Zero + +mug: +mug,empty Stone Mug +mug,cold_coffee Cold Coffee +mug,dark_coffee Dark Coffee +mug,coffee Coffee + +cropnalyzer: +cropnalyzer Cropnalyzer + +weeding_trowel: +weeding_trowel Weeding Trowel + +advanced_scanner: +advanced_scanner OV Scanner + +chainsaw: +chainsaw Chainsaw + +diamond_drill: +diamond_drill Diamond Drill + +drill: +drill Mining Drill + +electric_hoe: +electric_hoe Electric Hoe + +electric_treetap: +electric_treetap Electric Treetap + +electric_wrench: +electric_wrench Electric Wrench + +iridium_drill: +iridium_drill Iridium Drill + +mining_laser: +mining_laser Mining Laser + +nano_saber: +nano_saber Nano Saber + +obscurator: +obscurator Obscurator + +scanner: +scanner OD Scanner + +wind_meter: +wind_meter Windmeter + +painter: +painter Painter +painter,black Black Painter +painter,blue Blue Painter +painter,brown Brown Painter +painter,cyan Cyan Painter +painter,gray Dark Grey Painter +painter,green Green Painter +painter,light_blue Light Blue Painter +painter,light_gray Light Grey Painter +painter,lime Lime Painter +painter,magenta Magenta Painter +painter,orange Orange Painter +painter,pink Pink Painter +painter,purple Purple Painter +painter,red Red Painter +painter,white White Painter +painter,yellow Yellow Painter + +fluid_cell: +fluid_cell Universal Fluid Cell +fluid_cell,ic2air Universal Fluid Cell +fluid_cell,ic2biogas Universal Fluid Cell +fluid_cell,ic2biomass Universal Fluid Cell +fluid_cell,ic2construction_foam Universal Fluid Cell +fluid_cell,ic2coolant Universal Fluid Cell +fluid_cell,ic2distilled_water Universal Fluid Cell +fluid_cell,ic2heavy_water Universal Fluid Cell +fluid_cell,ic2hot_coolant Universal Fluid Cell +fluid_cell,ic2hot_water Universal Fluid Cell +fluid_cell,ic2hydrogen Universal Fluid Cell +fluid_cell,ic2oxygen Universal Fluid Cell +fluid_cell,ic2pahoehoe_lava Universal Fluid Cell +fluid_cell,ic2steam Universal Fluid Cell +fluid_cell,ic2superheated_steam Universal Fluid Cell +fluid_cell,ic2uu_matter Universal Fluid Cell +fluid_cell,ic2weed_ex Universal Fluid Cell +fluid_cell,lava Universal Fluid Cell +fluid_cell,water Universal Fluid Cell + +cable: +cable,type:copper,insulation:0 Copper Cable +cable,type:copper,insulation:1 Insulated Copper Cable +cable,type:glass,insulation:0 Glass Fibre Cable +cable,type:gold,insulation:0 Gold Cable +cable,type:gold,insulation:1 Insulated Gold Cable +cable,type:gold,insulation:2 2x Ins. Gold Cable +cable,type:iron,insulation:0 HV Cable +cable,type:iron,insulation:1 Insulated HV Cable +cable,type:iron,insulation:2 2x Ins. HV Cable +cable,type:iron,insulation:3 3x Ins. HV Cable +cable,type:tin,insulation:0 Tin Cable +cable,type:tin,insulation:1 Insulated Tin Cable +cable,type:detector,insulation:0 EU-Detector Cable +cable,type:splitter,insulation:0 EU-Splitter Cable + +upgrade: +upgrade,overclocker Overclocker Upgrade +upgrade,transformer Transformer Upgrade +upgrade,energy_storage Energy Storage Upgrade +upgrade,redstone_inverter Redstone Signal Inverter Upgrade +upgrade,ejector Ejector Upgrade +upgrade,pulling Pulling Upgrade +upgrade,fluid_ejector Fluid Ejector Upgrade + +advanced_batpack: +advanced_batpack Adv.Batpack + +alloy_chestplate: +alloy_chestplate Composite Vest + +batpack: +batpack BatPack + +bronze_boots: +bronze_boots Bronze Boots + +bronze_chestplate: +bronze_chestplate Bronze Chestplate + +bronze_helmet: +bronze_helmet Bronze Helmet + +bronze_leggings: +bronze_leggings Bronze Leggings + +cf_pack: +cf_pack CF Backpack +cf_pack CF Backpack + +energy_pack: +energy_pack Energypack + +hazmat_chestplate: +hazmat_chestplate Hazmat Suit + +hazmat_helmet: +hazmat_helmet Scuba Helmet + +hazmat_leggings: +hazmat_leggings Hazmat Suit Leggings + +jetpack: +jetpack Jetpack +jetpack Jetpack + +jetpack_electric: +jetpack_electric Electric Jetpack + +lappack: +lappack Lappack + +nano_boots: +nano_boots NanoSuit Boots + +nano_chestplate: +nano_chestplate NanoSuit Bodyarmor + +nano_helmet: +nano_helmet NanoSuit Helmet + +nano_leggings: +nano_leggings NanoSuit Leggings + +nightvision_goggles: +nightvision_goggles Nightvision Goggles + +quantum_boots: +quantum_boots QuantumSuit Boots + +quantum_chestplate: +quantum_chestplate QuantumSuit Bodyarmor + +quantum_helmet: +quantum_helmet QuantumSuit Helmet + +quantum_leggings: +quantum_leggings QuantumSuit Leggings + +rubber_boots: +rubber_boots Rubber Boots + +solar_helmet: +solar_helmet Solar Helmet + +static_boots: +static_boots Static Boots + +filled_tin_can: +filled_tin_can (Filled) Tin Can + +rotor_wood: +rotor_wood Kinetic Gearbox Rotor (Wood) + +rotor_iron: +rotor_iron Kinetic Gearbox Rotor (Iron) + +rotor_carbon: +rotor_carbon Kinetic Gearbox Rotor (Carbon) + +rotor_steel: +rotor_steel Kinetic Gearbox Rotor (Steel) + + +================================================= +Blocks: +================================================= + +te: +te,itnt Industrial TNT +te,nuke Nuke +te,generator Generator +te,geo_generator Geothermal Generator +te,kinetic_generator Kinetic Generator +te,rt_generator Radioisotope Thermoelectric Generator +te,semifluid_generator Semifluid Generator +te,solar_generator Solar Panel +te,stirling_generator Stirling Generator +te,water_generator Water Mill +te,wind_generator Wind Mill +te,electric_heat_generator Electric Heater +te,fluid_heat_generator Liquid Fuel Firebox +te,rt_heat_generator Radioisotope Heat Generator +te,solid_heat_generator Solid Fuel Firebox +te,electric_kinetic_generator Electric Motor +te,manual_kinetic_generator Manual Kinetic Generator +te,steam_kinetic_generator Steam Turbine +te,stirling_kinetic_generator Stirling Kinetic Generator +te,water_kinetic_generator Water Turbine +te,wind_kinetic_generator Wind Turbine +te,nuclear_reactor Nuclear Reactor +te,reactor_access_hatch Reactor Access Hatch +te,reactor_chamber Reactor Chamber +te,reactor_fluid_port Reactor Fluid Port +te,reactor_redstone_port Reactor Redstone Port +te,condenser Condenser +te,fluid_bottler Bottling Plant +te,fluid_distributor Fluid Distributor +te,fluid_regulator Fluid Regulator +te,liquid_heat_exchanger Liquid Heat Exchanger +te,pump Pump +te,solar_distiller Solar Distiller +te,steam_generator Steam Boiler +te,item_buffer Item Buffer +te,luminator_flat Luminator +te,magnetizer Magnetizer +te,sorting_machine Electric Sorting Machine +te,teleporter Teleporter +te,terraformer Terraformer +te,tesla_coil Tesla Coil +te,canner Fluid/Solid Canning Machine +te,compressor Compressor +te,electric_furnace Electric Furnace +te,extractor Extractor +te,iron_furnace Iron Furnace +te,macerator Macerator +te,recycler Recycler +te,solid_canner Solid Canning Machine +te,blast_furnace Blast Furnace +te,block_cutter Block Cutting Machine +te,centrifuge Thermal Centrifuge +te,fermenter Fermenter +te,induction_furnace Induction Furnace +te,metal_former Metal Former +te,ore_washing_plant Ore Washing Plant +te,advanced_miner Advanced Miner +te,crop_harvester Crop Harvester +te,cropmatron Crop-Matron +te,miner Miner +te,matter_generator Mass Fabricator +te,pattern_storage Pattern Storage +te,replicator Replicator +te,scanner Scanner +te,energy_o_mat Energy-O-Mat +te,personal_chest Personal Safe +te,trade_o_mat Trade-O-Mat +te,chargepad_batbox Charge Pad (BatBox) +te,chargepad_cesu Charge Pad (CESU) +te,chargepad_mfe Charge Pad (MFE) +te,chargepad_mfsu Charge Pad (MFSU) +te,batbox BatBox +te,cesu CESU +te,mfe MFE +te,mfsu MFSU +te,electrolyzer Electrolyzer +te,lv_transformer LV-Transformer +te,mv_transformer MV-Transformer +te,hv_transformer HV-Transformer +te,ev_transformer EV-Transformer +te,tank Tank +te,chunk_loader Chunk Loader + +resource: +resource,basalt Basalt +resource,copper_ore Copper Ore +resource,lead_ore Lead Ore +resource,tin_ore Tin Ore +resource,uranium_ore Uranium Ore +resource,bronze_block Bronze Block +resource,copper_block Copper Block +resource,lead_block Lead Block +resource,steel_block Steel Block +resource,tin_block Tin Block +resource,uranium_block Uranium Block +resource,reinforced_stone Reinforced Stone +resource,machine Basic Machine Casing +resource,advanced_machine Advanced Machine Casing +resource,reactor_vessel Reactor Pressure Vessel + +leaves: +leaves Rubber Tree Leaves + +rubber_wood: +rubber_wood Rubber Wood + +sapling: +sapling Rubber Tree Sapling + +scaffold: +scaffold,wood Scaffold +scaffold,reinforced_wood Reinforced Scaffold +scaffold,iron Iron Scaffold +scaffold,reinforced_iron Reinforced Iron Scaffold + +foam: +foam,normal Construction Foam +foam,reinforced Reinforced Construction Foam + +fence: +fence,iron Iron Fence + +sheet: +sheet,rubber Rubber Sheet + +glass: +glass,reinforced Reinforced Glass + +wall: +wall,black Construction Foam Wall (Black) +wall,blue Construction Foam Wall (Blue) +wall,brown Construction Foam Wall (Brown) +wall,cyan Construction Foam Wall (Cyan) +wall,gray Construction Foam Wall (Gray) +wall,green Construction Foam Wall (Green) +wall,light_blue Construction Foam Wall (Light Blue) +wall,light_gray Construction Foam Wall (Light Gray) +wall,lime Construction Foam Wall (Lime) +wall,magenta Construction Foam Wall (Magenta) +wall,orange Construction Foam Wall (Orange) +wall,pink Construction Foam Wall (Pink) +wall,purple Construction Foam Wall (Purple) +wall,red Construction Foam Wall (Red) +wall,white Construction Foam Wall (White) +wall,yellow Construction Foam Wall (Yellow) + +mining_pipe: +mining_pipe,pipe Mining Pipe + +reinforced_door: +reinforced_door Reinforced Door + + */ diff --git a/src/api/java/ic2/api/item/IElectricItem.class b/src/api/java/ic2/api/item/IElectricItem.class index a49d1839e58ec8a9911bbba6399d169ced46a16d..4ca3a7eed885ba4bff7a50b1ebb6dc2094ab31ef 100644 GIT binary patch delta 71 zcmZ3_e3(h#)W2Q(7#J9g82H#3c-R?uCkj|jTzX!cg@uuUnSq6Y0Z6kluz_iI1`aUI P3F0#_GH?M&CI)T*>39g4 delta 150 zcmX@iw4Pbu)W2Q(7#J9g7zEiF_}Li*CJI;z@ujDhIAF0Y7=Sb@0~?rT bhteDjoM1i|12>rF0r43a8F+yt69XRrxRo8) diff --git a/src/api/java/ic2/api/item/IElectricItem.java b/src/api/java/ic2/api/item/IElectricItem.java index 5525e00f6..b94634a63 100644 --- a/src/api/java/ic2/api/item/IElectricItem.java +++ b/src/api/java/ic2/api/item/IElectricItem.java @@ -1,6 +1,5 @@ package ic2.api.item; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; /** @@ -14,42 +13,30 @@ public interface IElectricItem { * * @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); + boolean canProvideEnergy(ItemStack stack); /** * Get the item's maximum charge energy in EU. * * @return Maximum charge energy */ - double getMaxCharge(ItemStack itemStack); + double getMaxCharge(ItemStack stack); /** * 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. + * + * Batteries are Tier 1, Advanced Batteries are Tier 2, Energy Crystals are Tier 3, Lapotron + * Crystals are Tier 4. * * @return Item's tier */ - int getTier(ItemStack itemStack); + int getTier(ItemStack stack); /** * Get the item's transfer limit in EU per transfer operation. * * @return Transfer limit */ - double getTransferLimit(ItemStack itemStack); + double getTransferLimit(ItemStack stack); } diff --git a/src/api/java/ic2/api/item/IElectricItemManager.class b/src/api/java/ic2/api/item/IElectricItemManager.class index 978eb9147f0ce600a2623c5d997d99aac731137d..dc89a3a67e5e78406028afd35b2ad96dc5a203f3 100644 GIT binary patch delta 124 zcmey&a)4Ff)W2Q(7#J9g7$n#k#Ml|cCko8qT#A`}V=JwX~`No}i?=;2&=01qXmQWVsMn+#;~ z-u%h!ez^jeW5Cd7@CkmZOlVXQ8zJ|E)i}z;S@2wxDUVI1%QX1DnM9>BywIhRmDm}s zt$@EQ0ikQH%luFq`48hKpVUwJ6R#c^y0&*l4`AUMHqy2qQy3x)f*8; uTF$vR>LzW|Bn;mRZ<0(&;}Qst{U)H*CbZB7Z0*2(R)((a5PJ4>;5`6 getHudInfo(ItemStack itemStack) { + public List getHudInfo(ItemStack stack) { List info = new LinkedList(); info.add("i am a Cool Item"); info.add("and have Cool info"); @@ -20,5 +20,5 @@ public interface IItemHudInfo { */ - public List getHudInfo(ItemStack itemStack); + public List getHudInfo(ItemStack stack); } diff --git a/src/api/java/ic2/api/item/IKineticRotor$GearboxType.class b/src/api/java/ic2/api/item/IKineticRotor$GearboxType.class new file mode 100644 index 0000000000000000000000000000000000000000..4c6ab9db614f136d3ad60d6095365e3602a6cfee GIT binary patch literal 1125 zcmb7DZEw<06n-u(6iUY!FdaBwrZ{<-RB(O~varm}5D7~LvMhcowPKgjE~PB`uaqUu zXf*rmk20Ry5eHEdyiM-Sz2`aSdCp6J{QUAAKn0r-h*+2L067Us2?ZGnihSD$V?ie4 z21h&$V~L+72`WSIaJ#d6zz}_IXl~DW*Li1LgtCMR!}@$(R$Hb_TaxfANKf#a2>7pZLM(hn@B$*o z2WIdYdQmP>xPevQPNgCgXDmaY50DDQ)pLYC`sQi6D|ZRExpds|F>45u+_j027A3-0 z=_|yege06Je1?dBkwyO!4Spk&Fs1=J632+P&%ij_WpXiJM2d>Ej0_b)1BgOZ^DJd7f$+C{Gl%g5a z@F$O8!`dCK8or$AG>SVH4QrJIaJmv~v;HKI?(J#<4OV+ECh}DZ9Itm1sC@VM zp)_OvVK5=Z0%z;{SEuI$1TyaDfm~J~2M=(#gWUx4C?r@+`BI8y>^VgSm89-t+hN{0 KZMl=ZJo*CNd#hsr literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/item/IKineticWindRotor.java b/src/api/java/ic2/api/item/IKineticRotor.java similarity index 68% rename from src/api/java/ic2/api/item/IKineticWindRotor.java rename to src/api/java/ic2/api/item/IKineticRotor.java index de696e381..a61d1622c 100644 --- a/src/api/java/ic2/api/item/IKineticWindRotor.java +++ b/src/api/java/ic2/api/item/IKineticRotor.java @@ -3,7 +3,7 @@ package ic2.api.item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -public interface IKineticWindRotor { +public interface IKineticRotor { int getDiameter(ItemStack stack); ResourceLocation getRotorRenderTexture(ItemStack stack); @@ -13,4 +13,11 @@ public interface IKineticWindRotor { int getMinWindStrength(ItemStack stack); int getMaxWindStrength(ItemStack stack); + + boolean isAcceptedType(ItemStack stack, GearboxType type); + + public static enum GearboxType { + WATER, + WIND, + } } diff --git a/src/api/java/ic2/api/item/IKineticWindRotor.class b/src/api/java/ic2/api/item/IKineticWindRotor.class deleted file mode 100644 index 00f10fc86f1111a2bc90c6e9c78dcbe8f9547b80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 408 zcma)2!AiqG6r8PXqpejD^eA}KiwnK>Y74=NkO-dF?Mr+$*~t1L_18T30e+OY3Axyd zUf#ek^WMz+`u_L?FvVenNrVH1aZYm0rX(S+aDK6LB)Vir)|*T;3za$!BNbzxXP2?U zNpK{UR6ZfMB7aXCsXZyo|MG6Fu7wMo&}&tDOUud{;mXYvCSm_P%h)nG`~Hti3x(t0 zxn=jjZk38Bm&;Q}n$2%=l(zR4T!hG{@l9wdY#UA6>1u7>jKUe)sWva%_1{)095p&! q7?O*WDM!Got#2DZ4{CA%%^U-RG(@JAVk zMLl?6J+!Zxd2i-*+KdfUb^Y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Nq zj8)BA=~XQ|g6kF=WHg%=TWnkGu&dd#*ylhz7Ka>J9Fw)9M%)}^NONLwO0INgyeY?v zy`*mw-57Mr6|J;Ug-CyByf1&E-oj&?)!H$SC#V)9Y|N`wcU diff --git a/src/api/java/ic2/api/network/ClientModifiable.class b/src/api/java/ic2/api/network/ClientModifiable.class new file mode 100644 index 0000000000000000000000000000000000000000..dea7b6fc1a63553ec6f9a944c007bb581102bcc9 GIT binary patch literal 400 zcmah_Jx>Bb5PhTKDSlyLVT{pOP`U}NmBAw+0X64oW3`+kSzLC>v4`QWS?~k=QN%e5 z&lnPmot>HY=Ht!h@?!y@g~JH@5e_0W2=xbFR;WUrm`K?mdAlyKfFIm&7`RQd-{2?yyUlq*7QrfnhZoBvSny*1ff3Zmrk zHtqIf!s+UgROdqu!n|0G$Ck%3KAlgvoZsojy&GB8WG$s9MmY}eK7Uhx getNetworkedFields(); diff --git a/src/api/java/ic2/api/network/INetworkItemEventListener.java b/src/api/java/ic2/api/network/INetworkItemEventListener.java index 5f3228cec..7c59a270e 100644 --- a/src/api/java/ic2/api/network/INetworkItemEventListener.java +++ b/src/api/java/ic2/api/network/INetworkItemEventListener.java @@ -10,7 +10,7 @@ public interface INetworkItemEventListener { /** * Called when a network event is received. * - * @param itemStack item stack + * @param stack item stack * @param player player containing the item * @param event event ID */ diff --git a/src/api/java/ic2/api/network/INetworkManager.class b/src/api/java/ic2/api/network/INetworkManager.class new file mode 100644 index 0000000000000000000000000000000000000000..d0fd9c34a9a12c0a05e7dd2c83c2fac290928347 GIT binary patch literal 562 zcma)(OG^VW6opS}+tK=JL2)I5E9=5Qm(EgJ7-&@(ap5jbuS42tT87(7|C$SbfImvi zJj&SM!c7h#C*Qe`ukVjf06la(9D8UBoGuq*#q^{T>KoR)9%xF&0=HK~Lo8?7P?V}S zmTVoAJ7i_{hZD6@GEpX$A*b5Je)n16OdHL53)^4W&jQ!~!v-%IrnA8WOtTU&asg#c zi$tv{l|>Ja`NelS(3T=IRLClt`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2UUB>Nnz_G<1EPxlD<@?pusU~qtXABCT`bx`OgFIw{>nF1^x&$BMONz`b^2x) R0c$zadz$YHeA9xN{{bnMBI^JE diff --git a/src/api/java/ic2/api/network/NetworkHelper.java b/src/api/java/ic2/api/network/NetworkHelper.java index 5f9138d30..a2f71256d 100644 --- a/src/api/java/ic2/api/network/NetworkHelper.java +++ b/src/api/java/ic2/api/network/NetworkHelper.java @@ -1,11 +1,14 @@ package ic2.api.network; -import java.lang.reflect.Method; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.ModContainer; +import net.minecraftforge.fml.relauncher.Side; + /** * Provides methods to initiate events and synchronize tile entity fields in SMP. * @@ -40,7 +43,7 @@ public final class NetworkHelper { * - ItemStack * - NBTBase (includes NBTTagCompound) * - Block, Item, Achievement, Potion, Enchantment - * - ChunkCoordinates, ChunkCoordIntPair + * - BlockPos, ChunkCoordIntPair * - TileEntity (does not sync the actual tile entity, instead looks up the tile entity by its position in the client world) * - World (does not sync the actual world, instead looks up the world by its dimension ID) * @@ -54,14 +57,7 @@ public final class NetworkHelper { * @param field Name of the field to update */ public static void updateTileEntityField(TileEntity te, String field) { - try { - if (NetworkManager_updateTileEntityField == null) NetworkManager_updateTileEntityField = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("updateTileEntityField", TileEntity.class, String.class); - if (instance == null) instance = getInstance(); - - NetworkManager_updateTileEntityField.invoke(instance, te, field); - } catch (Exception e) { - throw new RuntimeException(e); - } + getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).updateTileEntityField(te, field); } /** @@ -76,14 +72,7 @@ public final class NetworkHelper { * tracking distance if true */ public static void initiateTileEntityEvent(TileEntity te, int event, boolean limitRange) { - try { - if (NetworkManager_initiateTileEntityEvent == null) NetworkManager_initiateTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateTileEntityEvent", TileEntity.class, Integer.TYPE, Boolean.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateTileEntityEvent.invoke(instance, te, event, limitRange); - } catch (Exception e) { - throw new RuntimeException(e); - } + getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateTileEntityEvent(te, event, limitRange); } /** @@ -95,20 +84,13 @@ public final class NetworkHelper { * INetworkItemEventListener.onNetworkEvent (if implemented by the item). * * @param player EntityPlayer holding the item - * @param itemStack ItemStack containing the item + * @param stack ItemStack containing the item * @param event Arbitrary integer to represent the event, choosing the values is up to you * @param limitRange Limit the notification range to (currently) 20 blocks instead of the * tracking distance if true */ - public static void initiateItemEvent(EntityPlayer player, ItemStack itemStack, int event, boolean limitRange) { - try { - if (NetworkManager_initiateItemEvent == null) NetworkManager_initiateItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateItemEvent", EntityPlayer.class, ItemStack.class, Integer.TYPE, Boolean.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateItemEvent.invoke(instance, player, itemStack, event, limitRange); - } catch (Exception e) { - throw new RuntimeException(e); - } + public static void initiateItemEvent(EntityPlayer player, ItemStack stack, int event, boolean limitRange) { + getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateItemEvent(player, stack, event, limitRange); } @@ -123,14 +105,7 @@ public final class NetworkHelper { * @param event Arbitrary integer to represent the event, choosing the values is up to you */ public static void initiateClientTileEntityEvent(TileEntity te, int event) { - try { - if (NetworkManager_initiateClientTileEntityEvent == null) NetworkManager_initiateClientTileEntityEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientTileEntityEvent", TileEntity.class, Integer.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateClientTileEntityEvent.invoke(instance, te, event); - } catch (Exception e) { - throw new RuntimeException(e); - } + getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateClientTileEntityEvent(te, event); } /** @@ -140,55 +115,41 @@ public final class NetworkHelper { * * This method doesn't do anything if executed on the server. * - * @param itemStack ItemStack containing the item + * @param stack ItemStack containing the item * @param event Arbitrary integer to represent the event, choosing the values is up to you */ - public static void initiateClientItemEvent(ItemStack itemStack, int event) { - try { - if (NetworkManager_initiateClientItemEvent == null) NetworkManager_initiateClientItemEvent = Class.forName(getPackage() + ".core.network.NetworkManager").getMethod("initiateClientItemEvent", ItemStack.class, Integer.TYPE); - if (instance == null) instance = getInstance(); - - NetworkManager_initiateClientItemEvent.invoke(instance, itemStack, event); - } catch (Exception e) { - throw new RuntimeException(e); - } + public static void initiateClientItemEvent(ItemStack stack, int event) { + getNetworkManager(FMLCommonHandler.instance().getEffectiveSide()).initiateClientItemEvent(stack, event); } /** - * Get the base IC2 package name, used internally. - * - * @return IC2 package name, if unable to be determined defaults to ic2 + * This will return the NetworkManager for the given side. + * @param side the side to get the NetworkManager for. + * @return The NetworkManager for the given side. */ - private static String getPackage() { - Package pkg = NetworkHelper.class.getPackage(); - - if (pkg != null) { - String packageName = pkg.getName(); - - return packageName.substring(0, packageName.length() - ".api.network".length()); + public static INetworkManager getNetworkManager(Side side) { + if (side.isClient()) { + return clientInstance; + } + else { + return serverInstance; } - - return "ic2"; } + private static INetworkManager serverInstance; + private static INetworkManager clientInstance; + /** - * Get the NetworkManager instance, used internally. - * - * @return NetworkManager instance + * Sets the internal INetworkManager instance. + * ONLY IC2 CAN DO THIS!!!!!!! */ - private static Object getInstance() { - try { - return Class.forName(getPackage() + ".core.IC2").getDeclaredField("network").get(null); - } catch (Throwable e) { - throw new RuntimeException(e); + public static void setInstance(INetworkManager server, INetworkManager client) { + ModContainer mc = Loader.instance().activeModContainer(); + if (mc == null || !"IC2".equals(mc.getModId())) { + throw new IllegalAccessError(); } + serverInstance = server; + clientInstance = client; } - - private static Object instance; - private static Method NetworkManager_updateTileEntityField; - private static Method NetworkManager_initiateTileEntityEvent; - private static Method NetworkManager_initiateItemEvent; - private static Method NetworkManager_initiateClientTileEntityEvent; - private static Method NetworkManager_initiateClientItemEvent; } diff --git a/src/api/java/ic2/api/network/package-info.class b/src/api/java/ic2/api/network/package-info.class index f4f18429ed0df94ead3e6bc06934d1c9dc78545a..c2d4dd55bad1867c846d79a925b722df58562e5c 100644 GIT binary patch delta 30 lcmZo<>SmhYFQV*|ms+Bqo0*rIT$Gqrl9peTo;opd1pu9Z3r7F| delta 20 bcmeBXYGj(=&n4-TTu`o`o1aoVF?j_5LJ9{b diff --git a/src/api/java/ic2/api/package-info.class b/src/api/java/ic2/api/package-info.class index 7caf6997842f48e97402f4b55bb54dced3669925..70b3064f59ce175af548f8eb2493cc3183d10756 100644 GIT binary patch delta 30 lcmey#*vvG+Uqsm_FSSHJH#09axhOHMBrU%vJ#}K_0syLu3$6eF delta 20 bcmZo>`pG!KpG(pwxu9G>H$SC#V)6n2Nx=t> diff --git a/src/api/java/ic2/api/reactor/IReactor.class b/src/api/java/ic2/api/reactor/IReactor.class new file mode 100644 index 0000000000000000000000000000000000000000..6f62b5b2cc7d2ef2c523c27ac0cdb16c8598befd GIT binary patch literal 706 zcmZ8f%TB^T6ungx0UwBh_egY$!wF#@ts-$v}uuN%hXU zcx~#}D~qzIx)oemG;h}&#N%n4v7Ooz2<~|kK}tZ8N5wsVn{au^e}e*~&7m~?%BFME z_l2wOBTxEL#ClH4qOzGYo6Xp*bZP~~ZNXg?#m!K}z4wPijS_5G{gZh7pTYq*umMX< z#c4ClN}X|(7+$0P#CDunZzOUo6?7DL2QVdv<)#IvD46kbMz38GZ=)dcU_G|L{soNe zN_Wua3f#&lj=aQ$>**<4^9)vwTR|edMid3YgRz|`iCxjc=Rwjj=U?{uE63f^tusE7 zES|W+rg@8sse%PO?6HTJKD=JE$f7y?9Ym!Jrcs6nxIl{3osaHI_`gL7O@*Q$^zzRW)wYj>cWu)3|T?9?+qVk5a^D$9T@s$q!ynrYHaa literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/reactor/IReactor.java b/src/api/java/ic2/api/reactor/IReactor.java new file mode 100644 index 000000000..0c43add16 --- /dev/null +++ b/src/api/java/ic2/api/reactor/IReactor.java @@ -0,0 +1,144 @@ +package ic2.api.reactor; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + +/** + * Interface implemented by the tile entity of nuclear reactors. + */ +public interface IReactor { + /** + * Return the tile entity representing the reactor core. + * + * @return the reactor core's TE or null. + */ + public TileEntity getCoreTe(); + + /** + * Get the reactor's heat. + * + * @return The reactor's heat + */ + public int getHeat(); + + /** + * Set the reactor's heat. + * + * @param heat reactor heat + */ + public void setHeat(int heat); + + /** + * Increase the reactor's heat. + * + * Use negative values to decrease. + * + * @param amount amount of heat to add + * @return The reactor's heat after adding the specified amount + */ + public int addHeat(int amount); + + /** + * Get the reactor's maximum heat before exploding. + * + * @return Maximum heat value + */ + public int getMaxHeat(); + + /** + * Set the reactor's stored maxHeat variable. + * Used by plating to increase the reactors MaxHeat capacity. + * Needs to be called during each cycle process. + */ + public void setMaxHeat(int newMaxHeat); + + /** + * add Heat to a EmitHeat Buffer + * for use in Reactor operation.. need to be use + * for all Componetents with self-cooling + * no more magic heat disappear + */ + + + public void addEmitHeat(int heat); + + /** + * Get's the reactor's HEM (Heat Effect Modifier) + * Basic value is 1.0F. + * Reducing the value causes a weakening/reduction of the heat-based sideeffects of reactors + * (F.e. water evaporation, melting, damaging entitys, etc) + * + * @return HEM + */ + public float getHeatEffectModifier(); + + /** + * Set's the reactor's HEM + * Needs to be called during each cycle process. + */ + public void setHeatEffectModifier(float newHEM); + + /** + * Get the reactor's energy output. + * + * @return Energy output, not multiplied by the base EU/t value + */ + public float getReactorEnergyOutput(); + + /** + * Get the reactor's energy output. + * + * @return Energy output, multiplied with base EU/t value and MainConfig.get().getFloat("balance/energy/generator/nuclear") + */ + public double getReactorEUEnergyOutput(); + + /** + * Add's the given amount of energy to the Reactor's output. + * + * @return Energy output after adding the value, not multiplied by the base EU/t value + */ + public float addOutput(float energy); + + /** + * Get the item at the specified grid coordinates. + * + * @param x X position of the item, out of bounds returns null + * @param y Y position of the item, out of bounds returns null + * @return The item or null if there is no item + */ + public ItemStack getItemAt(int x, int y); + + /** + * Set the item at the specified grid coordinates. + * + * @param x X position of the item, out of bounds is a no-op + * @param y Y position of the item, out of bounds is a no-op + * @param item The item to set. + */ + public void setItemAt(int x, int y, ItemStack item); + + /** + * Explode the reactor. + */ + public void explode(); + + /** + * Get the reactor's tick rate (game ticks per reactor tick). + * + * @return Tick rate + */ + public int getTickRate(); + + /** + * Get whether the reactor is active and supposed to produce energy + * @return Whether the reactor is active + */ + public boolean produceEnergy(); + + // TODO: add the rs modifier capability to the api somehow + + /** + * @return true if the reactor is FluidCooled + */ + public boolean isFluidCooled(); +} diff --git a/src/api/java/ic2/api/reactor/IReactorComponent.class b/src/api/java/ic2/api/reactor/IReactorComponent.class new file mode 100644 index 0000000000000000000000000000000000000000..cf1b0fb7af998878b5b9431a4b83c294d8e11b62 GIT binary patch literal 720 zcmb`F&rSj{5XQeEvVw?;#=AH7ViT@JFB^$XFdB&-IGB`Xz~XMZ>2?jz=D`Q>p^Rlw zZ+bv`m~Wa)f1Q7C?=PGjc~xw$(>bH6v?B^Cgd2-Plkp(&$J=syHPa`jIW2qJd7s=#IVyoY*Y4CKPcxm(P;n_@_0 to indicate the 'remaining' heat which couldn't be absorbed (and vice versa for <0) + */ + public int alterHeat(ItemStack stack, IReactor reactor, int x, int y, int heat); + + /** + * Called upon reactor explosion + * Alter the explosion size. + * Returning a float 0 < f < 1 will be counted as multiplier. + * Anything else will be counted as a flat addition (in case of <0 = reduction). + * + * @param stack Reference to the specific instance of iterated ItemStack + * @param reactor Reference to the Reactor + * @return your explosion modifier + */ + public float influenceExplosion(ItemStack stack, IReactor reactor); +} diff --git a/src/api/java/ic2/api/reactor/package-info.class b/src/api/java/ic2/api/reactor/package-info.class new file mode 100644 index 0000000000000000000000000000000000000000..d27d5e085fb6db05a770a3dd47252b76a6229806 GIT binary patch literal 267 zcmYk1&q@P94935-wp;7JdQcF&dA6f_^;8N%p`a-AJ{_~m)ZNK4Gp+CD!3Xf6#MF~H zB;*Ufz&=a=vD~?GSLjQhxM;ORQ;HceV zUJ^!Kl%0QL-8fW1DZ;gPrBTpCwk}IF|E&=wdvm6-p*BzJ4ZC~^5PJICK6>c?V zn%H18@zum1Wjr&~_<#ly_u<^;T)z3v?2n&cz5%G9;=#kMJn|?RaodPHMwC4)V9~{r z2N!{h(8XPb5t(#)`bj(OC7OZN7@T9l$;_oaO(zUf^%MSvM=hQ-qlQ*8X>Kw2XQ#jG zat~!9^<##apjJDdUt8X%zT4@cU>L82q4ZlCUrQ39wp+a06_oX;F5^nXJ2FxtmK_n*24zC+*}x7@cvGnI z-@4Il@=c+42iFaP<$5A?)Fzm*;z#-@RZS5cwR-Zf8&!>JXdb_&vQca7@Q%ey%rbb5 zw5MWGmF8l_f52EZg!-7oJs%_ReT*70hH)Pg@LjCh z>jS0m6P(Y;eTU25qwp2(t3ia+&?$yLP=hQCs2r674=e!R+NA-2BE?-~#-6*lL9=g? Ro54J0NPCo+$1<)V{|ll!2gLvY literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/recipe/IFermenterRecipeManager.class b/src/api/java/ic2/api/recipe/IFermenterRecipeManager.class new file mode 100644 index 0000000000000000000000000000000000000000..78c4f28f828cbc9ba2cd861556a69ba2f48a6b95 GIT binary patch literal 765 zcmbu7!AiqG5Qb;9Hnvu6wJL}=MOqIo^coRFCdSM%Tl_)y|B zZLw6viicsAoymN&|DU(_msbF2!GQz24%8jkb6}rAy^Uss+6t>;ePiMTjeTZN@w7&B z9f>r>ltD@K`?n}nf(*_Y{!ly#9tj=tz#64P*Ym!)Yu+(94AIULJUxibD2Fk)Z}=K5 zA1RH}h=HY2hU``SgVW_?Wl;U}y4xF~Bpr_zzxCB4d37ZvCU)uv19!3O55^T4Fj%2j srC+vCVBo+y9Y|9s=XnDvdESIA>e{BR6{u3w^3x6!DVM2Ipjd;_2c_BV!vFvP literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/recipe/IFermenterRecipeManager.java b/src/api/java/ic2/api/recipe/IFermenterRecipeManager.java new file mode 100644 index 000000000..a7b7907ab --- /dev/null +++ b/src/api/java/ic2/api/recipe/IFermenterRecipeManager.java @@ -0,0 +1,64 @@ +package ic2.api.recipe; + +import java.util.Map; + +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +/** + * Fermenter recipe manager, very closely based off of {@link ISemiFluidFuelManager} + * + * @author Chocohead + */ +public interface IFermenterRecipeManager extends ILiquidAcceptManager { + /** + * Add a new fluid to the fermenter. + * + * @param input The name of the fluid to ferment + * @param inputAmount The amount of input fluid used per operation + * @param ticks The total amount of heat needed to convert the input into the output + * @param output The name of the fluid that is being fermented into + * @param outputAmount The amount of output fluid produced per operation + */ + void addRecipe(String input, int inputAmount, int heat, String output, int outputAmount); + + /** + * Get a fermenter recipe for the given fluid + * + * @return The found recipe or null if no recipe is found + */ + FermentationProperty getFermentationInformation(Fluid fluid); + + /** + * Get the {@link FluidStack} output for the given input fluid + * + * @param Input fluid + * @return Output fluid + amount + */ + FluidStack getOutput(Fluid input); + + /** + * Gets the whole current fluid mappings + * @return The current fluid map + */ + Map getRecipeMap(); + + public static class FermentationProperty { + public FermentationProperty(int inputAmount, int heat, String output, int outputAmount) { + this.inputAmount = inputAmount; + this.heat = heat; + this.output = output; + this.outputAmount = outputAmount; + } + + public FluidStack getOutput() { + return FluidRegistry.getFluid(this.output) == null ? null : new FluidStack(FluidRegistry.getFluid(this.output), this.outputAmount); + } + + public final int inputAmount; + public final int heat; + public final String output; + public final int outputAmount; + } +} \ No newline at end of file diff --git a/src/api/java/ic2/api/recipe/IFluidRecipeManager$RecipeIoContainerFluid.class b/src/api/java/ic2/api/recipe/IFluidRecipeManager$RecipeIoContainerFluid.class new file mode 100644 index 0000000000000000000000000000000000000000..d2fad775369819f90bf0d99d454d6cb9012e18dc GIT binary patch literal 687 zcma)4O;5r=5Pe&~3RVlKh#w?MJRlmI5I5jsHq12Xk&Eg|z z`NEbXVYTj}y`|E1h6OJSB49ZVoZ>oBy6J?nuh5s$mBAImbtMk}!5dHh<~ryyBpY5| zFqm!WiretHC;SKAb10H;dp38v+?UFq1(U&(95WPV`n`td2AnGWNF0OFa>;2pd^{F} ztH(98BHXn4hP!+q{Qdb{^r4x1FZ6BEluAxbI^~oo+8M13mdG09JrW{8yIFk$ zs~%3ERgWe}yi!QRGTA&40ViZnsr(EpIHwobotD8QgnG=V4U0~ykw$BkJPm8q8q|_T Jj3Tl~e*;5ntSSHi literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/recipe/IFluidRecipeManager.class b/src/api/java/ic2/api/recipe/IFluidRecipeManager.class new file mode 100644 index 0000000000000000000000000000000000000000..a6f3a2d4e76457b2b66848a0c0a43f63a8acaf72 GIT binary patch literal 654 zcmah{Jx{|h5Iwi0A)!F|s+bW&x?rgr3SuBqq)3HIq*IyP#Eo21CvqHi{uTp2fFFgp zBt@v9h{0dyckjJB`{VQN9RNmfX27ulCkC7n7(DV&WZX~PRB9$9S6)(xh(OPmcyJSz z=R7B1vM8#d1eW$#gd@r_K~k3@shnTnlKrcREo_Ljwmw_v1GbXoItP@bkh{`EB7_^J(Dcv>T=ziMu(l- z(uc^u^$4`>vR*4l3l(xtB&d46h3~5LO5mdT1izID^ndD_%$GdW1g`(j`@?aU0D%_% sAb?Ki6}n*HhQKbE)oQ^W-uLjf1^XC3fWvCvujV7z!PP=U8%GDsFSQ-RwEzGB literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/recipe/IFluidRecipeManager.java b/src/api/java/ic2/api/recipe/IFluidRecipeManager.java new file mode 100644 index 000000000..7cc662429 --- /dev/null +++ b/src/api/java/ic2/api/recipe/IFluidRecipeManager.java @@ -0,0 +1,60 @@ +package ic2.api.recipe; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import net.minecraftforge.fluids.FluidStack; + + +/** + * Recipe manager interface for machines that will probably never be added. + * + * @author estebes, Player + */ +public interface IFluidRecipeManager { + /** + * Adds a recipe to the machine. + * + * @param input Fluid input + * @param output Output fluid + */ + public boolean addRecipe(IRecipeInput input, NBTTagCompound metadata, boolean replace, FluidStack... output); + + /** + * Gets the recipe output for the given input. + * + * @param input Fluid input + * @param adjustInput modify the input according to the recipe's requirements + * @return Recipe output, or null if none, output fluid in nbt + */ + public RecipeOutputFluid getOutputFor(ItemStack input, boolean adjustInput); + + /** + * Get all registered recipes (optional operation). + * + * The method is only available if {@link #isIterable()} is true. + * You're a mad evil scientist if you ever modify this. + * + * @return Iterable of all recipes registered to the manager. + * @throws UnsupportedOperationException if {@link #isIterable()} is false. + */ + public Iterable getRecipes(); + + /** + * Determine whether the recipes can be iterated. + * + * @return true if {@link #getRecipes()} is implemented, false otherwise. + */ + public boolean isIterable(); + + + public static class RecipeIoContainerFluid { + public RecipeIoContainerFluid(IRecipeInput input, RecipeOutputFluid output) { + this.input = input; + this.output = output; + } + + public final IRecipeInput input; + public final RecipeOutputFluid output; + } +} diff --git a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager$HeatExchangeProperty.class b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager$HeatExchangeProperty.class new file mode 100644 index 0000000000000000000000000000000000000000..374f186d785a9e3516199196502d61ff5e2037d5 GIT binary patch literal 662 zcmbtR+e*Vg5Ivh#V{5e5``ro(HG%e z3uL(I@l<+BgfbPLAIKZ>{=He9@R&D+TKNusG1Bdd7fGfyNP9`A6g)2(mClag>OFMT$$*UcoR?4--=PXhVrA%qsO{Snp(n UEc(VMvoKE5AW0fNrZIxTI~DAtp8x;= literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.class b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.class new file mode 100644 index 0000000000000000000000000000000000000000..b58008d8650846a8c4786adf82e17273370d996c GIT binary patch literal 780 zcmbtS!A`M&fT*A-@uZ0+f(JL@iqROANK&Fn6Ypy~txM{*Zns8%&4VA{M;V6# z5vB3sVRkk%vor6#*^ke+cL3-@%Ysb{nigzXu+5-(jlx{LxDP@Fc&norwRvSw8z_bP zA{0r234^lmyndKUk3qX_kHoX!AwA%Z(NYDy#mJy@$DkFU$#3tqZH0zEN`Y8U%5BnEqbD0V#FA%mm*w)1k%G-go$-uun{h>$Ya&wu{|7K5|=s=O(=n=CP4 vP#{~PA6zUlu%JvA+80zazXCPNu2QxDYZPCHdUkJQ=LVF>SE-^%whWao{v+}V literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java new file mode 100644 index 000000000..68decbb39 --- /dev/null +++ b/src/api/java/ic2/api/recipe/ILiquidHeatExchangerManager.java @@ -0,0 +1,39 @@ +package ic2.api.recipe; + +import java.util.Map; + +import net.minecraftforge.fluids.Fluid; + +public interface ILiquidHeatExchangerManager extends ILiquidAcceptManager { + + /** + * Add a new fluid heatup/cooldown recipe. + * + * @param fluidName the fluid to heat up/cool down + * @param fluidOutput the fluid the above fluid turns into + * @param huPerMB the Thermal Energy difference in hU for the conversion of one mB fluid + */ + void addFluid(String fluidName, String fluidOutput, int huPerMB); + + HeatExchangeProperty getHeatExchangeProperty(Fluid fluid); + + Map getHeatExchangeProperties(); + + /** + * This returns an ILiquidAcceptManager that only accepts fluids, that can be heated up / cooled down, but not both. + * You can basically use this to check if the liquid resulting from this conversion can be reprocessed into the first one. + * @return Returns the SingleDirectionManager. + */ + ILiquidAcceptManager getSingleDirectionLiquidManager(); + + public static class HeatExchangeProperty { + public HeatExchangeProperty(Fluid outputFluid, int huPerMB) { + this.outputFluid = outputFluid; + this.huPerMB = huPerMB; + } + + public final Fluid outputFluid; + public final int huPerMB; + } + +} diff --git a/src/api/java/ic2/api/recipe/IMachineRecipeManager$RecipeIoContainer.class b/src/api/java/ic2/api/recipe/IMachineRecipeManager$RecipeIoContainer.class new file mode 100644 index 0000000000000000000000000000000000000000..0d21f7ada7da7ed302520a22dd3cdb47e7409824 GIT binary patch literal 670 zcma)4O;5r=5Pe%dDp)PxH%g)j2Sj5N4#o(0Au(wJlBgl^xYP|SsVyn3|H}h0@!${e zM;T`e7m*mc>CEoToA;(W{rdj+1W-dMixhS;NMcu+Jsk%+iVP{~jiZpE)Rs=o;$vwA z!jWTP+4r%xRl3fQ_M>n)aE9x~X$5RZPlh)P&C0)&i^*R!r#*&b%YPOOW?OpVE_&&U z;F0%TiWJ(u!`&Vaq&m-o$#5tq4EcH2e#`elPL%p3%x;ovcBpCqg91o7H!)>e&=p^?ZuN z8-+A%kS!1qa80&O$|l X_`z%eFe%8u3Z%J!Dwu(og@F?Qm=Z^C delta 169 zcmeyx@|;=z)W2Q(7#J9g82H&4c-a~F7#TPdQ&NIblQRoa85t5Mx;ijMPuwNPq!~7G zdAyOJhNe$eVp*boX-Q^|zHefIHBfzUW_n&?Nof&Ky)U}F%|ti3iMM5#?5rpEGp3la vF)}bRFahmjU|?oxWMF1sVPIfkWME}r1Jmpb96)(apez#u7m&pbX7K<3H3cK; diff --git a/src/api/java/ic2/api/recipe/IMachineRecipeManager.java b/src/api/java/ic2/api/recipe/IMachineRecipeManager.java index d2d4382b7..efa62cc88 100644 --- a/src/api/java/ic2/api/recipe/IMachineRecipeManager.java +++ b/src/api/java/ic2/api/recipe/IMachineRecipeManager.java @@ -1,28 +1,30 @@ package ic2.api.recipe; -import java.util.Map; - import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; /** * Recipe manager interface for basic machines. * - * @author RichardG, Player + * @author Player, RichardG */ -public interface IMachineRecipeManager { // TODO: merge with IMachineRecipeManagerExt +public interface IMachineRecipeManager { /** * Adds a recipe to the machine. * + * Meta data format: + * - thermal centrifuge: {"minHeat": 1-xxx} + * - ore washing plant: {"amount": 1-8000} + * + * @note Replace is only as reliable as IRecipeInput.getInputs(). + * * @param input Recipe input - * @param metadata meta data for additional recipe properties, may be null - * @param outputs Recipe outputs, zero or more depending on the machine - * - * For the thermal centrifuge @param metadata meta data {"minHeat": 1-xxx} - * For the ore washing plant @param metadata meta data {"amount": 1-8000} - * + * @param metadata Meta data for additional recipe properties, may be null. + * @param replace Replace conflicting existing recipes, not recommended, may be ignored. + * @param outputs Recipe outputs, zero or more depending on the machine. + * @return true on success, false otherwise, e.g. on conflicts. */ - public void addRecipe(IRecipeInput input, NBTTagCompound metadata, ItemStack... outputs); + public boolean addRecipe(IRecipeInput input, NBTTagCompound metadata, boolean replace, ItemStack... outputs); /** * Gets the recipe output for the given input. @@ -34,11 +36,31 @@ public interface IMachineRecipeManager { // TODO: merge with IMachineRecipeManag public RecipeOutput getOutputFor(ItemStack input, boolean adjustInput); /** - * Gets a list of recipes. + * Get all registered recipes (optional operation). * + * The method is only available if {@link #isIterable()} is true. * You're a mad evil scientist if you ever modify this. * - * @return List of recipes + * @return Iterable of all recipes registered to the manager. + * @throws UnsupportedOperationException if {@link #isIterable()} is false. */ - public Map getRecipes(); // TODO: Change to iterable/collection/list + public Iterable getRecipes(); + + /** + * Determine whether the recipes can be iterated. + * + * @return true if {@link #getRecipes()} is implemented, false otherwise. + */ + public boolean isIterable(); + + + public static class RecipeIoContainer { + public RecipeIoContainer(IRecipeInput input, RecipeOutput output) { + this.input = input; + this.output = output; + } + + public final IRecipeInput input; + public final RecipeOutput output; + } } diff --git a/src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.class b/src/api/java/ic2/api/recipe/IMachineRecipeManagerExt.class deleted file mode 100644 index b6f9bac0ef076f74fcbd24b659b145555737404b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 309 zcma)2&1%9x5dOwmQ}xmp=uN0z9PpZ3OND?xpq}(J*{pG`*@Unuz4}@n`T#zZxHdPT z(8GKTGvCiJ=ga8_zzE#{PXXEiI)t_)$wDhrXhPhd7&T%k441znj_Orpi^_!)s~u;? zYE{bCv5g(i-c~C~-}9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3 zBQY_{h&El}>}pezNMjPsPC|cOVWSwX8Mje{12zsKA~9iO5>pbRHXdQxd1(~pJ;oDN z5wnp%lmIqnFzaj^O~rF~YGV%11jGx8c^eDp;bk+dASUjZf zY(T8?qM?-5auY##kxf7l(k(S96@Df?1c@sCCkWk$u7lst_f-N#&{$BSD;1e(1m9m#7JJs7-5elvW9M zj9$>2WHc00M_M%{FG!#$>~uwjLa?Wfu&Vnzy@$SY3vze^-ri04oVQj%(%Ro47%wu{ z;Qs(y!_X^3Ebo1dzh{fV$<J~08Wcv4anLf>PjDbXg;F3};lY2`0cbTX^q zEbI8G(y9#y7-1gqEo5=SKscB}w$dtvP&k}E>nY^$6wakdA&=X&u&b0^X%*}LQ!$e+G^4{RQA8gr5Ka diff --git a/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java b/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java index ae9d1dccd..cc832e61a 100644 --- a/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java +++ b/src/api/java/ic2/api/recipe/RecipeInputFluidContainer.java @@ -1,5 +1,7 @@ package ic2.api.recipe; +import ic2.api.item.IC2Items; + import java.util.ArrayList; import java.util.List; @@ -8,6 +10,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; public class RecipeInputFluidContainer implements IRecipeInput { public RecipeInputFluidContainer(Fluid fluid) { @@ -22,9 +25,15 @@ public class RecipeInputFluidContainer implements IRecipeInput { @Override public boolean matches(ItemStack subject) { FluidStack fs = FluidContainerRegistry.getFluidForFilledItem(subject); - if (fs == null) return false; - return fs.getFluid() == fluid; + if (fs == null && subject.getItem() instanceof IFluidContainerItem) { + IFluidContainerItem item = (IFluidContainerItem)subject.getItem(); + fs = item.getFluid(subject); + } + + // match amount precisely to avoid having to deal with leftover + return fs == null && fluid == null || + fs != null && fs.getFluid() == fluid && fs.amount >= amount; } @Override @@ -39,6 +48,7 @@ public class RecipeInputFluidContainer implements IRecipeInput { for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) { if (data.fluid.getFluid() == fluid) ret.add(data.filledContainer); } + ret.add(IC2Items.getItem("fluid_cell", fluid.getName())); return ret; } diff --git a/src/api/java/ic2/api/recipe/RecipeInputItemStack.class b/src/api/java/ic2/api/recipe/RecipeInputItemStack.class index 2f3a70ba1080ccc3cf81142071efb886c7a76090..c956c06d806850cd7a158f991904f3b9dc6963c7 100644 GIT binary patch delta 790 zcmZ9JOHUI~6o9|mX_+z^T3V!nyjts{w8$tvK}1BVqDWOlt*A+Z#dKjYwJu0Zx^%;a z%-Vloq6SioiT(ipiW@gB+^FYHMHIyhsIVBBIa z6PB1~O(w&fvj{Pz?epytp4Q@mHfKyOn#@|{xny$LBFaRVD_YNKaW%{}t>;ayn=F_V z6roD>*^9bjaK2iuJ5M)X{s>BJc57WJ6~95h%>W0rxM_2XMRy~R&ku0hW{EpCz3j8; z(^+>JRb)IyrCMI8l~(JkYqck3XRTI#Tv@3*g<5%5bY-nts;w*fH{bS$P43wgx$i~| zC$`K3n`Is<)RfI}PHYtnS2Ysyc|{KaV!EB|CZ;=zZWI3igCd8-n!%79u(G+_Hfo2! zd$9r}wa<&#=#{3#PP8)FPg*P;KOkgjtUv4XUJ1_tw-m~%q`ML7o70s^?USlMm1)0H z`wq!e0S-&N6ZMO343mt>uo90VOU@@hcfW-u8%goD=IW7?^zNF=`Ac^g@#fOZHjH6o zTF-cdQJ>_9*7Q(z8|#fcTHn=+K^Bt|X}1!5q{88-WDT(Z;{?56H28^*q9Kg-#ScW@ z{l`h~;zWJUF)wFK%H>WXhurUNsikOfht7DcNj%r2E51h_O}hW_BHr>cgc+tw7NX~C Tonpl2hGm^6{ZpLsdYt|ZA@5lo delta 725 zcmZ9J+foxj5Qe|mO|qMfdpL78V!h1RPZdKMtuXT^aZrI^pcCc_6@v{ zf(jN@`T)L)@1SD|)Va-0`^Uac}EQU6(dpxx~<9V{+#2hbtNgTJ81@W*28mJcmh*r5Q_^ zAtLd|G9^d&P;BNR*MrME$3-nOAD;xOC-kLh{3y zU$R%%W7=cJNW?HpD<{8A8l~=r_N5abQ$=F4p5njcn0DHe@=Ca~?vnO5$9ztS<<#n8 zYlq;IT(VI!WFtk|OpqfDCy7O+%j&RNNR!pVS8U%EMtSWEL!b9?n*VXCIpF-jl4-crd2h{5$av5;oAFq-wZU$c#F(Rvogp!Rsmvent{ki-b&Zlo& F_zguCK@$J~ diff --git a/src/api/java/ic2/api/recipe/RecipeInputItemStack.java b/src/api/java/ic2/api/recipe/RecipeInputItemStack.java index f00951381..84f86ea12 100644 --- a/src/api/java/ic2/api/recipe/RecipeInputItemStack.java +++ b/src/api/java/ic2/api/recipe/RecipeInputItemStack.java @@ -4,6 +4,7 @@ import java.util.Arrays; import java.util.List; import net.minecraft.item.ItemStack; + import net.minecraftforge.oredict.OreDictionary; public class RecipeInputItemStack implements IRecipeInput { diff --git a/src/api/java/ic2/api/recipe/RecipeInputOreDict.class b/src/api/java/ic2/api/recipe/RecipeInputOreDict.class index 5db8622125d90e8bfb608208ff7cd540a1930ccc..e7a3a2db3cfc7badd8fbb01a8379c1086ccb069d 100644 GIT binary patch delta 1480 zcmaKs+gDUo9LGQV%nWB-42dBiSTMo_UBEy>OA8ttNy;bJs($Y@v#DZ#n0ccQ8*wB|%d=q?jQw1g=Z${BbbHa}Iu;`$UeXjbFKb>o zcQ$0Xm#o?Hqn>L@b4>H9yDjj0e}*oH3|owN&7ql14mWa>Lkq1A4>9cUI&V0IlRp~?s%}F>|KZV$ho7sO(oo)bYh*u`{Yc?Qw}a4Xg+lKh>sO1H>OkW zufasyX+Ci{&8G^rAYY%ugX|Tf-+0eBq}goxf9CKxUwjh_4O*(n9ac&AjE)wwQ*-k@ z3VX-U?vc^4?7*H8MN4*~Fq4@q6eg$h88K%Hv!bS_^Aq!#fti`Z^9K%2=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xfTa~VY!BJ8x$$&8jc6Q=yt)R@LFnX<@I7uj{m zneZbk=X31;fm)6d4FzL=}l5M=ipKzwh@jkWZ0Pw*4&i()Jj6 z3I783M(SUW1b>-0as<*Z;<+ox=HstG`gjM z&^d0NL6+kk;rfgsg`BD9zuu-&y(EVuG^_F&`Wm5GutZ@wi%5{o6*S&QgN6J51zIiS At^fc4 diff --git a/src/api/java/ic2/api/recipe/RecipeInputOreDict.java b/src/api/java/ic2/api/recipe/RecipeInputOreDict.java index e90676328..e6e4695d0 100644 --- a/src/api/java/ic2/api/recipe/RecipeInputOreDict.java +++ b/src/api/java/ic2/api/recipe/RecipeInputOreDict.java @@ -6,6 +6,7 @@ import java.util.List; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.oredict.OreDictionary; public class RecipeInputOreDict implements IRecipeInput { diff --git a/src/api/java/ic2/api/recipe/RecipeOutput.class b/src/api/java/ic2/api/recipe/RecipeOutput.class index 0dad69cfc545470a67433fd9edb423d9d9ddcc4e..a2a19b3b1e48f991a41b45bf1420cb23daf47b72 100644 GIT binary patch delta 123 zcmZ1?vRq^X9|vR3WPT1aM)}EZ9OdR_47>~s3=$0N43Z2y4AKm)3^EMf46+QN3~~$! z3o2o!Jw3NSIa0{}d^6#4)F delta 120 zcmZ23vP5J99|vQ`WPT1aM#0H$9OcGF3_J`B3=$0N43a>WG=n#T978CBJVOG5B118Q z5GD8=GD#J7eHHMiC8Vs`;bS8h{s9@p!%b+y5fHQ*8aPmn`d2Uk%MxZea3_`*T UlRt54@bWq^0!7?_B1{bK01#OeoB#j- diff --git a/src/api/java/ic2/api/recipe/RecipeOutput.java b/src/api/java/ic2/api/recipe/RecipeOutput.java index 34c7fe9c3..80ad5fb5c 100644 --- a/src/api/java/ic2/api/recipe/RecipeOutput.java +++ b/src/api/java/ic2/api/recipe/RecipeOutput.java @@ -25,8 +25,7 @@ public final class RecipeOutput { RecipeOutput ro = (RecipeOutput) obj; if (items.size() == ro.items.size() && - (metadata == null && ro.metadata == null || metadata != null && ro.metadata != null) && - metadata.equals(ro.metadata)) { + (metadata == null && ro.metadata == null || metadata != null && ro.metadata != null && metadata.equals(ro.metadata))) { Iterator itA = items.iterator(); Iterator itB = ro.items.iterator(); diff --git a/src/api/java/ic2/api/recipe/RecipeOutputFluid.class b/src/api/java/ic2/api/recipe/RecipeOutputFluid.class new file mode 100644 index 0000000000000000000000000000000000000000..ef597f4dd7b051f60e1d38b0fe8bcd4035dfa22a GIT binary patch literal 2632 zcmb7G-E$LF96dMLX4CCLOZqKf0SlyQVU;hD)=FEbR6^0VpnxdbWZP~@cf;-mff$7Od`!wF1kj83X}U(WeJ!xW}vG}DArI4vI^s`yAl3(lxG zt09H)B+kkA$MSJLiBFRFRE8Hcn3z?O6Hwh!P%H($KudPfylfh!z%CeB+Ybf>8mH}f z#|%oIC2;Vm;i0T!1;&!?SUJy}3+7yJ-ZJJ2B|GmM}f(4t*Y|GlYJ%(Ad4bRHi zMa!59UnfK6!o3o7M}2{-#Y&NNArU9cVpx>wsmQC~lIQ>b9@b2{+-r6X_0QGQ_#zc$ zxt(jAOO>okC9^={+S8E+1=E=~PR=e`xnQtQ%IHgPj0o&l+wzr+QGvJ}Ft4pf+lj#P z%)s@i0S7rH=D7^r*+r>p=;_+^1%{rJyk=rm%+b(+I~{noGfyPxzM3_nUTOKET%l~$ zcv`ZjO}iy8XN}v^Y#q-SXt%_vqZea3w&6AUL&rS!33OFAFj6@bM?KH=bZo&^9h_=xA3SJ{;?eR|=xzj}90>Mr>Qr8RLCMEf{%&pL z4_zD^q+ucODqAu1uuT^OEnU*}>}%i{UCgl^Y<|i0FnXMKsnBo$xEZBxLd$&X-(T5CMEFMA-VI;xD z(9c*W5IMGqAY&L{oPv15W?aQC6}wd!?2ESXI=&$2H<%$oXIWo@)-wGAzaV)JjS^QZ z#HH~KbfOVmHCVJ&EZQm-jZ5v}Y#|S6R9O_*R+)dR{|{)(_`3fgv=f=1q25Q6z(6JV z4xh6#@h3EPB_5$iwjN<2YMHVn!xiYun2yrd2~0-$j1DQg?qj_m$9ub#a@5DJW`T!j zIn*FK%W+K&U2@&@zYWRzg;I1b`15_|!JIK)Wd*q4kmA+@(w zsl0_DyiMYym>nF8GKW_)hnXp5?L^{l7!-BmKWJ0&4*&MY{$iq#msG?&|I?C60OQ>N^>WpIY(2?q5yn^oUIX6-~5$5d+Hx+p*U51#%D8|b5rNZ*FA*HS0 fm77qN+fd>^Ay&0cRA_yOxdAc#utazyT<7S2vq5|I literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/recipe/RecipeOutputFluid.java b/src/api/java/ic2/api/recipe/RecipeOutputFluid.java new file mode 100644 index 000000000..750492245 --- /dev/null +++ b/src/api/java/ic2/api/recipe/RecipeOutputFluid.java @@ -0,0 +1,57 @@ +package ic2.api.recipe; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.nbt.NBTTagCompound; + +import net.minecraftforge.fluids.FluidStack; + +/** + * @author estebes + */ +public class RecipeOutputFluid { + public RecipeOutputFluid(NBTTagCompound metadata, List outputs) { + assert !outputs.contains(null); + + this.metadata = metadata; + this.outputs = outputs; + } + + public RecipeOutputFluid(NBTTagCompound metadata, FluidStack... outputs) { + this(metadata, Arrays.asList(outputs)); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof RecipeOutputFluid) { + RecipeOutputFluid ro = (RecipeOutputFluid) obj; + + if (outputs.size() == ro.outputs.size() && + (metadata == null && ro.metadata == null || metadata != null && ro.metadata != null && metadata.equals(ro.metadata))) { + Iterator itA = outputs.iterator(); + Iterator itB = ro.outputs.iterator(); + + while (itA.hasNext() && itB.hasNext()) { + FluidStack stackA = itA.next(); + FluidStack stackB = itB.next(); + + if (stackA.isFluidStackIdentical(stackB)) return false; + } + + return true; + } + } + + return false; + } + + @Override + public String toString() { + return "ROutput<"+outputs+","+metadata+">"; + } + + public final List outputs; + public final NBTTagCompound metadata; +} diff --git a/src/api/java/ic2/api/recipe/Recipes.class b/src/api/java/ic2/api/recipe/Recipes.class index 559ffe86538a8a6271ee6f9efd10918472acd264..135ea928e31771e05c108c0fbee9f863ad0498bf 100644 GIT binary patch delta 393 zcmX@a(ZD5t>ff$?3=9lL3`SfG%nbVM3Ym$88mz{la2Hf3o`YKQj;?aQuRIEV3M1I7^N5)(tJa20W0)KO)PP(NX|&i11f{6wq|4yh8P2q zEiHfwPhQMa%dEzrK3SRBlu=@GBy(&%E6`7z41x?oU|N_#1Wb!Eh=FNw28g@_gCv+Q z#UKr)WuUYygB+MI&!7ON6&aMkv@(MVm{tYTj0}tnKwE*N22fNVNHYRyR;}#}jJg|v gEG7m`Ajt+6aG;>ff$?3=9lL3_4s4%nX|B3|j0A+KddGxrxb>tC^%G8cR$Jw_!@mn>h9Q z=EaO$jEruR*D+a4c4n?-R$x$^e303cQDpLW=Gb~cpedXTLJY!ST7-cWOp7vzfoX9D z2{0`QrKK38!F(A8SuicfAP=M&fe>gakW>Ql^uc@v23D=@42&Cr0!$3bK#~n846;fE YNb-Q$tPH9QylOx$BZE4SWMa?&09sKRu>b%7 diff --git a/src/api/java/ic2/api/recipe/Recipes.java b/src/api/java/ic2/api/recipe/Recipes.java index 4c1259768..50fc6e6fb 100644 --- a/src/api/java/ic2/api/recipe/Recipes.java +++ b/src/api/java/ic2/api/recipe/Recipes.java @@ -3,16 +3,17 @@ package ic2.api.recipe; /** * General recipe registry. - * + * * @author Richard */ public class Recipes { + public static IMachineRecipeManager furnace; public static IMachineRecipeManager macerator; public static IMachineRecipeManager extractor; public static IMachineRecipeManager compressor; public static IMachineRecipeManager centrifuge; public static IMachineRecipeManager blockcutter; - public static IMachineRecipeManager blastfurance; + public static IMachineRecipeManager blastfurnace; public static IMachineRecipeManager recycler; public static IMachineRecipeManager metalformerExtruding; public static IMachineRecipeManager metalformerCutting; @@ -20,15 +21,16 @@ public class Recipes { public static IMachineRecipeManager oreWashing; public static ICannerBottleRecipeManager cannerBottle; public static ICannerEnrichRecipeManager cannerEnrich; + public static IFermenterRecipeManager fermenter; /** * Reference amplifier values: - * + * * 5000: Scrap * 45000: Scrapbox - * + * * As Parameter for the Amplification Value you have to use the NBTTagCompound - * + * * NBTTagCompound nbt = new NBTTagCompound(); * nbt.setInteger("amplification", aValue); * matterAmplifier.addRecipe(yourStack, nbt); @@ -56,5 +58,13 @@ public class Recipes { public static ICraftingRecipeManager advRecipes; public static ISemiFluidFuelManager semiFluidGenerator; - public static IFluidHeatManager FluidHeatGenerator; + public static IFluidHeatManager fluidHeatGenerator; + /** + * Used by the Liquid Heat Exchanger to cool down liquids and determine the amount of hu generated for every mb. + */ + public static ILiquidHeatExchangerManager liquidCooldownManager; + /** + * Opposite of {@link #liquidCooldownManager}. This is for Liquids that can be heated up again. + */ + public static ILiquidHeatExchangerManager liquidHeatupManager; } diff --git a/src/api/java/ic2/api/recipe/package-info.class b/src/api/java/ic2/api/recipe/package-info.class index f30b57f7835efb0abaa8c2e321d7b984c8fdc422..8a795bbdbf93a92b80fcc22365fa73560bb3a2aa 100644 GIT binary patch delta 30 lcmZo*>SCJUFQV*|ms+Bqo0*rIT$Gqrl9peTo;opdIRKqS3q$|_ delta 20 bcmeBTYG9h+&n4-TTu`o`o1aoVF?l%vLE{G` diff --git a/src/api/java/ic2/api/tile/ExplosionWhitelist.class b/src/api/java/ic2/api/tile/ExplosionWhitelist.class index 0fbd082df4f40a62a349f58a919581382c2e2a9a..a55a2c524614549d9ec786bcf12b7aeaf4344c05 100644 GIT binary patch delta 520 zcmZvX%TB^z5QWcQ1Er;)sHi9^pduHcg2oMr8xy06u3Winu!$H1BUR#xchDzr?*?7q zCE)>l1br9d`5R)paC7F8Z_dnotHaRF=g<2PKowg$bfh$BNQaTZij-9;Ybvrjf=KCD zM@~gvMWJ7L6uaY?Fc5~JqG(_PB?DzCCQ1T{3+vW0Z=6QcJUp{oPQ$r7usY|*)|HA) z0~J*7m2OWU?s0qVX49@ajdrUe5NX-n6WiIpZeManAeB4vNOo#@Urn$^ON|czg36;9 zBdioe5n#?+sWEm;M!^^;44C#^W|A6oyD>~Lm(wILjX0x*8O*X1d-zh4Mak;)1?CtN zK0eG&!sX{je0nU|^Y}FR%)k5slG2~E+jN$@^=BxBHv|+su~Oh&SoAsQqm3af{{5GA cZv&zq2%Zj*QC|^yfg&FjKASSDCD(fS7aOQS3IG5A delta 421 zcmZvY%`O9B6o#LfX8s2)N-?xmzf(1-h=nV#x3Zjw1hG>r#WnN_>}|@TLDCCw3+_d{ zGi|gBoA>NTeT-g?l%#gvEHbM+90JTSugas$f;z?SaUp7EtS?(wRIE(!fjX6(UmEdG zh3Ik2*TmQV<(FB>{55+h=WIFu6*GRvGI>#DGTtzraPUVjx whitelist = new HashSet(); + private static Set whitelist = Collections.newSetFromMap(new IdentityHashMap()); } diff --git a/src/api/java/ic2/api/tile/IEnergyStorage.class b/src/api/java/ic2/api/tile/IEnergyStorage.class index e03e23fce274df43d8d939027126be830357e617..60375238491bcf122581a59c1a95c390b50117d5 100644 GIT binary patch delta 42 ycmeyy^o(i3LIouapS;u({oKsF)a0VXv=aT&lFS@^*SykPx5VVky!43|mjVD^d=U2l delta 58 zcmaFH^o?o4LIWcWpS;u({oKsF)a0VXw34*^qV!b#IQ# LNoIcD#Dhx#qo@~& diff --git a/src/api/java/ic2/api/tile/IRotorProvider.class b/src/api/java/ic2/api/tile/IRotorProvider.class new file mode 100644 index 0000000000000000000000000000000000000000..c772aea744d0218554822cb77f0c7374333ebbf9 GIT binary patch literal 310 zcmZvY&q@O^5Ql$L*KS+?f_U=e$@XHPS5Ja26bj1f3&c1sQ+5-H+2XT#@Bw@%=``X& z@G>)GK0bbvukVjf0COCbI4E&QIBq!AA%%D&w&TQ+urr-42xDDT)`@Qj=hNBJb26QH zcG12h(@J literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/tile/IRotorProvider.java b/src/api/java/ic2/api/tile/IRotorProvider.java new file mode 100644 index 000000000..0a3597e1e --- /dev/null +++ b/src/api/java/ic2/api/tile/IRotorProvider.java @@ -0,0 +1,33 @@ +package ic2.api.tile; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.ResourceLocation; + +import ic2.api.item.IKineticRotor; + +/** + * Interface for {@link TileEntity}s that can have rotors, see also {@link IKineticRotor}
+ * Use the {@link RotorRegistry} to use IC2's default windmill renderer + */ +public interface IRotorProvider { + /** + * @return Radius of current rotor (in blocks), or 0 for no rotor + */ + public int getRotorDiameter(); + + /** + * @return The current direction the rotor is facing + */ + public EnumFacing getFacing(); + + /** + * @return Angle (in degrees) to render the rotor at + */ + public float getAngle(); + + /** + * @return Texture of the current rotor, called every tick so remember to store in a variable + */ + public ResourceLocation getRotorRenderTexture(); +} \ No newline at end of file diff --git a/src/api/java/ic2/api/tile/IWrenchable.class b/src/api/java/ic2/api/tile/IWrenchable.class index 3bc6fff8c266ae7b1f199a5fe5b732bc70753e97..c3628ae7c68e3159bf7501d5269cb4e2447dae8c 100644 GIT binary patch literal 1007 zcmds0!A=4(5S=25paS0f1i3f~*EJqgNH!snhzW@YlTyc}u-hfOT?n7xFM06j!4L5> zjI+f=voUgzlb7~2^U^o-Ui@hUtNT3`OTWY(|0cFZt57CmwO!&YluJsm z<4%2d@LIP58jFOC8ed3rO;J220h5h(w?@9s84O(qmq|QJ1-xujeUt};sg;({cWDiB zTuhV$rO!rh7_Lkzl75-QZ}lc}F44V=o=$BZ_&^6n+ALv9-~Po=r-hfLEk)?_!k((B zcg924262`s>avLfn*J(TIST0{_ea2yR&A6sjk)9atTS}5|cCY(is`_G$y{( zvh&o8Vr1Y getWrenchDrops(World world, BlockPos pos, IBlockState state, TileEntity te, EntityPlayer player, int fortune); } diff --git a/src/api/java/ic2/api/tile/RotorRegistry$IRotorRegistry.class b/src/api/java/ic2/api/tile/RotorRegistry$IRotorRegistry.class new file mode 100644 index 0000000000000000000000000000000000000000..4b25b38aa6f1845f29aa75b700d96fc402ce8429 GIT binary patch literal 389 zcmZ`#O-sW-5Pef?Vq>i$dhzVRU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8M-SGJ)Kt z$Zt|yOQ}4FiPzKWIE4HLePbz=JTm`a*+Df=fof!&K^?1f7Rlfat+xc$sD=xqD$sR~ J(wU#h{|9+?xKRKA literal 0 HcmV?d00001 diff --git a/src/api/java/ic2/api/tile/RotorRegistry.java b/src/api/java/ic2/api/tile/RotorRegistry.java new file mode 100644 index 000000000..dd652f2cc --- /dev/null +++ b/src/api/java/ic2/api/tile/RotorRegistry.java @@ -0,0 +1,43 @@ +package ic2.api.tile; + +import static net.minecraftforge.fml.relauncher.Side.CLIENT; + +import net.minecraft.tileentity.TileEntity; + +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.ModContainer; +import net.minecraftforge.fml.relauncher.SideOnly; + +/** + * Helper class for registering {@link IRotorProvider}s to provide the default windmill renderer + */ +@SideOnly(CLIENT) +public class RotorRegistry { + /** + * Method to register a tile entity with the default IC2 windmill TESH + * @param clazz {@link TileEntity} that implements {@link IRotorProvider} + * @param Type checking to ensure only {@link IRotorProvider} implementing classes are registered + */ + public static void registerRotorProvider(Class clazz) { + if (INSTANCE != null) INSTANCE.registerRotorProvider(clazz); + } + + /** + * Sets the internal Registry instance. + * ONLY IC2 CAN DO THIS!!!!!!! + */ + public static void setInstance(IRotorRegistry i) { + ModContainer mc = Loader.instance().activeModContainer(); + if (mc == null || !"IC2".equals(mc.getModId())) { + throw new IllegalAccessError("Only IC2 can set the instance"); + } else { + INSTANCE = i; + } + } + + private static IRotorRegistry INSTANCE; + + public static interface IRotorRegistry { + public void registerRotorProvider(Class clazz); + } +} \ No newline at end of file diff --git a/src/api/java/ic2/api/tile/package-info.class b/src/api/java/ic2/api/tile/package-info.class index 226d45541037da6f5eb4672f34e5f1254370a83b..9cd6bac26a2270b1d2724db36d5fe4f661f76cb1 100644 GIT binary patch delta 30 lcmeyz*ugZxUqsm_FSSHJH#09axhOHMBrU%vJ#}K_QUI&63%vjU delta 20 bcmeBR`o}oIpG(pwxu9G>H$SC#V)9Y|N`wcU diff --git a/src/api/java/ic2/api/util/package-info.class b/src/api/java/ic2/api/util/package-info.class index 4c91d9186aca2be1a632a781e1c0fa52adfefd8b..6aa78d24c1b36f8cfd5472f09a6ff8958d92623d 100644 GIT binary patch delta 30 lcmeyz*ugZxUqsm_FSSHJH#09axhOHMBrU%vJ#}K_QUI&63%vjU delta 20 bcmeBR`o}oIpG(pwxu9G>H$SC#V)9Y|N`wcU diff --git a/src/main/java/mekanism/common/integration/IC2ItemManager.java b/src/main/java/mekanism/common/integration/IC2ItemManager.java index 04d2c1539..3dd1e921b 100644 --- a/src/main/java/mekanism/common/integration/IC2ItemManager.java +++ b/src/main/java/mekanism/common/integration/IC2ItemManager.java @@ -24,14 +24,14 @@ public class IC2ItemManager implements IElectricItemManager if(energizedItem.canReceive(itemStack)) { double energyNeeded = energizedItem.getMaxEnergy(itemStack)-energizedItem.getEnergy(itemStack); - double energyToStore = Math.min(Math.min(amount* general.FROM_IC2, energizedItem.getMaxEnergy(itemStack)*0.01), energyNeeded); + double energyToStore = Math.min(Math.min(amount*general.FROM_IC2, energizedItem.getMaxEnergy(itemStack)*0.01), energyNeeded); if(!simulate) { energizedItem.setEnergy(itemStack, energizedItem.getEnergy(itemStack) + energyToStore); } - return (int)Math.round(energyToStore* general.TO_IC2); + return (int)Math.round(energyToStore*general.TO_IC2); } return 0; @@ -42,7 +42,7 @@ public class IC2ItemManager implements IElectricItemManager { if(energizedItem.canSend(itemStack)) { - double energyWanted = amount* general.FROM_IC2; + double energyWanted = amount*general.FROM_IC2; double energyToGive = Math.min(Math.min(energyWanted, energizedItem.getMaxEnergy(itemStack)*0.01), energizedItem.getEnergy(itemStack)); if(!simulate) @@ -50,7 +50,7 @@ public class IC2ItemManager implements IElectricItemManager energizedItem.setEnergy(itemStack, energizedItem.getEnergy(itemStack) - energyToGive); } - return (int)Math.round(energyToGive* general.TO_IC2); + return (int)Math.round(energyToGive*general.TO_IC2); } return 0; @@ -59,13 +59,13 @@ public class IC2ItemManager implements IElectricItemManager @Override public boolean canUse(ItemStack itemStack, double amount) { - return energizedItem.getEnergy(itemStack) >= amount* general.FROM_IC2; + return energizedItem.getEnergy(itemStack) >= amount*general.FROM_IC2; } @Override public double getCharge(ItemStack itemStack) { - return (int)Math.round(energizedItem.getEnergy(itemStack)* general.TO_IC2); + return (int)Math.round(energizedItem.getEnergy(itemStack)*general.TO_IC2); } @Override @@ -85,4 +85,16 @@ public class IC2ItemManager implements IElectricItemManager { return null; } + + @Override + public double getMaxCharge(ItemStack stack) + { + return 0; + } + + @Override + public int getTier(ItemStack stack) + { + return 4; + } } diff --git a/src/main/java/mekanism/common/integration/MekanismHooks.java b/src/main/java/mekanism/common/integration/MekanismHooks.java index 733b36c22..2bbd99ebf 100644 --- a/src/main/java/mekanism/common/integration/MekanismHooks.java +++ b/src/main/java/mekanism/common/integration/MekanismHooks.java @@ -1,13 +1,11 @@ package mekanism.common.integration; -import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.IMachineRecipeManager.RecipeIoContainer; import ic2.api.recipe.RecipeInputItemStack; import ic2.api.recipe.RecipeInputOreDict; -import ic2.api.recipe.RecipeOutput; import ic2.api.recipe.Recipes; import java.util.List; -import java.util.Map; import li.cil.oc.api.Driver; import mekanism.common.Mekanism; @@ -74,11 +72,11 @@ public final class MekanismHooks @Method(modid = "IC2") public void hookIC2Recipes() { - for(Map.Entry entry : Recipes.macerator.getRecipes().entrySet()) + for(RecipeIoContainer entry : Recipes.macerator.getRecipes()) { - if(!entry.getKey().getInputs().isEmpty()) + if(!entry.input.getInputs().isEmpty()) { - List names = MekanismUtils.getOreDictName(entry.getKey().getInputs().get(0)); + List names = MekanismUtils.getOreDictName(entry.input.getInputs().get(0)); for(String name : names) { @@ -86,7 +84,7 @@ public final class MekanismHooks if(name.startsWith("ingot")) { - RecipeHandler.addCrusherRecipe(entry.getKey().getInputs().get(0), entry.getValue().items.get(0)); + RecipeHandler.addCrusherRecipe(entry.input.getInputs().get(0), entry.output.items.get(0)); did = true; } @@ -99,20 +97,20 @@ public final class MekanismHooks } try { - Recipes.macerator.addRecipe(new RecipeInputOreDict("oreOsmium"), null, new ItemStack(MekanismItems.Dust, 2, Resource.OSMIUM.ordinal())); + Recipes.macerator.addRecipe(new RecipeInputOreDict("oreOsmium"), null, false, new ItemStack(MekanismItems.Dust, 2, Resource.OSMIUM.ordinal())); } catch(Exception e) {} try { - Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotOsmium"), null, new ItemStack(MekanismItems.Dust, 1, Resource.OSMIUM.ordinal())); - Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotRefinedObsidian"), null, new ItemStack(MekanismItems.OtherDust, 1, 5)); - Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotRefinedGlowstone"), null, new ItemStack(Items.GLOWSTONE_DUST)); - Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotSteel"), null, new ItemStack(MekanismItems.OtherDust, 1, 1)); + Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotOsmium"), null, false, new ItemStack(MekanismItems.Dust, 1, Resource.OSMIUM.ordinal())); + Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotRefinedObsidian"), null, false, new ItemStack(MekanismItems.OtherDust, 1, 5)); + Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotRefinedGlowstone"), null, false, new ItemStack(Items.GLOWSTONE_DUST)); + Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotSteel"), null, false, new ItemStack(MekanismItems.OtherDust, 1, 1)); } catch(Exception e) {} try { for(Resource resource : Resource.values()) { - Recipes.macerator.addRecipe(new RecipeInputOreDict("clump" + resource.getName()), null, new ItemStack(MekanismItems.DirtyDust, 1, resource.ordinal())); + Recipes.macerator.addRecipe(new RecipeInputOreDict("clump" + resource.getName()), null, false, new ItemStack(MekanismItems.DirtyDust, 1, resource.ordinal())); } } catch(Exception e) {} @@ -120,7 +118,7 @@ public final class MekanismHooks tag.setInteger("amplification", 50000); - Recipes.matterAmplifier.addRecipe(new RecipeInputItemStack(new ItemStack(MekanismItems.EnrichedAlloy), 1), tag); + Recipes.matterAmplifier.addRecipe(new RecipeInputItemStack(new ItemStack(MekanismItems.EnrichedAlloy), 1), tag, false); } @Method(modid = "ComputerCraft") diff --git a/src/main/java/mekanism/common/integration/OreDictManager.java b/src/main/java/mekanism/common/integration/OreDictManager.java index 34a2bb458..a87c8bbfd 100644 --- a/src/main/java/mekanism/common/integration/OreDictManager.java +++ b/src/main/java/mekanism/common/integration/OreDictManager.java @@ -319,7 +319,7 @@ public final class OreDictManager public static void addIC2BronzeRecipe() { try { - Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotBronze"), null, StackUtils.size(OreDictionary.getOres("dustBronze").get(0), 1)); + Recipes.macerator.addRecipe(new RecipeInputOreDict("ingotBronze"), null, false, StackUtils.size(OreDictionary.getOres("dustBronze").get(0), 1)); } catch(Exception e) {} } diff --git a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java index 904b6a8fc..9ac87929a 100644 --- a/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java +++ b/src/main/java/mekanism/common/item/ItemBlockEnergyCube.java @@ -32,7 +32,6 @@ import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -164,34 +163,6 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS itemstack.getTagCompound().setInteger("tier", tier.ordinal()); } - @Override - @Method(modid = "IC2") - public boolean canProvideEnergy(ItemStack itemStack) - { - return true; - } - - @Override - @Method(modid = "IC2") - public double getMaxCharge(ItemStack itemStack) - { - return 0; - } - - @Override - @Method(modid = "IC2") - public int getTier(ItemStack itemStack) - { - return 4; - } - - @Override - @Method(modid = "IC2") - public double getTransferLimit(ItemStack itemStack) - { - return 0; - } - @Override public void setInventory(NBTTagList nbtTags, Object... data) { @@ -326,20 +297,6 @@ public class ItemBlockEnergyCube extends ItemBlock implements IEnergizedItem, IS { return IC2ItemManager.getManager(this); } - - @Override - @Method(modid = "IC2") - public Item getChargedItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public Item getEmptyItem(ItemStack itemStack) - { - return this; - } @Override public String getOwner(ItemStack stack) diff --git a/src/main/java/mekanism/common/item/ItemBlockMachine.java b/src/main/java/mekanism/common/item/ItemBlockMachine.java index b78144d97..620ad2aab 100644 --- a/src/main/java/mekanism/common/item/ItemBlockMachine.java +++ b/src/main/java/mekanism/common/item/ItemBlockMachine.java @@ -50,7 +50,6 @@ import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.SoundEvents; -import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -401,34 +400,6 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec return false; } - @Override - @Method(modid = "IC2") - public boolean canProvideEnergy(ItemStack itemStack) - { - return false; - } - - @Override - @Method(modid = "IC2") - public double getMaxCharge(ItemStack itemStack) - { - return 0; - } - - @Override - @Method(modid = "IC2") - public int getTier(ItemStack itemStack) - { - return 4; - } - - @Override - @Method(modid = "IC2") - public double getTransferLimit(ItemStack itemStack) - { - return 0; - } - public boolean tryPlaceContainedLiquid(World world, ItemStack itemstack, BlockPos pos) { if(getFluidStack(itemstack) == null || !getFluidStack(itemstack).getFluid().canBePlacedInWorld()) @@ -780,20 +751,6 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec { return IC2ItemManager.getManager(this); } - - @Override - @Method(modid = "IC2") - public Item getChargedItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public Item getEmptyItem(ItemStack itemStack) - { - return this; - } @Override public FluidStack getFluid(ItemStack container) diff --git a/src/main/java/mekanism/common/item/ItemEnergized.java b/src/main/java/mekanism/common/item/ItemEnergized.java index 2af154ee7..55dc4f1d2 100644 --- a/src/main/java/mekanism/common/item/ItemEnergized.java +++ b/src/main/java/mekanism/common/item/ItemEnergized.java @@ -71,48 +71,6 @@ public class ItemEnergized extends ItemMekanism implements IEnergizedItem, ISpec list.add(charged); } - @Override - @Method(modid = "IC2") - public boolean canProvideEnergy(ItemStack itemStack) - { - return canSend(itemStack); - } - - @Override - @Method(modid = "IC2") - public Item getChargedItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public Item getEmptyItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public double getMaxCharge(ItemStack itemStack) - { - return 0; - } - - @Override - @Method(modid = "IC2") - public int getTier(ItemStack itemStack) - { - return 4; - } - - @Override - @Method(modid = "IC2") - public double getTransferLimit(ItemStack itemStack) - { - return 0; - } - @Override public double getEnergy(ItemStack itemStack) { diff --git a/src/main/java/mekanism/common/item/ItemFreeRunners.java b/src/main/java/mekanism/common/item/ItemFreeRunners.java index 95f229ad5..c05524a0f 100644 --- a/src/main/java/mekanism/common/item/ItemFreeRunners.java +++ b/src/main/java/mekanism/common/item/ItemFreeRunners.java @@ -93,48 +93,6 @@ public class ItemFreeRunners extends ItemArmor implements IEnergizedItem, ISpeci list.add(charged); } - @Override - @Method(modid = "IC2") - public boolean canProvideEnergy(ItemStack itemStack) - { - return canSend(itemStack); - } - - @Override - @Method(modid = "IC2") - public Item getChargedItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public Item getEmptyItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public double getMaxCharge(ItemStack itemStack) - { - return 0; - } - - @Override - @Method(modid = "IC2") - public int getTier(ItemStack itemStack) - { - return 4; - } - - @Override - @Method(modid = "IC2") - public double getTransferLimit(ItemStack itemStack) - { - return 0; - } - @Override public double getEnergy(ItemStack itemStack) { diff --git a/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java b/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java index dd819e2ad..9dde3f4f1 100644 --- a/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java +++ b/src/main/java/mekanism/common/tile/TileEntityAdvancedBoundingBlock.java @@ -1,5 +1,6 @@ package mekanism.common.tile; +import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergySink; import mekanism.api.Coord4D; import mekanism.api.IConfigCardAccess.ISpecialConfigData; @@ -216,7 +217,7 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp @Override @Method(modid = "IC2") - public boolean acceptsEnergyFrom(TileEntity emitter, EnumFacing direction) + public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing direction) { if(getInv() == null) { diff --git a/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java b/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java index 7acd7ddfc..cc4651328 100644 --- a/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java +++ b/src/main/java/mekanism/common/tile/TileEntityBasicBlock.java @@ -1,6 +1,5 @@ package mekanism.common.tile; -import ic2.api.tile.IWrenchable; import io.netty.buffer.ByteBuf; import java.util.ArrayList; @@ -27,7 +26,6 @@ import mekanism.common.util.MekanismUtils; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; @@ -35,10 +33,9 @@ import net.minecraft.util.ITickable; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Optional.Interface; -import net.minecraftforge.fml.common.Optional.Method; @Interface(iface = "ic2.api.tile.IWrenchable", modid = "IC2") -public abstract class TileEntityBasicBlock extends TileEntity implements IWrenchable, ITileNetwork, IChunkLoadHandler, IFrequencyHandler, ITickable +public abstract class TileEntityBasicBlock extends TileEntity implements ITileNetwork, IChunkLoadHandler, IFrequencyHandler, ITickable { /** The direction this block is facing. */ public EnumFacing facing = EnumFacing.NORTH; @@ -229,21 +226,6 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench return super.getCapability(capability, facing); } - @Override - @Method(modid = "IC2") - public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side) - { - return true; - } - - @Override - @Method(modid = "IC2") - public short getFacing() - { - return (short)facing.ordinal(); - } - - @Override public void setFacing(short direction) { if(canSetFacing(direction)) @@ -269,27 +251,6 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench return true; } - @Override - @Method(modid = "IC2") - public boolean wrenchCanRemove(EntityPlayer entityPlayer) - { - return true; - } - - @Override - @Method(modid = "IC2") - public float getWrenchDropRate() - { - return 1.0F; - } - - @Override - @Method(modid = "IC2") - public ItemStack getWrenchDrop(EntityPlayer entityPlayer) - { - return getBlockType().getPickBlock(worldObj.getBlockState(getPos()), null, worldObj, getPos(), entityPlayer); - } - public boolean isPowered() { return redstone; diff --git a/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java b/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java index 27a1e5780..09d08cf2b 100644 --- a/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java +++ b/src/main/java/mekanism/common/tile/TileEntityElectricBlock.java @@ -3,7 +3,9 @@ package mekanism.common.tile; import ic2.api.energy.EnergyNet; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergyAcceptor; import ic2.api.energy.tile.IEnergyConductor; +import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergyTile; import io.netty.buffer.ByteBuf; @@ -55,13 +57,13 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i { if(!worldObj.isRemote) { - TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos()); + IEnergyTile registered = EnergyNet.instance.getTile(worldObj, getPos()); if(registered != this) { if(registered instanceof IEnergyTile) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered)); + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(registered)); } else if(registered == null) { @@ -77,11 +79,11 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i { if(!worldObj.isRemote) { - TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos()); + IEnergyTile registered = EnergyNet.instance.getTile(worldObj, getPos()); if(registered instanceof IEnergyTile) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered)); + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(registered)); } } } @@ -312,14 +314,14 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i @Override @Method(modid = "IC2") - public boolean acceptsEnergyFrom(TileEntity emitter, EnumFacing direction) + public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing direction) { return getConsumingSides().contains(direction); } @Override @Method(modid = "IC2") - public boolean emitsEnergyTo(TileEntity receiver, EnumFacing direction) + public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) { return getOutputtingSides().contains(direction) && receiver instanceof IEnergyConductor; } diff --git a/src/main/java/mekanism/common/tile/TileEntityInductionPort.java b/src/main/java/mekanism/common/tile/TileEntityInductionPort.java index fbeb0aae1..ae673d574 100644 --- a/src/main/java/mekanism/common/tile/TileEntityInductionPort.java +++ b/src/main/java/mekanism/common/tile/TileEntityInductionPort.java @@ -3,7 +3,9 @@ package mekanism.common.tile; import ic2.api.energy.EnergyNet; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergyAcceptor; import ic2.api.energy.tile.IEnergyConductor; +import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergyTile; import io.netty.buffer.ByteBuf; @@ -112,13 +114,13 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement { if(!worldObj.isRemote) { - TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos()); + IEnergyTile registered = EnergyNet.instance.getTile(worldObj, getPos()); if(registered != this) { if(registered instanceof IEnergyTile) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered)); + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(registered)); } else if(registered == null) { @@ -134,11 +136,11 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement { if(!worldObj.isRemote) { - TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos()); + IEnergyTile registered = EnergyNet.instance.getTile(worldObj, getPos()); if(registered instanceof IEnergyTile) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered)); + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(registered)); } } } @@ -334,14 +336,14 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement @Override @Method(modid = "IC2") - public boolean acceptsEnergyFrom(TileEntity emitter, EnumFacing direction) + public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing direction) { return getConsumingSides().contains(direction); } @Override @Method(modid = "IC2") - public boolean emitsEnergyTo(TileEntity receiver, EnumFacing direction) + public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) { return getOutputtingSides().contains(direction) && receiver instanceof IEnergyConductor; } diff --git a/src/main/java/mekanism/common/tile/TileEntityPersonalChest.java b/src/main/java/mekanism/common/tile/TileEntityPersonalChest.java index c3e92dc9f..91bc2d5c3 100644 --- a/src/main/java/mekanism/common/tile/TileEntityPersonalChest.java +++ b/src/main/java/mekanism/common/tile/TileEntityPersonalChest.java @@ -4,7 +4,6 @@ import mekanism.common.security.ISecurityTile; import mekanism.common.tile.component.TileComponentSecurity; import mekanism.common.util.InventoryUtils; import mekanism.common.util.SecurityUtils; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; @@ -105,12 +104,6 @@ public class TileEntityPersonalChest extends TileEntityContainerBlock implements return true; } - @Override - public boolean wrenchCanRemove(EntityPlayer entityPlayer) - { - return SecurityUtils.canAccess(entityPlayer, this); - } - @Override public boolean canSetFacing(int side) { diff --git a/src/main/java/mekanism/common/util/CableUtils.java b/src/main/java/mekanism/common/util/CableUtils.java index e33365d46..d159e8979 100644 --- a/src/main/java/mekanism/common/util/CableUtils.java +++ b/src/main/java/mekanism/common/util/CableUtils.java @@ -2,6 +2,7 @@ package mekanism.common.util; import ic2.api.energy.EnergyNet; import ic2.api.energy.tile.IEnergyAcceptor; +import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergySource; @@ -136,9 +137,9 @@ public final class CableUtils return true; } } - else if(MekanismUtils.useIC2() && tileEntity instanceof IEnergyAcceptor) + else if(MekanismUtils.useIC2() && orig instanceof IEnergyEmitter && tileEntity instanceof IEnergyAcceptor) { - if(((IEnergyAcceptor)tileEntity).acceptsEnergyFrom(orig, side.getOpposite())) + if(((IEnergyAcceptor)tileEntity).acceptsEnergyFrom((IEnergyEmitter)orig, side.getOpposite())) { return true; } @@ -258,7 +259,7 @@ public final class CableUtils } else if(MekanismUtils.useIC2() && tileEntity instanceof IEnergySink) { - if(((IEnergySink)tileEntity).acceptsEnergyFrom((TileEntity)from, side.getOpposite())) + if(((IEnergySink)tileEntity).acceptsEnergyFrom(from, side.getOpposite())) { double toSend = Math.min(currentSending, EnergyNet.instance.getPowerFromTier(((IEnergySink)tileEntity).getSinkTier())*general.FROM_IC2); toSend = Math.min(Math.min(toSend, ((IEnergySink)tileEntity).getDemandedEnergy()*general.FROM_IC2), Integer.MAX_VALUE); diff --git a/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java b/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java index 06814831d..a352fa126 100644 --- a/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java +++ b/src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java @@ -28,7 +28,6 @@ import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -257,48 +256,6 @@ public class ItemBlockGenerator extends ItemBlock implements IEnergizedItem, ISp return false; } - @Override - @Method(modid = "IC2") - public boolean canProvideEnergy(ItemStack itemStack) - { - return canSend(itemStack); - } - - @Override - @Method(modid = "IC2") - public Item getChargedItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public Item getEmptyItem(ItemStack itemStack) - { - return this; - } - - @Override - @Method(modid = "IC2") - public double getMaxCharge(ItemStack itemStack) - { - return 0; - } - - @Override - @Method(modid = "IC2") - public int getTier(ItemStack itemStack) - { - return 4; - } - - @Override - @Method(modid = "IC2") - public double getTransferLimit(ItemStack itemStack) - { - return 0; - } - @Override public void setInventory(NBTTagList nbtTags, Object... data) { diff --git a/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java b/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java index 681eb9244..a0becb887 100644 --- a/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java +++ b/src/main/java/mekanism/generators/common/tile/turbine/TileEntityTurbineValve.java @@ -3,7 +3,9 @@ package mekanism.generators.common.tile.turbine; import ic2.api.energy.EnergyNet; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; +import ic2.api.energy.tile.IEnergyAcceptor; import ic2.api.energy.tile.IEnergyConductor; +import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergyTile; import java.util.EnumSet; @@ -16,7 +18,6 @@ import mekanism.common.util.LangUtils; import mekanism.common.util.MekanismUtils; import mekanism.common.util.PipeUtils; import mekanism.generators.common.content.turbine.TurbineFluidTank; -import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fluids.Fluid; @@ -97,13 +98,13 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I { if(!worldObj.isRemote) { - TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos()); + IEnergyTile registered = EnergyNet.instance.getTile(worldObj, getPos()); if(registered != this) { if(registered instanceof IEnergyTile) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered)); + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(registered)); } else if(registered == null) { @@ -119,11 +120,11 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I { if(!worldObj.isRemote) { - TileEntity registered = EnergyNet.instance.getTileEntity(worldObj, getPos()); + IEnergyTile registered = EnergyNet.instance.getTile(worldObj, getPos()); if(registered instanceof IEnergyTile) { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)registered)); + MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(registered)); } } } @@ -252,14 +253,14 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I @Override @Method(modid = "IC2") - public boolean acceptsEnergyFrom(TileEntity emitter, EnumFacing direction) + public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing direction) { return false; } @Override @Method(modid = "IC2") - public boolean emitsEnergyTo(TileEntity receiver, EnumFacing direction) + public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing direction) { return getOutputtingSides().contains(direction) && receiver instanceof IEnergyConductor; }