├── .gitignore ├── IDEA_Formatter.jar ├── LICENSE.md ├── README.md ├── build.gradle ├── build.properties ├── devel └── log4j2.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── recipes ├── charge_pad_redstone.png ├── charge_pad_resonant.png ├── controller.png ├── energy_input.png ├── exchanger_redstone_upgrade.png ├── exchangers.png ├── frame.png ├── glass.png ├── health_pad_redstone.png ├── health_pad_resonant.png └── valve.png ├── screenshots ├── charge_pad_overview.png ├── ender_tank.png ├── ender_tank_small.png ├── exchanger_block_selected.png ├── exchanger_invalid_selection.png ├── exchanger_no_selection.png ├── exchanger_radius_hilighted.png └── exchanger_valid_selection.png └── src ├── main ├── java │ └── io │ │ └── endertech │ │ ├── EnderTech.java │ │ ├── block │ │ ├── BlockChargePad.java │ │ ├── BlockET.java │ │ ├── BlockHealthPad.java │ │ ├── BlockPad.java │ │ ├── ETBlocks.java │ │ └── ItemBlockBasic.java │ │ ├── client │ │ ├── handler │ │ │ ├── DrawBlockHighlightEventHandler.java │ │ │ ├── GUIEventHandler.java │ │ │ └── KeyBindingHandler.java │ │ └── render │ │ │ └── IconRegistry.java │ │ ├── config │ │ ├── ConfigHandler.java │ │ ├── GeneralConfig.java │ │ └── ItemConfig.java │ │ ├── creativetab │ │ └── CreativeTabET.java │ │ ├── fx │ │ ├── EntityChargePadFX.java │ │ └── EntityHealthPadFX.java │ │ ├── gui │ │ ├── GuiHandler.java │ │ ├── client │ │ │ ├── GuiChargePad.java │ │ │ ├── GuiETBase.java │ │ │ ├── GuiHealthPad.java │ │ │ └── GuiTank.java │ │ ├── container │ │ │ ├── ContainerChargePad.java │ │ │ ├── ContainerETBase.java │ │ │ ├── ContainerHealthPad.java │ │ │ └── ContainerTank.java │ │ └── element │ │ │ ├── ElementFluidTankSizeable.java │ │ │ └── ElementIcon.java │ │ ├── handler │ │ └── WorldEventHandler.java │ │ ├── integration │ │ └── waila │ │ │ ├── GenericWailaProvider.java │ │ │ └── MultiblockWailaProvider.java │ │ ├── item │ │ ├── ETItems.java │ │ ├── IKeyHandler.java │ │ ├── ItemBlockChargePad.java │ │ ├── ItemBlockHealthPad.java │ │ ├── ItemBucket.java │ │ ├── ItemETBase.java │ │ ├── ItemETEnergyContainer.java │ │ ├── ItemExchanger.java │ │ └── ItemExchangerBase.java │ │ ├── modules │ │ └── dev │ │ │ ├── DevEnvironmentPulse.java │ │ │ ├── block │ │ │ └── DevBlocks.java │ │ │ ├── fluid │ │ │ ├── BlockFluidChargedEnder.java │ │ │ ├── BlockFluidETBase.java │ │ │ └── DevETFluids.java │ │ │ ├── handler │ │ │ └── MappingEventHandler.java │ │ │ └── item │ │ │ └── ItemSpinningCube.java │ │ ├── multiblock │ │ ├── IMultiblockPart.java │ │ ├── MultiblockControllerBase.java │ │ ├── MultiblockRegistry.java │ │ ├── MultiblockTileEntityBase.java │ │ ├── MultiblockValidationException.java │ │ ├── MultiblockWorldRegistry.java │ │ ├── block │ │ │ ├── BlockMultiblockGlass.java │ │ │ ├── BlockTankController.java │ │ │ └── BlockTankPart.java │ │ ├── controller │ │ │ └── ControllerTank.java │ │ ├── handler │ │ │ ├── MultiblockClientTickHandler.java │ │ │ ├── MultiblockEventHandler.java │ │ │ └── MultiblockServerTickHandler.java │ │ ├── item │ │ │ └── ItemBlockTankPart.java │ │ ├── rectangular │ │ │ ├── PartPosition.java │ │ │ ├── RectangularMultiblockControllerBase.java │ │ │ └── RectangularMultiblockTileEntityBase.java │ │ ├── renderer │ │ │ ├── ConnectedRenderBlocks.java │ │ │ ├── ConnectedTextureRenderer.java │ │ │ └── TankControllerRenderer.java │ │ ├── texture │ │ │ └── ConnectedTextureIcon.java │ │ └── tile │ │ │ ├── TileTankController.java │ │ │ ├── TileTankEnergyInput.java │ │ │ ├── TileTankGlass.java │ │ │ ├── TileTankPart.java │ │ │ ├── TileTankPartBase.java │ │ │ └── TileTankValve.java │ │ ├── network │ │ ├── ITilePacketHandler.java │ │ ├── PacketBase.java │ │ ├── PacketETBase.java │ │ ├── PacketHandler.java │ │ ├── PacketKeyPressed.java │ │ └── PacketTile.java │ │ ├── proxy │ │ ├── ClientProxy.java │ │ └── CommonProxy.java │ │ ├── reference │ │ ├── Reference.java │ │ ├── Strings.java │ │ └── Textures.java │ │ ├── tile │ │ ├── TileChargePad.java │ │ ├── TileET.java │ │ ├── TileHealthPad.java │ │ ├── TileInventory.java │ │ └── TilePad.java │ │ └── util │ │ ├── BlockCoord.java │ │ ├── ETItemWrapper.java │ │ ├── Exchange.java │ │ ├── Geometry.java │ │ ├── IChargeableFromSlot.java │ │ ├── IETWailaProvider.java │ │ ├── IItemBlockAffector.java │ │ ├── IOutlineDrawer.java │ │ ├── Key.java │ │ ├── RGBA.java │ │ ├── fluid │ │ └── BucketHandler.java │ │ ├── helper │ │ ├── BlockHelper.java │ │ ├── FontHelper.java │ │ ├── KeyHelper.java │ │ ├── LocalisationHelper.java │ │ ├── LogHelper.java │ │ ├── ModuleHelper.java │ │ ├── NBTHelper.java │ │ ├── RenderHelper.java │ │ ├── StringHelper.java │ │ ├── TextureHelper.java │ │ └── WorldHelper.java │ │ ├── inventory │ │ ├── InventoryAbstracted.java │ │ └── InventoryHelper.java │ │ └── teleport │ │ ├── ETTeleporter.java │ │ └── TeleportHelper.java └── resources │ ├── assets │ └── endertech │ │ ├── lang │ │ ├── de_DE.lang │ │ ├── en_US.lang │ │ ├── fr_CA.lang │ │ ├── ko_KR.lang │ │ ├── zh_CN.lang │ │ └── zh_TW.lang │ │ └── textures │ │ ├── blocks │ │ ├── chargepad │ │ │ ├── ChargePad_Creative_Active.png │ │ │ ├── ChargePad_Creative_Inactive.png │ │ │ ├── ChargePad_Redstone_Active.png │ │ │ ├── ChargePad_Redstone_Inactive.png │ │ │ ├── ChargePad_Resonant_Active.png │ │ │ └── ChargePad_Resonant_Inactive.png │ │ ├── enderTankController.controllerActive.png │ │ ├── enderTankController.controllerBase.png │ │ ├── enderTankController.controllerIdle.png │ │ ├── enderTankPart.energyInput.png │ │ ├── enderTankPart.frameBase.png │ │ ├── enderTankPart.frameCenter.png │ │ ├── enderTankPart.frameCorner.png │ │ ├── enderTankPart.frameDefault.png │ │ ├── enderTankPart.frameEastWest.png │ │ ├── enderTankPart.frameNorthSouth.png │ │ ├── enderTankPart.frameVertical.png │ │ ├── enderTankPart.png │ │ ├── enderTankPart.valve.png │ │ ├── fluids │ │ │ ├── charged_ender_flow.png │ │ │ ├── charged_ender_flow.png.mcmeta │ │ │ ├── charged_ender_still.png │ │ │ └── charged_ender_still.png.mcmeta │ │ ├── healthpad │ │ │ ├── HealthPad_Creative_Active.png │ │ │ ├── HealthPad_Creative_Inactive.png │ │ │ ├── HealthPad_Redstone_Active.png │ │ │ ├── HealthPad_Redstone_Inactive.png │ │ │ ├── HealthPad_Resonant_Active.png │ │ │ └── HealthPad_Resonant_Inactive.png │ │ ├── machines │ │ │ ├── Machine_Creative_Bottom.png │ │ │ ├── Machine_Creative_Side.png │ │ │ ├── Machine_Creative_Top.png │ │ │ ├── Machine_Redstone_Bottom.png │ │ │ ├── Machine_Redstone_Side.png │ │ │ ├── Machine_Redstone_Top.png │ │ │ ├── Machine_Resonant_Bottom.png │ │ │ ├── Machine_Resonant_Side.png │ │ │ └── Machine_Resonant_Top.png │ │ ├── multiblockGlass.tank.anticorner.bl.png │ │ ├── multiblockGlass.tank.anticorner.br.png │ │ ├── multiblockGlass.tank.anticorner.tl.png │ │ ├── multiblockGlass.tank.anticorner.tr.png │ │ ├── multiblockGlass.tank.bottom.png │ │ ├── multiblockGlass.tank.central.png │ │ ├── multiblockGlass.tank.left.png │ │ ├── multiblockGlass.tank.right.png │ │ ├── multiblockGlass.tank.top.png │ │ └── particles │ │ │ └── health.png │ │ ├── gui │ │ ├── BasicBackground.png │ │ ├── BasicInventoryBackground.png │ │ ├── ChargePad.png │ │ └── Tank.png │ │ ├── items │ │ ├── bucket │ │ │ ├── bucketChargedEnder.png │ │ │ ├── bucketChargedEnder.png.mcmeta │ │ │ └── bucketMask.png │ │ └── exchanger │ │ │ ├── exchangerAnimCreative.png │ │ │ ├── exchangerAnimCreative.png.mcmeta │ │ │ ├── exchangerAnimRedstone.png │ │ │ ├── exchangerAnimRedstone.png.mcmeta │ │ │ ├── exchangerAnimResonant.png │ │ │ ├── exchangerAnimResonant.png.mcmeta │ │ │ ├── exchangerBase.png │ │ │ ├── exchangerCreative.png │ │ │ ├── exchangerRedstone.png │ │ │ └── exchangerResonant.png │ │ ├── logo.png │ │ └── logo_whitebg.png │ ├── mcmod.info │ ├── pack.mcmeta │ └── version.properties └── packapi ├── java └── cofh │ ├── api │ ├── CoFHAPIProps.java │ ├── block │ │ ├── IBlockAppearance.java │ │ ├── IBlockConfigGui.java │ │ ├── IBlockDebug.java │ │ ├── IBlockInfo.java │ │ ├── IDismantleable.java │ │ └── package-info.java │ ├── core │ │ ├── ICustomInventory.java │ │ ├── IInitializer.java │ │ └── package-info.java │ ├── energy │ │ ├── EnergyStorage.java │ │ ├── IEnergyConnection.java │ │ ├── IEnergyContainerItem.java │ │ ├── IEnergyHandler.java │ │ ├── IEnergyProvider.java │ │ ├── IEnergyReceiver.java │ │ ├── IEnergyStorage.java │ │ ├── ItemEnergyContainer.java │ │ ├── TileEnergyHandler.java │ │ └── package-info.java │ ├── fluid │ │ ├── ITankContainerBucketable.java │ │ └── package-info.java │ ├── inventory │ │ ├── IInventoryConnection.java │ │ ├── IInventoryHandler.java │ │ ├── IInventoryRetainer.java │ │ └── package-info.java │ ├── item │ │ ├── IAugmentItem.java │ │ ├── IEmpowerableItem.java │ │ ├── IInventoryContainerItem.java │ │ ├── IMultiModeItem.java │ │ ├── ISpecialFilterFluid.java │ │ ├── ISpecialFilterItem.java │ │ ├── IToolHammer.java │ │ └── package-info.java │ ├── modhelpers │ │ ├── EE3Helper.java │ │ ├── ThaumcraftHelper.java │ │ ├── ThermalExpansionHelper.java │ │ └── package-info.java │ ├── package-info.java │ ├── tileentity │ │ ├── IAugmentable.java │ │ ├── IEnergyInfo.java │ │ ├── IPortableData.java │ │ ├── IReconfigurableFacing.java │ │ ├── IReconfigurableSides.java │ │ ├── IRedstoneCache.java │ │ ├── IRedstoneControl.java │ │ ├── ISecurable.java │ │ ├── ISidedTexture.java │ │ ├── ITileInfo.java │ │ └── package-info.java │ ├── transport │ │ ├── IEnderAttuned.java │ │ ├── IEnderDestination.java │ │ ├── IEnderEnergyHandler.java │ │ ├── IEnderFluidHandler.java │ │ ├── IEnderItemHandler.java │ │ ├── IItemDuct.java │ │ └── package-info.java │ └── world │ │ ├── IFeatureGenerator.java │ │ ├── IFeatureHandler.java │ │ ├── IFeatureParser.java │ │ ├── IGeneratorParser.java │ │ └── package-info.java │ └── lib │ ├── CoFHLibProps.java │ ├── audio │ ├── ISoundSource.java │ ├── SoundBase.java │ ├── SoundTile.java │ └── package-info.java │ ├── gui │ ├── GuiBase.java │ ├── GuiBook.java │ ├── GuiColor.java │ ├── GuiProps.java │ ├── TabTracker.java │ ├── container │ │ ├── ContainerFalse.java │ │ ├── ContainerInventoryItem.java │ │ ├── CustomInventoryWrapper.java │ │ ├── IAugmentableContainer.java │ │ ├── InventoryContainerItemWrapper.java │ │ └── package-info.java │ ├── element │ │ ├── ElementBase.java │ │ ├── ElementButton.java │ │ ├── ElementButtonBase.java │ │ ├── ElementButtonManaged.java │ │ ├── ElementButtonOption.java │ │ ├── ElementDualScaled.java │ │ ├── ElementEnergyStored.java │ │ ├── ElementFluid.java │ │ ├── ElementFluidTank.java │ │ ├── ElementIcon.java │ │ ├── ElementListBox.java │ │ ├── ElementSimple.java │ │ ├── ElementSimpleBox.java │ │ ├── ElementSimpleToolTip.java │ │ ├── ElementSlider.java │ │ ├── ElementTextField.java │ │ ├── ElementTextFieldFiltered.java │ │ ├── ElementTextFieldLimited.java │ │ ├── TabBase.java │ │ ├── listbox │ │ │ ├── IListBoxElement.java │ │ │ ├── ListBoxElementText.java │ │ │ ├── SliderHorizontal.java │ │ │ ├── SliderVertical.java │ │ │ └── package-info.java │ │ └── package-info.java │ ├── package-info.java │ └── slot │ │ ├── ISlotValidator.java │ │ ├── SlotAcceptAssignable.java │ │ ├── SlotAcceptInsertable.java │ │ ├── SlotAcceptValid.java │ │ ├── SlotCraftingLocked.java │ │ ├── SlotCustomInventory.java │ │ ├── SlotEnergy.java │ │ ├── SlotFalseCopy.java │ │ ├── SlotInvisible.java │ │ ├── SlotLocked.java │ │ ├── SlotPotion.java │ │ ├── SlotPotionIngredient.java │ │ ├── SlotRemoveOnly.java │ │ ├── SlotSpecificItem.java │ │ ├── SlotValidated.java │ │ ├── SlotViewOnly.java │ │ └── package-info.java │ ├── inventory │ ├── ComparableItemStack.java │ ├── ComparableItemStackNBT.java │ ├── ComparableItemStackSafe.java │ ├── IInventoryManager.java │ ├── InventoryCraftingCustom.java │ ├── InventoryCraftingFalse.java │ ├── InventoryManager.java │ ├── InventoryManagerSided.java │ ├── InventoryManagerStandard.java │ └── package-info.java │ ├── network │ └── ByteBufHelper.java │ ├── package-info.java │ ├── render │ ├── IFluidOverlayItem.java │ ├── RenderFluidOverlayItem.java │ ├── RenderHelper.java │ ├── RenderItemAsBlock.java │ ├── package-info.java │ └── particle │ │ ├── EntityDropParticleFX.java │ │ └── package-info.java │ ├── transport │ ├── ClientEnderChannelRegistry.java │ ├── EnderRegistry.java │ ├── IEnderChannelRegistry.java │ └── ServerEnderChannelRegistry.java │ ├── util │ ├── ArrayHashList.java │ ├── BlockWrapper.java │ ├── CharacterSingleton.java │ ├── ComparableItem.java │ ├── IdentityLinkedHashList.java │ ├── ItemWrapper.java │ ├── LinkedHashList.java │ ├── OreDictionaryProxy.java │ ├── Rectangle4i.java │ ├── RegistryUtils.java │ ├── TimeTracker.java │ ├── UtilLiquidMover.java │ ├── WeightedRandomBlock.java │ ├── WeightedRandomItemStack.java │ ├── WeightedRandomNBTTag.java │ ├── WeightedRandomWorldGenerator.java │ ├── helpers │ │ ├── AugmentHelper.java │ │ ├── BlockHelper.java │ │ ├── ColorHelper.java │ │ ├── DamageHelper.java │ │ ├── EnergyHelper.java │ │ ├── EntityHelper.java │ │ ├── FireworksHelper.java │ │ ├── FluidHelper.java │ │ ├── HolidayHelper.java │ │ ├── InventoryHelper.java │ │ ├── ItemHelper.java │ │ ├── MathHelper.java │ │ ├── NBTHelper.java │ │ ├── RedstoneControlHelper.java │ │ ├── SecurityHelper.java │ │ ├── ServerHelper.java │ │ ├── SoundHelper.java │ │ ├── StringHelper.java │ │ └── package-info.java │ ├── package-info.java │ └── position │ │ ├── Area.java │ │ ├── BlockPosition.java │ │ ├── ChunkCoord.java │ │ ├── IRotateableTile.java │ │ └── package-info.java │ └── world │ ├── WorldGenAdvLakes.java │ ├── WorldGenBoulder.java │ ├── WorldGenDecoration.java │ ├── WorldGenDungeon.java │ ├── WorldGenGeode.java │ ├── WorldGenMassiveTree.java │ ├── WorldGenMinableCluster.java │ ├── WorldGenMinableLargeVein.java │ ├── WorldGenMinablePlate.java │ ├── WorldGenMulti.java │ ├── WorldGenSmallTree.java │ ├── WorldGenSparseMinableCluster.java │ ├── WorldGenSpike.java │ ├── WorldGenStalactite.java │ ├── WorldGenStalagmite.java │ ├── biome │ ├── BiomeDictionaryArbiter.java │ ├── BiomeInfo.java │ ├── BiomeInfoRarity.java │ └── BiomeInfoSet.java │ ├── feature │ ├── FeatureBase.java │ ├── FeatureGenCave.java │ ├── FeatureGenLargeVein.java │ ├── FeatureGenNormal.java │ ├── FeatureGenSurface.java │ ├── FeatureGenTopBlock.java │ ├── FeatureGenUnderfluid.java │ ├── FeatureGenUniform.java │ └── package-info.java │ └── package-info.java └── resources ├── CoFH_at.cfg └── cofhlib_at.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | # Gradle 2 | build 3 | .gradle 4 | 5 | .DS_Store 6 | 7 | # Minecraft 8 | run 9 | 10 | # IntelliJ 11 | out 12 | .idea/ 13 | *.iml 14 | *.ipr 15 | *.iws 16 | 17 | # Keystore 18 | keystore/* 19 | 20 | # Decomp 21 | decomp/* 22 | 23 | libs/*.jar 24 | *~ 25 | -------------------------------------------------------------------------------- /IDEA_Formatter.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/IDEA_Formatter.jar -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # Licenses 2 | The source code of this project is licensed under the terms of the ISC license, listed in the [LICENSE](LICENSE.md) file. A concise summary of the ISC license is available at [choosealicense.org](http://choosealicense.com/licenses/isc/). 3 | 4 | Art and other assets are licensed under the terms of the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) license (linked below). 5 | 6 | ## Code License 7 | Copyright © 2014-2015, Sky Welch 8 | 9 | Permission to use, copy, modify, and/or distribute this software for any 10 | purpose with or without fee is hereby granted, provided that the above 11 | copyright notice and this permission notice appear in all copies. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 14 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 15 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 16 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 17 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 18 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 19 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 20 | 21 | ## Art and other assets license 22 | [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)](http://creativecommons.org/licenses/by-nc-nd/4.0/) 23 | 24 | -------------------------------------------------------------------------------- /build.properties: -------------------------------------------------------------------------------- 1 | minecraft_version=1.7.10 2 | forge_version=10.13.4.1448-1.7.10 3 | mod_version=0.3.2 4 | cclib_version=1.1.3.138 5 | nei_version=1.0.5.111 6 | ccc_version=1.0.7.46 7 | waila_version=1.5.10 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jul 13 17:14:46 BST 2014 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip 7 | -------------------------------------------------------------------------------- /recipes/charge_pad_redstone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/charge_pad_redstone.png -------------------------------------------------------------------------------- /recipes/charge_pad_resonant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/charge_pad_resonant.png -------------------------------------------------------------------------------- /recipes/controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/controller.png -------------------------------------------------------------------------------- /recipes/energy_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/energy_input.png -------------------------------------------------------------------------------- /recipes/exchanger_redstone_upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/exchanger_redstone_upgrade.png -------------------------------------------------------------------------------- /recipes/exchangers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/exchangers.png -------------------------------------------------------------------------------- /recipes/frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/frame.png -------------------------------------------------------------------------------- /recipes/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/glass.png -------------------------------------------------------------------------------- /recipes/health_pad_redstone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/health_pad_redstone.png -------------------------------------------------------------------------------- /recipes/health_pad_resonant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/health_pad_resonant.png -------------------------------------------------------------------------------- /recipes/valve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/recipes/valve.png -------------------------------------------------------------------------------- /screenshots/charge_pad_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/charge_pad_overview.png -------------------------------------------------------------------------------- /screenshots/ender_tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/ender_tank.png -------------------------------------------------------------------------------- /screenshots/ender_tank_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/ender_tank_small.png -------------------------------------------------------------------------------- /screenshots/exchanger_block_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/exchanger_block_selected.png -------------------------------------------------------------------------------- /screenshots/exchanger_invalid_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/exchanger_invalid_selection.png -------------------------------------------------------------------------------- /screenshots/exchanger_no_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/exchanger_no_selection.png -------------------------------------------------------------------------------- /screenshots/exchanger_radius_hilighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/exchanger_radius_hilighted.png -------------------------------------------------------------------------------- /screenshots/exchanger_valid_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/screenshots/exchanger_valid_selection.png -------------------------------------------------------------------------------- /src/main/java/io/endertech/block/ItemBlockBasic.java: -------------------------------------------------------------------------------- 1 | package io.endertech.block; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.item.ItemBlock; 5 | import net.minecraft.item.ItemStack; 6 | 7 | public class ItemBlockBasic extends ItemBlock 8 | { 9 | public ItemBlockBasic(Block block) 10 | { 11 | super(block); 12 | 13 | setHasSubtypes(true); 14 | } 15 | 16 | @Override 17 | public int getMetadata(int i) 18 | { 19 | return i; 20 | } 21 | 22 | @Override 23 | public ItemBlock setUnlocalizedName(String name) 24 | { 25 | name = "endertech." + name; 26 | return super.setUnlocalizedName(name); 27 | } 28 | 29 | @Override 30 | public String getUnlocalizedName(ItemStack itemStack) 31 | { 32 | int metadata = itemStack.getItemDamage(); 33 | return super.getUnlocalizedName(itemStack) + "." + Integer.toString(metadata); 34 | } 35 | 36 | @Override 37 | public String getUnlocalizedName() 38 | { 39 | return super.getUnlocalizedName() + ".0"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/client/handler/DrawBlockHighlightEventHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.client.handler; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import io.endertech.util.IOutlineDrawer; 5 | import net.minecraft.block.Block; 6 | import net.minecraft.item.Item; 7 | import net.minecraft.util.MovingObjectPosition; 8 | import net.minecraftforge.client.event.DrawBlockHighlightEvent; 9 | 10 | public class DrawBlockHighlightEventHandler 11 | { 12 | @SubscribeEvent 13 | public void onDrawBlockHighlightEvent(DrawBlockHighlightEvent event) 14 | { 15 | if (event.target.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) return; 16 | Block block = event.player.worldObj.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ); 17 | 18 | boolean cancelEvent = false; 19 | boolean drewItem = false; 20 | 21 | if (event.currentItem != null) 22 | { 23 | Item item = event.currentItem.getItem(); 24 | if (item instanceof IOutlineDrawer) 25 | { 26 | cancelEvent = ((IOutlineDrawer) item).drawOutline(event); 27 | drewItem = !cancelEvent; 28 | } 29 | } 30 | 31 | if (!drewItem && block instanceof IOutlineDrawer) 32 | { 33 | cancelEvent = ((IOutlineDrawer) block).drawOutline(event); 34 | } 35 | 36 | event.setCanceled(cancelEvent); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/client/render/IconRegistry.java: -------------------------------------------------------------------------------- 1 | package io.endertech.client.render; 2 | 3 | import net.minecraft.client.renderer.texture.IIconRegister; 4 | import net.minecraft.util.IIcon; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | // Inspired by CoFH's IconRegistry 9 | 10 | public class IconRegistry 11 | { 12 | private static Map iconMap = new HashMap(); 13 | 14 | public static void addAndRegisterIcon(String iconName, String location, IIconRegister iconRegister) 15 | { 16 | IIcon icon = iconRegister.registerIcon(location); 17 | addIcon(iconName, icon); 18 | } 19 | 20 | public static void addIcon(String iconName, IIcon icon) 21 | { 22 | iconMap.put(iconName, icon); 23 | } 24 | 25 | public static IIcon getIcon(String iconName) 26 | { 27 | return iconMap.get(iconName); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/config/ConfigHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.config; 2 | 3 | import net.minecraftforge.common.config.Configuration; 4 | import java.io.File; 5 | 6 | public class ConfigHandler 7 | { 8 | public static Configuration configuration; 9 | 10 | public static void init(String configPath) 11 | { 12 | GeneralConfig.init(new File(configPath + "general.cfg")); 13 | ItemConfig.init(new File(configPath + "items.cfg")); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/creativetab/CreativeTabET.java: -------------------------------------------------------------------------------- 1 | package io.endertech.creativetab; 2 | 3 | import io.endertech.item.ETItems; 4 | import io.endertech.reference.Strings; 5 | import net.minecraft.creativetab.CreativeTabs; 6 | import net.minecraft.item.Item; 7 | 8 | public class CreativeTabET extends CreativeTabs 9 | { 10 | public CreativeTabET() 11 | { 12 | super(Strings.CREATIVE_TAB_ET); 13 | } 14 | 15 | @Override 16 | public Item getTabIconItem() 17 | { 18 | return ETItems.itemExchanger; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/GuiHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui; 2 | 3 | import cpw.mods.fml.common.network.IGuiHandler; 4 | import io.endertech.tile.TileET; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.tileentity.TileEntity; 7 | import net.minecraft.world.World; 8 | 9 | public class GuiHandler implements IGuiHandler 10 | { 11 | public static final int TILE_ID = 0; 12 | 13 | @Override 14 | public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 15 | { 16 | switch (ID) 17 | { 18 | case TILE_ID: 19 | TileEntity tileEntity = world.getTileEntity(x, y, z); 20 | if (tileEntity instanceof TileET) 21 | { 22 | return ((TileET) tileEntity).getGuiServer(player.inventory); 23 | } 24 | break; 25 | } 26 | 27 | return null; 28 | } 29 | 30 | @Override 31 | public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 32 | { 33 | switch (ID) 34 | { 35 | case TILE_ID: 36 | TileEntity tileEntity = world.getTileEntity(x, y, z); 37 | if (tileEntity instanceof TileET) 38 | { 39 | return ((TileET) tileEntity).getGuiClient(player.inventory); 40 | } 41 | break; 42 | } 43 | 44 | return null; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/client/GuiChargePad.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.client; 2 | 3 | import cofh.lib.gui.element.ElementEnergyStored; 4 | import io.endertech.gui.container.ContainerChargePad; 5 | import io.endertech.gui.element.ElementIcon; 6 | import io.endertech.tile.TileChargePad; 7 | import io.endertech.tile.TileET; 8 | import net.minecraft.entity.player.InventoryPlayer; 9 | import net.minecraft.util.ResourceLocation; 10 | 11 | public class GuiChargePad extends GuiETBase 12 | { 13 | public static final String TEXTURE_PATH = "endertech:textures/gui/ChargePad.png"; 14 | public static final ResourceLocation TEXTURE = new ResourceLocation(TEXTURE_PATH); 15 | public TileChargePad tileChargePad; 16 | private ElementIcon elementChargingIcon; 17 | 18 | public GuiChargePad(InventoryPlayer inventoryPlayer, TileET tileEntity) 19 | { 20 | super(new ContainerChargePad(inventoryPlayer, tileEntity), TEXTURE, tileEntity); 21 | 22 | this.tileChargePad = (TileChargePad) tileEntity; 23 | this.name = this.tileChargePad.getName(); 24 | } 25 | 26 | @Override 27 | public void initGui() 28 | { 29 | super.initGui(); 30 | 31 | ElementEnergyStored elementEnergyStored = new ElementEnergyStored(this, 8, 8, this.tileChargePad); 32 | this.addElement(elementEnergyStored); 33 | 34 | elementChargingIcon = new ElementIcon(this, 80, 30); 35 | this.addElement(elementChargingIcon); 36 | } 37 | 38 | @Override 39 | protected void updateElementInformation() 40 | { 41 | elementChargingIcon.setIconToDraw(tileChargePad.getFrontIcon()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/client/GuiHealthPad.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.client; 2 | 3 | import cofh.lib.gui.element.ElementEnergyStored; 4 | import io.endertech.gui.container.ContainerHealthPad; 5 | import io.endertech.gui.element.ElementIcon; 6 | import io.endertech.tile.TileET; 7 | import io.endertech.tile.TileHealthPad; 8 | import net.minecraft.entity.player.InventoryPlayer; 9 | import net.minecraft.util.ResourceLocation; 10 | 11 | public class GuiHealthPad extends GuiETBase 12 | { 13 | public static final String TEXTURE_PATH = "endertech:textures/gui/ChargePad.png"; 14 | public static final ResourceLocation TEXTURE = new ResourceLocation(TEXTURE_PATH); 15 | public TileHealthPad tileHealthPad; 16 | private ElementIcon elementChargingIcon; 17 | 18 | public GuiHealthPad(InventoryPlayer inventoryPlayer, TileET tileEntity) 19 | { 20 | super(new ContainerHealthPad(inventoryPlayer, tileEntity), TEXTURE, tileEntity); 21 | 22 | this.tileHealthPad = (TileHealthPad) tileEntity; 23 | this.name = this.tileHealthPad.getName(); 24 | } 25 | 26 | @Override 27 | public void initGui() 28 | { 29 | super.initGui(); 30 | 31 | ElementEnergyStored elementEnergyStored = new ElementEnergyStored(this, 8, 8, this.tileHealthPad); 32 | this.addElement(elementEnergyStored); 33 | 34 | elementChargingIcon = new ElementIcon(this, 80, 30); 35 | this.addElement(elementChargingIcon); 36 | } 37 | 38 | @Override 39 | protected void updateElementInformation() 40 | { 41 | elementChargingIcon.setIconToDraw(tileHealthPad.getFrontIcon()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/client/GuiTank.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.client; 2 | 3 | import cofh.lib.gui.element.ElementEnergyStored; 4 | import io.endertech.gui.container.ContainerTank; 5 | import io.endertech.gui.element.ElementFluidTankSizeable; 6 | import io.endertech.multiblock.tile.TileTankPart; 7 | import io.endertech.tile.TileET; 8 | import net.minecraft.entity.player.InventoryPlayer; 9 | import net.minecraft.util.ResourceLocation; 10 | 11 | public class GuiTank extends GuiETBase 12 | { 13 | public static final String TEXTURE_PATH = "endertech:textures/gui/Tank.png"; 14 | public static final ResourceLocation TEXTURE = new ResourceLocation(TEXTURE_PATH); 15 | public TileTankPart tileTankPart; 16 | 17 | public GuiTank(InventoryPlayer inventoryPlayer, TileET tileEntity) 18 | { 19 | super(new ContainerTank(inventoryPlayer, tileEntity), TEXTURE, tileEntity); 20 | 21 | this.tileTankPart = (TileTankPart) tileEntity; 22 | this.name = "Ender Tank"; 23 | } 24 | 25 | @Override 26 | public void initGui() 27 | { 28 | super.initGui(); 29 | 30 | ElementFluidTankSizeable elementFluidTank = new ElementFluidTankSizeable(this, 43, 27, 89, 42, this.tileTankPart.getTankController().tank); 31 | this.addElement(elementFluidTank); 32 | 33 | ElementEnergyStored elementEnergyStored = new ElementEnergyStored(this, 8, 8, this.tileTankPart.getTankController()); 34 | this.addElement(elementEnergyStored); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/container/ContainerChargePad.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.container; 2 | 3 | import cofh.lib.gui.slot.SlotEnergy; 4 | import io.endertech.tile.TileChargePad; 5 | import net.minecraft.entity.player.InventoryPlayer; 6 | import net.minecraft.tileentity.TileEntity; 7 | 8 | public class ContainerChargePad extends ContainerETBase 9 | { 10 | TileChargePad tileChargePad; 11 | 12 | public ContainerChargePad(InventoryPlayer inventoryPlayer, TileEntity tileEntity) 13 | { 14 | super(inventoryPlayer, tileEntity); 15 | 16 | this.tileChargePad = ((TileChargePad) tileEntity); 17 | this.addSlotToContainer(new SlotEnergy(this.tileChargePad, this.tileChargePad.getChargeSlot(), 8, 53)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/container/ContainerETBase.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.container; 2 | 3 | import io.endertech.tile.TileET; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.entity.player.InventoryPlayer; 6 | import net.minecraft.inventory.Container; 7 | import net.minecraft.inventory.Slot; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.tileentity.TileEntity; 10 | 11 | public class ContainerETBase extends Container 12 | { 13 | public TileET baseTile; 14 | 15 | public ContainerETBase(InventoryPlayer inventoryPlayer, TileEntity tileEntity) 16 | { 17 | if (tileEntity instanceof TileET) 18 | { 19 | this.baseTile = ((TileET) tileEntity); 20 | } 21 | 22 | this.addPlayerInventory(inventoryPlayer); 23 | } 24 | 25 | @Override 26 | public boolean canInteractWith(EntityPlayer player) 27 | { 28 | return (this.baseTile != null && this.baseTile.canInteractWith(player)); 29 | } 30 | 31 | protected void addPlayerInventory(InventoryPlayer paramInventoryPlayer) 32 | { 33 | for (int i = 0; i < 3; i++) 34 | { 35 | for (int j = 0; j < 9; j++) 36 | { 37 | this.addSlotToContainer(new Slot(paramInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); 38 | } 39 | } 40 | for (int i = 0; i < 9; i++) 41 | this.addSlotToContainer(new Slot(paramInventoryPlayer, i, 8 + i * 18, 142)); 42 | } 43 | 44 | @Override 45 | public ItemStack transferStackInSlot(EntityPlayer player, int slotID) 46 | { 47 | return null; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/container/ContainerHealthPad.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.container; 2 | 3 | import cofh.lib.gui.slot.SlotEnergy; 4 | import io.endertech.tile.TileHealthPad; 5 | import net.minecraft.entity.player.InventoryPlayer; 6 | import net.minecraft.tileentity.TileEntity; 7 | 8 | public class ContainerHealthPad extends ContainerETBase 9 | { 10 | TileHealthPad tileHealthPad; 11 | 12 | public ContainerHealthPad(InventoryPlayer inventoryPlayer, TileEntity tileEntity) 13 | { 14 | super(inventoryPlayer, tileEntity); 15 | 16 | this.tileHealthPad = ((TileHealthPad) tileEntity); 17 | this.addSlotToContainer(new SlotEnergy(this.tileHealthPad, this.tileHealthPad.getChargeSlot(), 8, 53)); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/container/ContainerTank.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.container; 2 | 3 | import cofh.lib.gui.slot.SlotEnergy; 4 | import io.endertech.multiblock.controller.ControllerTank; 5 | import io.endertech.multiblock.tile.TileTankPart; 6 | import net.minecraft.entity.player.InventoryPlayer; 7 | import net.minecraft.tileentity.TileEntity; 8 | 9 | public class ContainerTank extends ContainerETBase 10 | { 11 | public TileTankPart tileTankPart; 12 | 13 | public ContainerTank(InventoryPlayer inventoryPlayer, TileEntity tileEntity) 14 | { 15 | super(inventoryPlayer, tileEntity); 16 | 17 | this.tileTankPart = ((TileTankPart) tileEntity); 18 | 19 | ControllerTank controller = this.tileTankPart.getTankController(); 20 | this.addSlotToContainer(new SlotEnergy(controller, controller.getChargeSlot(), 8, 53)); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/gui/element/ElementIcon.java: -------------------------------------------------------------------------------- 1 | package io.endertech.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.gui.element.ElementBase; 5 | import net.minecraft.util.IIcon; 6 | 7 | public class ElementIcon extends ElementBase 8 | { 9 | public IIcon iconToDraw; 10 | 11 | public ElementIcon(GuiBase gui, int posX, int posY) 12 | { 13 | super(gui, posX, posY); 14 | } 15 | 16 | public void setIconToDraw(IIcon icon) 17 | { 18 | this.iconToDraw = icon; 19 | } 20 | 21 | @Override 22 | public void drawBackground(int mouseX, int mouseY, float gameTicks) 23 | { 24 | 25 | } 26 | 27 | @Override 28 | public void drawForeground(int mouseX, int mouseY) 29 | { 30 | if (this.iconToDraw != null) gui.drawIcon(this.iconToDraw, this.posX, this.posY, 0); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/item/ETItems.java: -------------------------------------------------------------------------------- 1 | package io.endertech.item; 2 | 3 | import cpw.mods.fml.common.registry.GameRegistry; 4 | import io.endertech.reference.Strings; 5 | import net.minecraft.item.ItemStack; 6 | 7 | public class ETItems 8 | { 9 | public static ItemExchanger itemExchanger; 10 | public static ItemStack toolExchangerCreative; 11 | public static ItemStack toolExchangerRedstone; 12 | public static ItemStack toolExchangerResonant; 13 | 14 | public static void init() 15 | { 16 | itemExchanger = (ItemExchanger) new ItemExchanger().setUnlocalizedName(Strings.EXCHANGER_BASE); 17 | 18 | GameRegistry.registerItem(itemExchanger, "endertech." + Strings.EXCHANGER_BASE); 19 | 20 | loadItems(); 21 | } 22 | 23 | public static void loadItems() 24 | { 25 | toolExchangerCreative = itemExchanger.addItem(ItemExchanger.Types.CREATIVE.ordinal(), Strings.EXCHANGER_CREATIVE); 26 | toolExchangerRedstone = itemExchanger.addItem(ItemExchanger.Types.REDSTONE.ordinal(), Strings.EXCHANGER_REDSTONE); 27 | toolExchangerResonant = itemExchanger.addItem(ItemExchanger.Types.RESONANT.ordinal(), Strings.EXCHANGER_RESONANT); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/item/IKeyHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.item; 2 | 3 | import io.endertech.util.Key; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.item.ItemStack; 6 | import java.util.Set; 7 | 8 | public interface IKeyHandler 9 | { 10 | public abstract void handleKey(EntityPlayer player, ItemStack itemStack, Key.KeyCode key); 11 | 12 | public abstract Set getHandledKeys(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/modules/dev/DevEnvironmentPulse.java: -------------------------------------------------------------------------------- 1 | package io.endertech.modules.dev; 2 | 3 | import cpw.mods.fml.common.event.FMLInitializationEvent; 4 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 5 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 6 | //import io.drakon.pulsar.pulse.Handler; 7 | //import io.drakon.pulsar.pulse.Pulse; 8 | import io.endertech.modules.dev.block.DevBlocks; 9 | import io.endertech.modules.dev.fluid.DevETFluids; 10 | import io.endertech.util.helper.LogHelper; 11 | 12 | //@Pulse(id = "DevEnvironmentPulse", description = "Loads in-dev content", forced = true) 13 | public class DevEnvironmentPulse 14 | { 15 | //@Handler 16 | public void preInit(FMLPreInitializationEvent fmlPreInitializationEvent) 17 | { 18 | LogHelper.info("Dev environment pulse preInit"); 19 | 20 | DevBlocks.init(); 21 | DevETFluids.init(); 22 | } 23 | 24 | //@Handler 25 | public void init(FMLInitializationEvent fmlInitializationEvent) 26 | { 27 | LogHelper.info("Dev environment pulse init"); 28 | } 29 | 30 | //@Handler 31 | public void postInit(FMLPostInitializationEvent fmlPostInitializationEvent) 32 | { 33 | LogHelper.info("Dev environment pulse postInit"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/modules/dev/block/DevBlocks.java: -------------------------------------------------------------------------------- 1 | package io.endertech.modules.dev.block; 2 | 3 | public class DevBlocks 4 | { 5 | // public static Block blockSpinningCube; 6 | // public static Block blockChargePad; 7 | 8 | public static void init() 9 | { 10 | // blockSpinningCube = new BlockSpinningCube(); 11 | // blockChargePad = new BlockChargePad(); 12 | 13 | // GameRegistry.registerBlock(blockSpinningCube, ItemBlockBasic.class, Strings.Blocks.SPINNING_CUBE_NAME); 14 | // GameRegistry.registerBlock(blockChargePad, ItemBlockChargePad.class, Strings.Blocks.CHARGE_PAD); 15 | 16 | // ((BlockSpinningCube) blockSpinningCube).init(); 17 | // ((BlockChargePad) blockChargePad).init(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/modules/dev/fluid/BlockFluidETBase.java: -------------------------------------------------------------------------------- 1 | package io.endertech.modules.dev.fluid; 2 | 3 | import net.minecraft.block.material.Material; 4 | import net.minecraftforge.fluids.BlockFluidClassic; 5 | import net.minecraftforge.fluids.Fluid; 6 | 7 | public class BlockFluidETBase extends BlockFluidClassic 8 | { 9 | public String name; 10 | 11 | public BlockFluidETBase(Fluid fluid, Material material, String name) 12 | { 13 | super(fluid, DevETFluids.materialFluidChargedEnder); 14 | 15 | this.name = name; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/modules/dev/handler/MappingEventHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.modules.dev.handler; 2 | 3 | import cpw.mods.fml.common.Mod; 4 | import cpw.mods.fml.common.event.FMLModIdMappingEvent; 5 | import io.endertech.util.fluid.BucketHandler; 6 | 7 | public class MappingEventHandler 8 | { 9 | @Mod.EventHandler 10 | public void handleIdMappingEvent(FMLModIdMappingEvent event) 11 | { 12 | BucketHandler.refreshMap(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/modules/dev/item/ItemSpinningCube.java: -------------------------------------------------------------------------------- 1 | package io.endertech.modules.dev.item; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.item.ItemBlock; 5 | 6 | public class ItemSpinningCube extends ItemBlock 7 | { 8 | public ItemSpinningCube(Block block) 9 | { 10 | super(block); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/multiblock/MultiblockValidationException.java: -------------------------------------------------------------------------------- 1 | package io.endertech.multiblock; 2 | 3 | /** 4 | * An exception thrown when trying to validate a multiblock. Requires a string describing why the multiblock 5 | * could not assemble. 6 | * 7 | * @author Erogenous Beef 8 | */ 9 | public class MultiblockValidationException extends Exception 10 | { 11 | 12 | public MultiblockValidationException(String reason) 13 | { 14 | super(reason); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/multiblock/handler/MultiblockClientTickHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.multiblock.handler; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import cpw.mods.fml.common.gameevent.TickEvent; 5 | import io.endertech.multiblock.MultiblockRegistry; 6 | import net.minecraft.client.Minecraft; 7 | 8 | public class MultiblockClientTickHandler 9 | { 10 | @SubscribeEvent 11 | public void onClientTickEvent(TickEvent.ClientTickEvent event) 12 | { 13 | if (event.phase == TickEvent.Phase.START) MultiblockRegistry.tickStart(Minecraft.getMinecraft().theWorld); 14 | else if (event.phase == TickEvent.Phase.END) MultiblockRegistry.tickEnd(Minecraft.getMinecraft().theWorld); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/multiblock/handler/MultiblockEventHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.multiblock.handler; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import io.endertech.multiblock.MultiblockRegistry; 5 | import net.minecraft.world.World; 6 | import net.minecraft.world.chunk.Chunk; 7 | import net.minecraftforge.event.world.ChunkEvent; 8 | import net.minecraftforge.event.world.WorldEvent; 9 | 10 | /** 11 | * In your mod, subscribe this on both the client and server sides side to handle chunk 12 | * load events for your multiblock machines. 13 | * Chunks can load asynchronously in environments like MCPC+, so we cannot 14 | * process any blocks that are in chunks which are still loading. 15 | */ 16 | public class MultiblockEventHandler 17 | { 18 | @SubscribeEvent 19 | public void onChunkLoadEvent(ChunkEvent.Load loadEvent) 20 | { 21 | Chunk chunk = loadEvent.getChunk(); 22 | World world = loadEvent.world; 23 | MultiblockRegistry.onChunkLoaded(world, chunk.xPosition, chunk.zPosition); 24 | } 25 | 26 | // Cleanup, for nice memory usageness 27 | @SubscribeEvent 28 | public void onWorldUnloadEvent(WorldEvent.Unload unloadWorldEvent) 29 | { 30 | MultiblockRegistry.onWorldUnloaded(unloadWorldEvent.world); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/multiblock/handler/MultiblockServerTickHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.multiblock.handler; 2 | 3 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 4 | import cpw.mods.fml.common.gameevent.TickEvent; 5 | import io.endertech.multiblock.MultiblockRegistry; 6 | 7 | /** 8 | * This is a generic multiblock tick handler. If you are using this code on your own, 9 | * you will need to register this with the Forge TickRegistry on both the 10 | * client AND server sides. 11 | * Note that different types of ticks run on different parts of the system. 12 | * CLIENT ticks only run on the client, at the start/end of each game loop. 13 | * SERVER and WORLD ticks only run on the server. 14 | * WORLDLOAD ticks run only on the server, and only when worlds are loaded. 15 | */ 16 | public class MultiblockServerTickHandler 17 | { 18 | @SubscribeEvent 19 | public void onWorldTick(TickEvent.WorldTickEvent event) 20 | { 21 | if (event.phase == TickEvent.Phase.START) MultiblockRegistry.tickStart(event.world); 22 | else if (event.phase == TickEvent.Phase.END) MultiblockRegistry.tickEnd(event.world); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/multiblock/item/ItemBlockTankPart.java: -------------------------------------------------------------------------------- 1 | package io.endertech.multiblock.item; 2 | 3 | import io.endertech.block.ETBlocks; 4 | import io.endertech.block.ItemBlockBasic; 5 | import io.endertech.multiblock.block.BlockTankPart; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.item.ItemStack; 8 | 9 | public class ItemBlockTankPart extends ItemBlockBasic 10 | { 11 | public ItemBlockTankPart(Block block) 12 | { 13 | super(block); 14 | this.setMaxDamage(0); 15 | } 16 | 17 | @Override 18 | public int getMetadata(int meta) 19 | { 20 | return meta; 21 | } 22 | 23 | @Override 24 | public String getUnlocalizedName(ItemStack itemstack) 25 | { 26 | int meta = 0; 27 | int damage = itemstack.getItemDamage(); 28 | 29 | if (BlockTankPart.isFrame(damage)) meta = 0; 30 | else if (BlockTankPart.isValve(damage)) meta = 1; 31 | else if (BlockTankPart.isEnergyInput(damage)) meta = 2; 32 | 33 | return ETBlocks.blockTankPart.getUnlocalizedName() + "." + meta; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/multiblock/rectangular/PartPosition.java: -------------------------------------------------------------------------------- 1 | package io.endertech.multiblock.rectangular; 2 | 3 | public enum PartPosition 4 | { 5 | Unknown, 6 | Interior, 7 | FrameCorner, 8 | Frame, 9 | TopFace, 10 | BottomFace, 11 | NorthFace, 12 | SouthFace, 13 | EastFace, 14 | WestFace; 15 | 16 | public boolean isFace(PartPosition position) 17 | { 18 | switch (position) 19 | { 20 | case TopFace: 21 | case BottomFace: 22 | case NorthFace: 23 | case SouthFace: 24 | case EastFace: 25 | case WestFace: 26 | return true; 27 | default: 28 | return false; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/multiblock/tile/TileTankGlass.java: -------------------------------------------------------------------------------- 1 | package io.endertech.multiblock.tile; 2 | 3 | import cpw.mods.fml.common.registry.GameRegistry; 4 | import io.endertech.multiblock.MultiblockValidationException; 5 | import io.endertech.reference.Strings; 6 | 7 | public class TileTankGlass extends TileTankPart 8 | { 9 | public static void init() 10 | { 11 | GameRegistry.registerTileEntity(TileTankGlass.class, "tile.endertech." + Strings.Blocks.MULTIBLOCK_GLASS_NAME); 12 | } 13 | 14 | @Override 15 | public void isGoodForFrame() throws MultiblockValidationException 16 | { 17 | throw new MultiblockValidationException("Tank glass cannot be used for tank frame (only the top, bottom and sides)."); 18 | } 19 | 20 | @Override 21 | public void isGoodForSides() throws MultiblockValidationException 22 | { 23 | 24 | } 25 | 26 | @Override 27 | public void isGoodForTop() throws MultiblockValidationException 28 | { 29 | 30 | } 31 | 32 | @Override 33 | public void isGoodForBottom() throws MultiblockValidationException 34 | { 35 | 36 | } 37 | 38 | @Override 39 | public void isGoodForInterior() throws MultiblockValidationException 40 | { 41 | throw new MultiblockValidationException("Tank glass cannot be used for tank interior (only the top, bottom and sides)."); 42 | } 43 | 44 | @Override 45 | public void onMachineActivated() 46 | { 47 | 48 | } 49 | 50 | @Override 51 | public void onMachineDeactivated() 52 | { 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/network/ITilePacketHandler.java: -------------------------------------------------------------------------------- 1 | package io.endertech.network; 2 | 3 | // Derived from CoFH's ITilePacketHandler 4 | 5 | public interface ITilePacketHandler 6 | { 7 | public void handleTilePacket(PacketETBase payload, boolean isServer); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/network/PacketBase.java: -------------------------------------------------------------------------------- 1 | package io.endertech.network; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import io.netty.channel.ChannelHandlerContext; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | 7 | // Derived from CoFH's PacketBase 8 | 9 | public abstract class PacketBase 10 | { 11 | public abstract void encodeInto(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf); 12 | 13 | public abstract void decodeInto(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf); 14 | 15 | public abstract void handleClientSide(EntityPlayer entityPlayer); 16 | 17 | public abstract void handleServerSide(EntityPlayer entityPlayer); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/network/PacketKeyPressed.java: -------------------------------------------------------------------------------- 1 | package io.endertech.network; 2 | 3 | import io.endertech.item.IKeyHandler; 4 | import io.endertech.util.Key; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | 7 | public class PacketKeyPressed extends PacketETBase 8 | { 9 | public static void init() 10 | { 11 | PacketHandler.instance.registerPacket(PacketKeyPressed.class); 12 | } 13 | 14 | public void handlePacket(EntityPlayer entityPlayer, boolean isServer) 15 | { 16 | if (entityPlayer.getCurrentEquippedItem() != null && entityPlayer.getCurrentEquippedItem().getItem() instanceof IKeyHandler) 17 | { 18 | ((IKeyHandler) entityPlayer.getCurrentEquippedItem().getItem()).handleKey(entityPlayer, entityPlayer.getCurrentEquippedItem(), Key.fromByte(this.getByte())); 19 | } 20 | } 21 | 22 | public void sendKeyPressedPacket(Key.KeyCode keyCode) 23 | { 24 | addByte(Key.toByte(keyCode)); 25 | PacketHandler.sendToServer(this); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/network/PacketTile.java: -------------------------------------------------------------------------------- 1 | package io.endertech.network; 2 | 3 | // Derived from CoFH's PacketTile 4 | 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.tileentity.TileEntity; 7 | 8 | public class PacketTile extends PacketETBase 9 | { 10 | public PacketTile() { } 11 | 12 | public PacketTile(TileEntity theTile) 13 | { 14 | addInt(theTile.xCoord); 15 | addInt(theTile.yCoord); 16 | addInt(theTile.zCoord); 17 | } 18 | 19 | public static void init() 20 | { 21 | PacketHandler.instance.registerPacket(PacketTile.class); 22 | } 23 | 24 | public static PacketTile newPacket(TileEntity theTile) 25 | { 26 | return new PacketTile(theTile); 27 | } 28 | 29 | @Override 30 | public void handleClientSide(EntityPlayer player) 31 | { 32 | handlePacket(player, false); 33 | } 34 | 35 | @Override 36 | public void handleServerSide(EntityPlayer player) 37 | { 38 | handlePacket(player, true); 39 | } 40 | 41 | @Override 42 | public void handlePacket(EntityPlayer player, boolean isServer) 43 | { 44 | TileEntity tile = player.worldObj.getTileEntity(getInt(), getInt(), getInt()); 45 | 46 | if (tile instanceof ITilePacketHandler) 47 | { 48 | ((ITilePacketHandler) tile).handleTilePacket(this, isServer); 49 | } else 50 | { 51 | // TODO: Throw error, bad packet 52 | } 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/reference/Reference.java: -------------------------------------------------------------------------------- 1 | package io.endertech.reference; 2 | 3 | public class Reference 4 | { 5 | public static final String MOD_ID = "EnderTech"; 6 | public static final String CHANNEL_NAME = MOD_ID; 7 | public static final String MOD_NAME = "EnderTech"; 8 | public static final String VERSION_NUMBER = "@VERSION@"; 9 | public static final String FINGERPRINT = "@FINGERPRINT@"; 10 | public static final int ONE_SECOND_IN_TICKS = 20; 11 | public static final int NETWORK_UPDATE_RANGE = 192; // CoFH default 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/reference/Strings.java: -------------------------------------------------------------------------------- 1 | package io.endertech.reference; 2 | 3 | public class Strings 4 | { 5 | public static final String EXCHANGER_BASE = "exchanger"; 6 | public static final String EXCHANGER_REDSTONE = "exchangerRedstone"; 7 | public static final String EXCHANGER_RESONANT = "exchangerResonant"; 8 | public static final String EXCHANGER_CREATIVE = "exchangerCreative"; 9 | public static final String CREATIVE_TAB_ET = "EnderTechAll"; 10 | 11 | public static final class Keys 12 | { 13 | public static final String keyToolIncreaseDescription = "Tool Increase"; 14 | public static final String keyToolDecreaseDescription = "Tool Decrease"; 15 | } 16 | 17 | public static final class Blocks 18 | { 19 | public static final String SPINNING_CUBE_NAME = "spinningCube"; 20 | public static final String CHARGE_PAD = "chargePad"; 21 | public static final String HEALTH_PAD = "healthPad"; 22 | public static final String TANK_PART_NAME = "enderTankPart"; 23 | public static final String MULTIBLOCK_GLASS_NAME = "multiblockGlass"; 24 | public static final String TANK_VALVE_NAME = "enderTankValve"; 25 | public static final String TANK_CONTROLLER_NAME = "enderTankController"; 26 | public static final String TANK_ENERGY_INPUT_NAME = "enderTankEnergyInput"; 27 | public static final String FLUID_CHARGED_ENDER_NAME = "fluid.chargedEnder"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/reference/Textures.java: -------------------------------------------------------------------------------- 1 | package io.endertech.reference; 2 | 3 | public class Textures 4 | { 5 | public static final String ENDER_RESONANT_BASE = "endertech:machines/Machine_Resonant_"; 6 | public static final String REDSTONE_TEXTURE_BASE = "endertech:machines/Machine_Redstone_"; 7 | public static final String CREATIVE_TEXTURE_BASE = "endertech:machines/Machine_Creative_"; 8 | public static final String TE3_TEXTURE_BASE = "thermalexpansion:machine/Machine_"; 9 | public static final String CHARGE_PAD_BASE = "endertech:chargepad/ChargePad_"; 10 | public static final String HEALTH_PAD_BASE = "endertech:healthpad/HealthPad_"; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/ETItemWrapper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util; 2 | 3 | import cofh.lib.util.helpers.ItemHelper; 4 | import net.minecraft.item.Item; 5 | import net.minecraft.item.ItemStack; 6 | 7 | // Derived from CoFHLib's ItemWrapper 8 | 9 | public final class ETItemWrapper 10 | { 11 | 12 | public Item item; 13 | public int metadata; 14 | 15 | public ETItemWrapper(Item item, int metadata) 16 | { 17 | 18 | this.item = item; 19 | this.metadata = metadata; 20 | } 21 | 22 | public ETItemWrapper(ItemStack stack) 23 | { 24 | 25 | this.item = stack.getItem(); 26 | this.metadata = ItemHelper.getItemDamage(stack); 27 | } 28 | 29 | public static ETItemWrapper fromItemStack(ItemStack stack) 30 | { 31 | 32 | return new ETItemWrapper(stack); 33 | } 34 | 35 | public ETItemWrapper set(ItemStack stack) 36 | { 37 | 38 | if (stack != null) 39 | { 40 | this.item = stack.getItem(); 41 | this.metadata = ItemHelper.getItemDamage(stack); 42 | } else 43 | { 44 | this.item = null; 45 | this.metadata = 0; 46 | } 47 | return this; 48 | } 49 | 50 | public boolean isEqual(ETItemWrapper other) 51 | { 52 | 53 | return other != null && item == other.item && metadata == other.metadata; 54 | } 55 | 56 | @Override 57 | public boolean equals(Object o) 58 | { 59 | 60 | if (!(o instanceof ETItemWrapper)) 61 | { 62 | return false; 63 | } 64 | return isEqual((ETItemWrapper) o); 65 | } 66 | 67 | @Override 68 | public int hashCode() 69 | { 70 | return metadata | item.getUnlocalizedName().hashCode() << 16; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/IChargeableFromSlot.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util; 2 | 3 | import cofh.api.energy.IEnergyStorage; 4 | 5 | public interface IChargeableFromSlot extends IEnergyStorage 6 | { 7 | public int getChargeSlot(); 8 | 9 | public boolean hasChargeSlot(); 10 | 11 | public void chargeFromGUISlot(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/IETWailaProvider.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import java.util.List; 5 | 6 | public interface IETWailaProvider 7 | { 8 | public ItemStack getWailaStack(); 9 | 10 | public List getWailaHead(ItemStack itemStack, List currenttip); 11 | 12 | public List getWailaBody(ItemStack itemStack, List currenttip); 13 | 14 | public List getWailaTail(ItemStack itemStack, List currenttip); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/IItemBlockAffector.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.world.World; 5 | import net.minecraftforge.common.util.ForgeDirection; 6 | import java.util.Set; 7 | 8 | public interface IItemBlockAffector 9 | { 10 | public Set blocksAffected(ItemStack item, World world, BlockCoord origin, ForgeDirection side); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/IOutlineDrawer.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util; 2 | 3 | import net.minecraftforge.client.event.DrawBlockHighlightEvent; 4 | 5 | public interface IOutlineDrawer 6 | { 7 | public boolean drawOutline(DrawBlockHighlightEvent event); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/Key.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util; 2 | 3 | public class Key 4 | { 5 | public static KeyCode[] keyCodes = KeyCode.values(); 6 | 7 | public static KeyCode fromByte(byte keyCode) 8 | { 9 | return keyCodes[keyCode]; 10 | } 11 | 12 | public static byte toByte(KeyCode key) 13 | { 14 | return (byte) key.ordinal(); 15 | } 16 | 17 | public static enum KeyCode 18 | { 19 | TOOL_INCREASE, 20 | TOOL_DECREASE, 21 | UNKNOWN 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/RGBA.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util; 2 | 3 | public class RGBA 4 | { 5 | public static final RGBA Red = new RGBA(1.0f, 0.0f, 0.0f, 1.0f); 6 | public static final RGBA Green = new RGBA(0.0f, 1.0f, 0.0f, 1.0f); 7 | public static final RGBA Blue = new RGBA(0.0f, 0.0f, 1.0f, 1.0f); 8 | public static final RGBA White = new RGBA(1.0f, 1.0f, 1.0f, 1.0f); 9 | public static final RGBA Black = new RGBA(0.0f, 0.0f, 0.0f, 1.0f); 10 | 11 | public float red = 0.0f; 12 | public float green = 0.0f; 13 | public float blue = 0.0f; 14 | public float alpha = 0.0f; 15 | 16 | public RGBA(float red, float green, float blue, float alpha) 17 | { 18 | this.red = red; 19 | this.green = green; 20 | this.blue = blue; 21 | this.alpha = alpha; 22 | } 23 | 24 | public RGBA copy() 25 | { 26 | return new RGBA(this.red, this.green, this.blue, this.alpha); 27 | } 28 | 29 | public RGBA setAlpha(float alpha) 30 | { 31 | RGBA copy = this.copy(); 32 | copy.alpha = alpha; 33 | return copy; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/FontHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | import net.minecraft.client.gui.FontRenderer; 4 | import org.lwjgl.opengl.GL11; 5 | 6 | public class FontHelper 7 | { 8 | public static void drawItemQuantity(FontRenderer fontRenderer, int x, int y, String quantity) 9 | { 10 | double scale = quantity.length() > 2 ? 0.5 : 1; 11 | double sheight = 8 * scale; 12 | double swidth = fontRenderer.getStringWidth(quantity) * scale; 13 | 14 | renderText(fontRenderer, (int) (x + 16 - swidth), (int) (y + 16 - sheight), scale, quantity); 15 | } 16 | 17 | public static void renderText(FontRenderer fontRenderer, int x, int y, double scale, String text) 18 | { 19 | GL11.glDisable(GL11.GL_LIGHTING); 20 | GL11.glDisable(GL11.GL_DEPTH_TEST); 21 | GL11.glPushMatrix(); 22 | GL11.glTranslated(x, y, 0); 23 | GL11.glScaled(scale, scale, 1); 24 | fontRenderer.drawStringWithShadow(text, 0, 0, 0xFFFFFF); 25 | GL11.glPopMatrix(); 26 | GL11.glEnable(GL11.GL_LIGHTING); 27 | GL11.glEnable(GL11.GL_DEPTH_TEST); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/KeyHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | import org.lwjgl.input.Keyboard; 4 | 5 | public class KeyHelper 6 | { 7 | public static boolean isShiftDown() 8 | { 9 | return (Keyboard.isKeyDown(42) || (Keyboard.isKeyDown(54))); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/LocalisationHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | import net.minecraft.util.StatCollector; 4 | 5 | public class LocalisationHelper 6 | { 7 | public static String localiseString(String format, Object... data) 8 | { 9 | return StatCollector.translateToLocalFormatted(format, data); 10 | } 11 | } -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/LogHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | import io.endertech.reference.Reference; 4 | import org.apache.logging.log4j.Level; 5 | import org.apache.logging.log4j.LogManager; 6 | import org.apache.logging.log4j.Logger; 7 | 8 | public class LogHelper 9 | { 10 | private static final Logger logger = LogManager.getLogger(Reference.MOD_ID); 11 | 12 | public static void log(Level logLevel, String format, Object... data) { logger.log(logLevel, format, data); } 13 | 14 | public static void debug(String format, Object... data) 15 | { 16 | log(Level.DEBUG, format, data); 17 | } 18 | 19 | public static void error(String format, Object... data) 20 | { 21 | log(Level.ERROR, format, data); 22 | } 23 | 24 | public static void fatal(String format, Object... data) 25 | { 26 | log(Level.FATAL, format, data); 27 | } 28 | 29 | public static void info(String format, Object... data) 30 | { 31 | log(Level.INFO, format, data); 32 | } 33 | 34 | public static void warn(String format, Object... data) 35 | { 36 | log(Level.WARN, format, data); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/ModuleHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | //import io.drakon.pulsar.control.PulseManager; 4 | import io.endertech.EnderTech; 5 | import io.endertech.modules.dev.DevEnvironmentPulse; 6 | import static io.endertech.reference.Reference.MOD_ID; 7 | 8 | /** 9 | * Helper to connect to Project Pulsar. 10 | * 11 | * @author Arkan 12 | */ 13 | public class ModuleHelper 14 | { 15 | //public static final PulseManager pulsar = new PulseManager(MOD_ID, MOD_ID + "-Modules"); 16 | private static boolean modulesConfigured = false; 17 | 18 | private ModuleHelper() {} // No touchy. 19 | 20 | public static void setupModules() 21 | { 22 | if (modulesConfigured) throw new RuntimeException("Someone called ModuleHelper.setupModules() again!"); 23 | 24 | if (EnderTech.loadDevModeContent) 25 | { 26 | //pulsar.registerPulse(new DevEnvironmentPulse()); 27 | } 28 | 29 | modulesConfigured = true; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/NBTHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraft.nbt.NBTTagList; 6 | 7 | public class NBTHelper 8 | { 9 | public static ItemStack[] readInventoryFromNBT(NBTTagCompound nbtTagCompound, int numberOfItems) 10 | { 11 | NBTTagList nbtTagList = nbtTagCompound.getTagList("Inventory", 10); 12 | ItemStack[] inventory = new ItemStack[numberOfItems]; 13 | for (int i = 0; i < nbtTagList.tagCount(); i++) 14 | { 15 | NBTTagCompound nbtTagCompoundSlot = nbtTagList.getCompoundTagAt(i); 16 | int j = nbtTagCompoundSlot.getInteger("Slot"); 17 | 18 | if ((j >= 0) && (j < numberOfItems)) inventory[j] = ItemStack.loadItemStackFromNBT(nbtTagCompoundSlot); 19 | } 20 | return inventory; 21 | } 22 | 23 | public static void writeInventoryToNBT(NBTTagCompound nbtTagCompound, ItemStack[] inventory) 24 | { 25 | NBTTagList nbtTagList = new NBTTagList(); 26 | for (int i = 0; i < inventory.length; i++) 27 | { 28 | if (inventory[i] != null) 29 | { 30 | NBTTagCompound nbtTagCompoundSlot = new NBTTagCompound(); 31 | nbtTagCompoundSlot.setInteger("Slot", i); 32 | inventory[i].writeToNBT(nbtTagCompoundSlot); 33 | nbtTagList.appendTag(nbtTagCompoundSlot); 34 | } 35 | } 36 | nbtTagCompound.setTag("Inventory", nbtTagList); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/StringHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | import net.minecraft.util.EnumChatFormatting; 4 | import net.minecraftforge.fluids.FluidStack; 5 | import java.text.DecimalFormat; 6 | 7 | public class StringHelper 8 | { 9 | public static final String holdShiftForDetails = EnumChatFormatting.GRAY + LocalisationHelper.localiseString("info.hold_for_details.hold") + " " + EnumChatFormatting.YELLOW + EnumChatFormatting.ITALIC + LocalisationHelper.localiseString("info.hold_for_details.shift") + EnumChatFormatting.RESET + " " + EnumChatFormatting.GRAY + LocalisationHelper.localiseString("info.hold_for_details.for_details") + EnumChatFormatting.RESET; 10 | public static DecimalFormat twoDP = new DecimalFormat("#.##"); 11 | 12 | public static String getEnergyString(int energy) 13 | { 14 | if (energy == Integer.MAX_VALUE) return LocalisationHelper.localiseString("info.infinite"); 15 | 16 | if (energy >= 1000000) 17 | { 18 | return String.valueOf(twoDP.format(energy / 1000000.0)) + "M"; 19 | } else if (energy >= 1000) 20 | { 21 | return String.valueOf(energy / 1000) + "k"; 22 | } else 23 | { 24 | return String.valueOf(energy); 25 | } 26 | } 27 | 28 | public static String getFluidName(FluidStack fluidStack) 29 | { 30 | return cofh.lib.util.helpers.StringHelper.getFluidName(fluidStack); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/TextureHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | public class TextureHelper 4 | { 5 | public static String metaToType(int meta) 6 | { 7 | if (meta == 0) return "Creative"; 8 | else if (meta == 1) return "Redstone"; 9 | else if (meta == 2) return "Resonant"; 10 | 11 | return "Unknown"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/helper/WorldHelper.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.helper; 2 | 3 | import net.minecraft.entity.item.EntityItem; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraft.world.World; 6 | 7 | public class WorldHelper 8 | { 9 | public static void spawnItemInWorldWithRandomness(ItemStack item, World world, float blockOffset, int x, int y, int z, int pickupDelay) 10 | { 11 | double d1 = world.rand.nextFloat() * blockOffset + (1.0F - blockOffset) * 0.5D; 12 | double d2 = world.rand.nextFloat() * blockOffset + (1.0F - blockOffset) * 0.5D; 13 | double d3 = world.rand.nextFloat() * blockOffset + (1.0F - blockOffset) * 0.5D; 14 | EntityItem localEntityItem = new EntityItem(world, x + d1, y + d2, z + d3, item); 15 | localEntityItem.delayBeforeCanPickup = pickupDelay; 16 | world.spawnEntityInWorld(localEntityItem); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/io/endertech/util/teleport/ETTeleporter.java: -------------------------------------------------------------------------------- 1 | package io.endertech.util.teleport; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.world.Teleporter; 5 | import net.minecraft.world.WorldServer; 6 | 7 | public class ETTeleporter extends Teleporter 8 | { 9 | private double x; 10 | private double y; 11 | private double z; 12 | 13 | public ETTeleporter(WorldServer worldServer, double x, double y, double z) 14 | { 15 | super(worldServer); 16 | this.setTarget(x, y, z); 17 | } 18 | 19 | public void setTarget(double x, double y, double z) 20 | { 21 | this.x = x; 22 | this.y = y; 23 | this.z = z; 24 | } 25 | 26 | @Override 27 | public void placeInPortal(Entity entity, double x, double y, double z, float rotationYaw) 28 | { 29 | entity.setLocationAndAngles(this.x, this.y, this.z, rotationYaw, 0); 30 | } 31 | 32 | // Below overriden to make sure nothing gets created in the world 33 | 34 | @Override 35 | public boolean placeInExistingPortal(Entity entity, double x, double y, double z, float p_77184_8_) 36 | { 37 | return true; 38 | } 39 | 40 | @Override 41 | public boolean makePortal(Entity entity) 42 | { 43 | return true; 44 | } 45 | 46 | @Override 47 | public void removeStalePortalLocations(long p_85189_1_) 48 | { 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/lang/ko_KR.lang: -------------------------------------------------------------------------------- 1 | # Note: these are GB spellings by default 2 | 3 | # Item localisations 4 | item.endertech.exchanger.exchangerRedstone.name=레드스톤 교환기 5 | item.endertech.exchanger.exchangerResonant.name=공진 교환기 6 | item.endertech.exchanger.exchangerCreative.name=크리에이티브 교환기 7 | 8 | # Creative tab 9 | itemGroup.EnderTechAll=엔더테크 : ALL 10 | 11 | # Blocks 12 | tile.enderTank.name=엔더탱크 13 | tile.chargedPlane.0.name=Charged Plane 14 | tile.enderTankPart.0.name=엔더탱크 틀 15 | tile.enderTankPart.1.name=엔더탱크 밸브 16 | tile.enderTankPart.2.name=엔더탱크 에너지 입력 17 | tile.enderTankController.0.name=엔더탱크 제어기 18 | tile.multiblockGlass.0.name=엔더탱크 유리 19 | 20 | tile.chargePad.0.name=크리에이티브 차지패드 21 | tile.chargePad.1.name=레드스톤 차지패드 22 | tile.chargePad.2.name=공진 차지패드 23 | 24 | # Fluids 25 | tile.fluid.chargePad.0.name=충전된 엔더 26 | fluid.chargedEnder=충전된 엔더 27 | item.endertech.bucket.bucketChargedEnder.name=충전된 엔더 양동이 28 | -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Creative_Active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Creative_Active.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Creative_Inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Creative_Inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Redstone_Active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Redstone_Active.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Redstone_Inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Redstone_Inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Resonant_Active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Resonant_Active.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Resonant_Inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/chargepad/ChargePad_Resonant_Inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankController.controllerActive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankController.controllerActive.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankController.controllerBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankController.controllerBase.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankController.controllerIdle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankController.controllerIdle.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.energyInput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.energyInput.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameBase.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameCenter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameCenter.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameCorner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameCorner.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameDefault.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameDefault.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameEastWest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameEastWest.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameNorthSouth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameNorthSouth.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameVertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.frameVertical.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/enderTankPart.valve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/enderTankPart.valve.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/fluids/charged_ender_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/fluids/charged_ender_flow.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/fluids/charged_ender_flow.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 3 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/fluids/charged_ender_still.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/fluids/charged_ender_still.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/fluids/charged_ender_still.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 2, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 10, 16 | 11, 17 | 12, 18 | 13, 19 | 14, 20 | 15, 21 | 16, 22 | 17, 23 | 18, 24 | 19, 25 | 18, 26 | 17, 27 | 16, 28 | 15, 29 | 14, 30 | 13, 31 | 12, 32 | 11, 33 | 10, 34 | 9, 35 | 8, 36 | 7, 37 | 6, 38 | 5, 39 | 4, 40 | 3, 41 | 2, 42 | 1 43 | ] 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Creative_Active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Creative_Active.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Creative_Inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Creative_Inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Redstone_Active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Redstone_Active.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Redstone_Inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Redstone_Inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Resonant_Active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Resonant_Active.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Resonant_Inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/healthpad/HealthPad_Resonant_Inactive.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Creative_Bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Creative_Bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Creative_Side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Creative_Side.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Creative_Top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Creative_Top.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Redstone_Bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Redstone_Bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Redstone_Side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Redstone_Side.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Redstone_Top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Redstone_Top.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Resonant_Bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Resonant_Bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Resonant_Side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Resonant_Side.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/machines/Machine_Resonant_Top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/machines/Machine_Resonant_Top.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.bl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.bl.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.br.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.br.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.tl.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.anticorner.tr.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.bottom.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.central.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.central.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.left.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.right.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/multiblockGlass.tank.top.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/blocks/particles/health.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/blocks/particles/health.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/gui/BasicBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/gui/BasicBackground.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/gui/BasicInventoryBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/gui/BasicInventoryBackground.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/gui/ChargePad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/gui/ChargePad.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/gui/Tank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/gui/Tank.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/bucket/bucketChargedEnder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/bucket/bucketChargedEnder.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/bucket/bucketChargedEnder.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 3, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6, 12 | 7, 13 | 8, 14 | 9, 15 | 8, 16 | 7, 17 | 6, 18 | 5, 19 | 4, 20 | 3, 21 | 2, 22 | 1 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/bucket/bucketMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/bucket/bucketMask.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimCreative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimCreative.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimCreative.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 1, 6 | 2, 7 | 3, 8 | 4, 9 | 5, 10 | 6, 11 | 0 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimRedstone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimRedstone.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimRedstone.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 0, 6 | 1, 7 | 2, 8 | 3, 9 | 4, 10 | 5, 11 | 6 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimResonant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimResonant.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerAnimResonant.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "animation": { 3 | "frametime": 4, 4 | "frames": [ 5 | 2, 6 | 3, 7 | 4, 8 | 5, 9 | 6, 10 | 0, 11 | 1 12 | ] 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerBase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/exchanger/exchangerBase.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerCreative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/exchanger/exchangerCreative.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerRedstone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/exchanger/exchangerRedstone.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/items/exchanger/exchangerResonant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/items/exchanger/exchangerResonant.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/logo.png -------------------------------------------------------------------------------- /src/main/resources/assets/endertech/textures/logo_whitebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lopcode/EnderTech/03dadbaad94c5bcaa5aa431dcc9f9f07f09a847f/src/main/resources/assets/endertech/textures/logo_whitebg.png -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [{ 2 | "modid": "EnderTech", 3 | "name": "EnderTech", 4 | "description": "Ender themed technological expansion.", 5 | "version": "${version}", 6 | "mcversion": "${mcversion}", 7 | "url": "https://github.com/carrotengineer/EnderTech", 8 | "updateUrl": "", 9 | "authorList": ["voxelcarrot", "Arkan"], 10 | "credits": "voxelcarrot, Arkan", 11 | "logoFile": "assets/endertech/textures/logo.png", 12 | "screenshots": [], 13 | "parent": "", 14 | "requiredMods": [], 15 | "dependencies": [], 16 | "dependants": [], 17 | "useDependencyInformation": "false" 18 | }] 19 | -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack":{ 3 | "pack_format":1, 4 | "description":"EnderTech contents" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/version.properties: -------------------------------------------------------------------------------- 1 | version=${version} 2 | build_number=${build_number} -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/CoFHAPIProps.java: -------------------------------------------------------------------------------- 1 | package cofh.api; 2 | 3 | public class CoFHAPIProps { 4 | 5 | private CoFHAPIProps() { 6 | 7 | } 8 | 9 | public static final String VERSION = "1.7.10R1.1.0"; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/block/IBlockAppearance.java: -------------------------------------------------------------------------------- 1 | package cofh.api.block; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.world.IBlockAccess; 5 | import net.minecraftforge.common.util.ForgeDirection; 6 | 7 | /** 8 | * Implement this interface on blocks that can mimic the appearance of other blocks. Note that this is meant to be available server-side, so ensure the code is 9 | * server-safe and doesn't use client-side code. 10 | * 11 | */ 12 | public interface IBlockAppearance { 13 | 14 | /** 15 | * This function returns the block that is being shown on a given side. 16 | * 17 | * @param world 18 | * Reference to the world. 19 | * @param x 20 | * X coordinate of the block. 21 | * @param y 22 | * Y coordinate of the block. 23 | * @param z 24 | * Z coordinate of the block. 25 | * @param side 26 | * The side of the block. 27 | */ 28 | public Block getVisualBlock(IBlockAccess world, int x, int y, int z, ForgeDirection side); 29 | 30 | /** 31 | * This function returns metadata of the block that is being shown on a given side. 32 | * 33 | * @param world 34 | * Reference to the world. 35 | * @param x 36 | * X coordinate of the block. 37 | * @param y 38 | * Y coordinate of the block. 39 | * @param z 40 | * Z coordinate of the block. 41 | * @param side 42 | * The side of the block. 43 | */ 44 | public int getVisualMeta(IBlockAccess world, int x, int y, int z, ForgeDirection side); 45 | 46 | /** 47 | * This function returns whether the block's renderer will visually connect to other blocks implementing IBlockAppearance. 48 | */ 49 | public boolean supportsVisualConnections(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/block/IBlockConfigGui.java: -------------------------------------------------------------------------------- 1 | package cofh.api.block; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.world.IBlockAccess; 5 | import net.minecraftforge.common.util.ForgeDirection; 6 | 7 | /** 8 | * Implement this interface on blocks which have a GUI that needs a tool (e.g., multimeter) to open. 9 | * 10 | */ 11 | public interface IBlockConfigGui { 12 | 13 | /** 14 | * This function will open a GUI if the player has permission. 15 | * 16 | * @param world 17 | * Reference to the world. 18 | * @param x 19 | * X coordinate of the block. 20 | * @param y 21 | * Y coordinate of the block. 22 | * @param z 23 | * Z coordinate of the block. 24 | * @param side 25 | * The side of the block. 26 | * @param player 27 | * Player doing the configuring. 28 | * @return True if the GUI was opened. 29 | */ 30 | public boolean openConfigGui(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player); 31 | } 32 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/block/IBlockDebug.java: -------------------------------------------------------------------------------- 1 | package cofh.api.block; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.world.IBlockAccess; 5 | import net.minecraftforge.common.util.ForgeDirection; 6 | 7 | /** 8 | * Implement this interface on blocks which have some debug method which can be activated via a tool or other means. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface IBlockDebug { 14 | 15 | /** 16 | * This function debugs a block. 17 | * 18 | * @param world 19 | * Reference to the world. 20 | * @param x 21 | * X coordinate of the block. 22 | * @param y 23 | * Y coordinate of the block. 24 | * @param z 25 | * Z coordinate of the block. 26 | * @param side 27 | * The side of the block. 28 | * @param player 29 | * Player doing the debugging. 30 | */ 31 | void debugBlock(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/block/IBlockInfo.java: -------------------------------------------------------------------------------- 1 | package cofh.api.block; 2 | 3 | import cofh.api.tileentity.ITileInfo; 4 | 5 | import java.util.List; 6 | 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.util.IChatComponent; 9 | import net.minecraft.world.IBlockAccess; 10 | import net.minecraftforge.common.util.ForgeDirection; 11 | 12 | /** 13 | * Implement this interface on blocks which can provide information about themselves. If the block contains Tile Entities, then it is recommended that this 14 | * function serve as a passthrough for {@link ITileInfo}. 15 | * 16 | * @author King Lemming 17 | * 18 | */ 19 | public interface IBlockInfo { 20 | 21 | /** 22 | * This function appends information to a list provided to it. 23 | * 24 | * @param world 25 | * Reference to the world. 26 | * @param x 27 | * X coordinate of the block. 28 | * @param y 29 | * Y coordinate of the block. 30 | * @param z 31 | * Z coordinate of the block. 32 | * @param side 33 | * The side of the block that is being queried. 34 | * @param player 35 | * Player doing the querying - this can be NULL. 36 | * @param info 37 | * The list that the information should be appended to. 38 | * @param debug 39 | * If true, the block should return "debug" information. 40 | */ 41 | void getBlockInfo(IBlockAccess world, int x, int y, int z, ForgeDirection side, EntityPlayer player, List info, boolean debug); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/block/IDismantleable.java: -------------------------------------------------------------------------------- 1 | package cofh.api.block; 2 | 3 | import java.util.ArrayList; 4 | 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.world.World; 8 | 9 | /** 10 | * Implemented on Blocks which have some method of being instantly dismantled. 11 | * 12 | * @author King Lemming 13 | * 14 | */ 15 | public interface IDismantleable { 16 | 17 | /** 18 | * Dismantles the block. If returnDrops is true, the drop(s) should be placed into the player's inventory. 19 | */ 20 | ArrayList dismantleBlock(EntityPlayer player, World world, int x, int y, int z, boolean returnDrops); 21 | 22 | /** 23 | * Return true if the block can be dismantled. The criteria for this is entirely up to the block. 24 | */ 25 | boolean canDismantle(EntityPlayer player, World world, int x, int y, int z); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/block/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|block") 6 | package cofh.api.block; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/core/ICustomInventory.java: -------------------------------------------------------------------------------- 1 | package cofh.api.core; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * Interface to allow a Container to interact with a secondary inventory. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface ICustomInventory { 12 | 13 | ItemStack[] getInventorySlots(int inventoryIndex); 14 | 15 | int getSlotStackLimit(int slotIndex); 16 | 17 | void onSlotUpdate(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/core/IInitializer.java: -------------------------------------------------------------------------------- 1 | package cofh.api.core; 2 | 3 | /** 4 | * Interface which can be put on just about anything to allow for iteration during initialization. 5 | * 6 | * @author King Lemming 7 | * 8 | */ 9 | public interface IInitializer { 10 | 11 | boolean preInit(); 12 | 13 | boolean initialize(); 14 | 15 | boolean postInit(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|core") 6 | package cofh.api.core; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/energy/IEnergyConnection.java: -------------------------------------------------------------------------------- 1 | package cofh.api.energy; 2 | 3 | import net.minecraftforge.common.util.ForgeDirection; 4 | 5 | /** 6 | * Implement this interface on TileEntities which should connect to energy transportation blocks. This is intended for blocks which generate energy but do not 7 | * accept it; otherwise just use IEnergyHandler. 8 | *

9 | * Note that {@link IEnergyHandler} is an extension of this. 10 | * 11 | * @author King Lemming 12 | * 13 | */ 14 | public interface IEnergyConnection { 15 | 16 | /** 17 | * Returns TRUE if the TileEntity can connect on a given side. 18 | */ 19 | boolean canConnectEnergy(ForgeDirection from); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/energy/IEnergyProvider.java: -------------------------------------------------------------------------------- 1 | package cofh.api.energy; 2 | 3 | import net.minecraftforge.common.util.ForgeDirection; 4 | 5 | /** 6 | * Implement this interface on Tile Entities which should provide energy, generally storing it in one or more internal {@link IEnergyStorage} objects. 7 | *

8 | * A reference implementation is provided {@link TileEnergyHandler}. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface IEnergyProvider extends IEnergyConnection { 14 | 15 | /** 16 | * Remove energy from an IEnergyProvider, internal distribution is left entirely to the IEnergyProvider. 17 | * 18 | * @param from 19 | * Orientation the energy is extracted from. 20 | * @param maxExtract 21 | * Maximum amount of energy to extract. 22 | * @param simulate 23 | * If TRUE, the extraction will only be simulated. 24 | * @return Amount of energy that was (or would have been, if simulated) extracted. 25 | */ 26 | int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate); 27 | 28 | /** 29 | * Returns the amount of energy currently stored. 30 | */ 31 | int getEnergyStored(ForgeDirection from); 32 | 33 | /** 34 | * Returns the maximum amount of energy that can be stored. 35 | */ 36 | int getMaxEnergyStored(ForgeDirection from); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/energy/IEnergyReceiver.java: -------------------------------------------------------------------------------- 1 | package cofh.api.energy; 2 | 3 | import net.minecraftforge.common.util.ForgeDirection; 4 | 5 | /** 6 | * Implement this interface on Tile Entities which should receive energy, generally storing it in one or more internal {@link IEnergyStorage} objects. 7 | *

8 | * A reference implementation is provided {@link TileEnergyHandler}. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface IEnergyReceiver extends IEnergyConnection { 14 | 15 | /** 16 | * Add energy to an IEnergyReceiver, internal distribution is left entirely to the IEnergyReceiver. 17 | * 18 | * @param from 19 | * Orientation the energy is received from. 20 | * @param maxReceive 21 | * Maximum amount of energy to receive. 22 | * @param simulate 23 | * If TRUE, the charge will only be simulated. 24 | * @return Amount of energy that was (or would have been, if simulated) received. 25 | */ 26 | int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate); 27 | 28 | /** 29 | * Returns the amount of energy currently stored. 30 | */ 31 | int getEnergyStored(ForgeDirection from); 32 | 33 | /** 34 | * Returns the maximum amount of energy that can be stored. 35 | */ 36 | int getMaxEnergyStored(ForgeDirection from); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/energy/IEnergyStorage.java: -------------------------------------------------------------------------------- 1 | package cofh.api.energy; 2 | 3 | /** 4 | * An energy storage is the unit of interaction with Energy inventories.
5 | * This is not to be implemented on TileEntities. This is for internal use only. 6 | *

7 | * A reference implementation can be found at {@link EnergyStorage}. 8 | * 9 | * @author King Lemming 10 | * 11 | */ 12 | public interface IEnergyStorage { 13 | 14 | /** 15 | * Adds energy to the storage. Returns quantity of energy that was accepted. 16 | * 17 | * @param maxReceive 18 | * Maximum amount of energy to be inserted. 19 | * @param simulate 20 | * If TRUE, the insertion will only be simulated. 21 | * @return Amount of energy that was (or would have been, if simulated) accepted by the storage. 22 | */ 23 | int receiveEnergy(int maxReceive, boolean simulate); 24 | 25 | /** 26 | * Removes energy from the storage. Returns quantity of energy that was removed. 27 | * 28 | * @param maxExtract 29 | * Maximum amount of energy to be extracted. 30 | * @param simulate 31 | * If TRUE, the extraction will only be simulated. 32 | * @return Amount of energy that was (or would have been, if simulated) extracted from the storage. 33 | */ 34 | int extractEnergy(int maxExtract, boolean simulate); 35 | 36 | /** 37 | * Returns the amount of energy currently stored. 38 | */ 39 | int getEnergyStored(); 40 | 41 | /** 42 | * Returns the maximum amount of energy that can be stored. 43 | */ 44 | int getMaxEnergyStored(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/energy/TileEnergyHandler.java: -------------------------------------------------------------------------------- 1 | package cofh.api.energy; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | import net.minecraft.tileentity.TileEntity; 5 | import net.minecraftforge.common.util.ForgeDirection; 6 | 7 | /** 8 | * Reference implementation of {@link IEnergyHandler}. Use/extend this or implement your own. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public class TileEnergyHandler extends TileEntity implements IEnergyHandler { 14 | 15 | protected EnergyStorage storage = new EnergyStorage(32000); 16 | 17 | @Override 18 | public void readFromNBT(NBTTagCompound nbt) { 19 | 20 | super.readFromNBT(nbt); 21 | storage.readFromNBT(nbt); 22 | } 23 | 24 | @Override 25 | public void writeToNBT(NBTTagCompound nbt) { 26 | 27 | super.writeToNBT(nbt); 28 | storage.writeToNBT(nbt); 29 | } 30 | 31 | /* IEnergyConnection */ 32 | @Override 33 | public boolean canConnectEnergy(ForgeDirection from) { 34 | 35 | return true; 36 | } 37 | 38 | /* IEnergyReceiver */ 39 | @Override 40 | public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) { 41 | 42 | return storage.receiveEnergy(maxReceive, simulate); 43 | } 44 | 45 | /* IEnergyProvider */ 46 | @Override 47 | public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) { 48 | 49 | return storage.extractEnergy(maxExtract, simulate); 50 | } 51 | 52 | /* IEnergyReceiver and IEnergyProvider */ 53 | @Override 54 | public int getEnergyStored(ForgeDirection from) { 55 | 56 | return storage.getEnergyStored(); 57 | } 58 | 59 | @Override 60 | public int getMaxEnergyStored(ForgeDirection from) { 61 | 62 | return storage.getMaxEnergyStored(); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/energy/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|energy") 6 | package cofh.api.energy; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/fluid/ITankContainerBucketable.java: -------------------------------------------------------------------------------- 1 | package cofh.api.fluid; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fluids.IFluidHandler; 5 | 6 | /** 7 | * Extends the IFluidHandler interface to allow manual draining/filling via buckets. 8 | * 9 | * @author Emy 10 | * 11 | */ 12 | public interface ITankContainerBucketable extends IFluidHandler { 13 | 14 | /** 15 | * Called to determine if the {@link IFluidHandler} should be filled by buckets. 16 | * 17 | * @param stack 18 | * The {@link ItemStack} being used to fill the IFluidHandler 19 | * @return True if the IFluidHandler is allowed to be filled with stack 20 | */ 21 | public boolean allowBucketFill(ItemStack stack); 22 | 23 | /** 24 | * Called to determine if the {@link IFluidHandler} should be drained by buckets. 25 | * 26 | * @param stack 27 | * The {@link ItemStack} being used to drain the IFluidHandler 28 | * @return True if the IFluidHandler is allowed to be drained with stack 29 | */ 30 | public boolean allowBucketDrain(ItemStack stack); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/fluid/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|fluid") 6 | package cofh.api.fluid; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/inventory/IInventoryConnection.java: -------------------------------------------------------------------------------- 1 | package cofh.api.inventory; 2 | 3 | import net.minecraftforge.common.util.ForgeDirection; 4 | 5 | /** 6 | * Implement this interface on TileEntities which should connect to item transportation blocks. 7 | */ 8 | public interface IInventoryConnection { 9 | 10 | /** 11 | * @param from 12 | * Side to which a connector would connect 13 | * @return DEFAULT if the connector should decide how to connect; FORCE if the connector should always connect; DENY if the connector should never connect. 14 | */ 15 | public ConnectionType canConnectInventory(ForgeDirection from); 16 | 17 | public static enum ConnectionType { 18 | DEFAULT, FORCE, DENY; 19 | 20 | public final boolean canConnect = ordinal() != 2; 21 | public final boolean forceConnect = ordinal() == 1; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/inventory/IInventoryRetainer.java: -------------------------------------------------------------------------------- 1 | package cofh.api.inventory; 2 | 3 | /** 4 | * Marks a block which will retain its inventory when broken. 5 | * 6 | * @author King Lemming 7 | * 8 | */ 9 | public interface IInventoryRetainer { 10 | 11 | // There's nothing else to go here at the moment. Potentially a conditional at a later date. 12 | } 13 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/inventory/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|inventory") 6 | package cofh.api.inventory; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/IAugmentItem.java: -------------------------------------------------------------------------------- 1 | package cofh.api.item; 2 | 3 | import java.util.Set; 4 | 5 | import net.minecraft.item.ItemStack; 6 | 7 | public interface IAugmentItem { 8 | 9 | /** 10 | * Get the augmentation level for a given Augment and Augment Type. 11 | * 12 | * @param stack 13 | * ItemStack representing the Augment. 14 | * @param type 15 | * String containing the Augment type name. 16 | * @return The Augment level of the stack for the requested type - 0 if it does not affect that attribute. 17 | */ 18 | int getAugmentLevel(ItemStack stack, String type); 19 | 20 | /** 21 | * Get the Augment Types for a given Augment. Set ensure that there are no duplicates. 22 | * 23 | * @param stack 24 | * ItemStack representing the Augment. 25 | * @return Set of the Augmentation Types. Should return an empty set if there are none (but this would be really stupid to make). DO NOT RETURN NULL. 26 | */ 27 | Set getAugmentTypes(ItemStack stack); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/IEmpowerableItem.java: -------------------------------------------------------------------------------- 1 | package cofh.api.item; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | 6 | /** 7 | * Implement this interface on Item classes which may be "Empowered" - what that means is completely up to you. This just provides a uniform way of dealing with 8 | * them. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface IEmpowerableItem { 14 | 15 | /** 16 | * Check whether or not a given item is currently in an empowered state. 17 | */ 18 | boolean isEmpowered(ItemStack stack); 19 | 20 | /** 21 | * Attempt to set the empowered state of the item. 22 | * 23 | * @param stack 24 | * ItemStack to be empowered/disempowered. 25 | * @param state 26 | * Desired state. 27 | * @return TRUE if the operation was successful, FALSE if it was not. 28 | */ 29 | boolean setEmpoweredState(ItemStack stack, boolean state); 30 | 31 | /** 32 | * Callback method for reacting to a state change. Useful in KeyBinding handlers. 33 | * 34 | * @param player 35 | * Player holding the item, if applicable. 36 | * @param stack 37 | * The item being held. 38 | */ 39 | void onStateChange(EntityPlayer player, ItemStack stack); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/IInventoryContainerItem.java: -------------------------------------------------------------------------------- 1 | package cofh.api.item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * Implement this interface on Item classes that are themselves inventories. 7 | * 8 | * A reference implementation is provided {@link ItemInventoryContainer}. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface IInventoryContainerItem { 14 | 15 | /** 16 | * Get the size of this inventory of this container item. 17 | */ 18 | int getSizeInventory(ItemStack container); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/IMultiModeItem.java: -------------------------------------------------------------------------------- 1 | package cofh.api.item; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | 6 | /** 7 | * Implement this interface on Item classes which may be "Empowered" - what that means is completely up to you. This just provides a uniform way of dealing with 8 | * them. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface IMultiModeItem { 14 | 15 | /** 16 | * Get the current mode of an item. 17 | */ 18 | int getMode(ItemStack stack); 19 | 20 | /** 21 | * Attempt to set the empowered state of the item. 22 | * 23 | * @param stack 24 | * ItemStack to set the mode on. 25 | * @param mode 26 | * Desired mode. 27 | * @return TRUE if the operation was successful, FALSE if it was not. 28 | */ 29 | boolean setMode(ItemStack stack, int mode); 30 | 31 | /** 32 | * Increment the current mode of an item. 33 | */ 34 | boolean incrMode(ItemStack stack); 35 | 36 | /** 37 | * Decrement the current mode of an item. 38 | */ 39 | boolean decrMode(ItemStack stack); 40 | 41 | /** 42 | * Returns the number of possible modes. 43 | */ 44 | int getNumModes(ItemStack stack); 45 | 46 | /** 47 | * Callback method for reacting to a state change. Useful in KeyBinding handlers. 48 | * 49 | * @param player 50 | * Player holding the item, if applicable. 51 | * @param stack 52 | * The item being held. 53 | */ 54 | void onModeChange(EntityPlayer player, ItemStack stack); 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/ISpecialFilterFluid.java: -------------------------------------------------------------------------------- 1 | package cofh.api.item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fluids.FluidStack; 5 | 6 | /** 7 | * Implement this interface on subclasses of Item to change how the item works in Thermal Dynamics Fluiducts filter slots. 8 | * 9 | * This can be used to create customizable Items which are determined to be "equal" for the purposes of filtering. 10 | */ 11 | public interface ISpecialFilterFluid { 12 | 13 | /** 14 | * This method is called to find out if the given FluidStack should be matched by the given Filter ItemStack. 15 | * 16 | * @param filter 17 | * ItemStack representing the filter. 18 | * @param fluid 19 | * FluidStack representing the queried fluid. 20 | * @return True if the filter should match the FluidStack. False if the default matching should be used. 21 | */ 22 | public boolean matchesFluid(ItemStack filter, FluidStack fluid); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/ISpecialFilterItem.java: -------------------------------------------------------------------------------- 1 | package cofh.api.item; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * Implement this interface on subclasses of Item to change how the item works in Thermal Dynamics Itemducts filter slots. 7 | * 8 | * This can be used to create customizable Items which are determined to be "equal" for the purposes of filtering. 9 | */ 10 | public interface ISpecialFilterItem { 11 | 12 | /** 13 | * This method is called to find out if the given ItemStack should be matched by the given Filter ItemStack. 14 | * 15 | * @param filter 16 | * ItemStack representing the filter. 17 | * @param item 18 | * ItemStack representing the queried item. 19 | * @return True if the filter should match. False if the default matching should be used. 20 | */ 21 | public boolean matchesItem(ItemStack filter, ItemStack item); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/IToolHammer.java: -------------------------------------------------------------------------------- 1 | package cofh.api.item; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | import net.minecraft.item.ItemStack; 5 | 6 | /** 7 | * Implement this interface on subclasses of Item to have that item work as a tool for CoFH mods. 8 | */ 9 | public interface IToolHammer { 10 | 11 | /** 12 | * Called to ensure that the wrench can be used. 13 | * 14 | * @param item 15 | * The itemstack for the tool. Not required to match equipped item (e.g., multi-tools that contain other tools) 16 | * @param user 17 | * The entity using the tool 18 | * @param x 19 | * X location of the block/tile 20 | * @param y 21 | * Y location of the block/tile 22 | * @param z 23 | * Z location of the block/tile 24 | * @return True if this tool can be used 25 | */ 26 | boolean isUsable(ItemStack item, EntityLivingBase user, int x, int y, int z); 27 | 28 | /** 29 | * Callback for when the tool has been used reactively. 30 | * 31 | * @param item 32 | * The ItemStack for the tool. Not required to match equipped item (e.g., multi-tools that contain other tools) 33 | * @param user 34 | * The entity using the tool 35 | * @param x 36 | * X location of the block/tile 37 | * @param y 38 | * Y location of the block/tile 39 | * @param z 40 | * Z location of the block/tile 41 | */ 42 | void toolUsed(ItemStack item, EntityLivingBase user, int x, int y, int z); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/item/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|item") 6 | package cofh.api.item; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/modhelpers/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|modhelpers") 6 | package cofh.api.modhelpers; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHLib", provides = "CoFHAPI") 6 | package cofh.api; 7 | 8 | import cpw.mods.fml.common.API; 9 | 10 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/IAugmentable.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * Implemented on objects which support Augments. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IAugmentable { 12 | 13 | /** 14 | * Attempt to reconfigure the tile based on the Augmentations present. 15 | */ 16 | void installAugments(); 17 | 18 | /** 19 | * Returns an array of the Augment slots for this Tile Entity. 20 | */ 21 | ItemStack[] getAugmentSlots(); 22 | 23 | /** 24 | * Returns a status array for the Augmentations installed in the Tile Entity. 25 | */ 26 | boolean[] getAugmentStatus(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/IEnergyInfo.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | /** 4 | * Implement this interface on objects which can report information about their energy usage. 5 | * 6 | * This is used for reporting purposes - Energy transactions are handled through IEnergyHandler! 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IEnergyInfo { 12 | 13 | /** 14 | * Returns energy usage/generation per tick (RF/t). 15 | */ 16 | int getInfoEnergyPerTick(); 17 | 18 | /** 19 | * Returns maximum energy usage/generation per tick (RF/t). 20 | */ 21 | int getInfoMaxEnergyPerTick(); 22 | 23 | /** 24 | * Returns energy stored (RF). 25 | */ 26 | int getInfoEnergyStored(); 27 | 28 | /** 29 | * Returns maximum energy stored (RF). 30 | */ 31 | int getInfoMaxEnergyStored(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/IPortableData.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | 6 | /** 7 | * Implement this interface on Tile Entities which can write a limited amount of data about themselves. 8 | * 9 | * This is typically for the purposes of being transferred to a similar tile entity. 10 | * 11 | * @author King Lemming 12 | * 13 | */ 14 | public interface IPortableData { 15 | 16 | /** 17 | * Data identifier of the Tile Entity/Block. Used for display as well as verification purposes. Tiles with completely interchangeable data should return the 18 | * same type. 19 | * 20 | * @return 21 | */ 22 | String getDataType(); 23 | 24 | /** 25 | * Read the data from a tag. The player object exists because this should always be called via player interaction! 26 | */ 27 | void readPortableData(EntityPlayer player, NBTTagCompound tag); 28 | 29 | /** 30 | * Write the data to a tag. The player object exists because this should always be called via player interaction! 31 | */ 32 | void writePortableData(EntityPlayer player, NBTTagCompound tag); 33 | } 34 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/IReconfigurableFacing.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | /** 4 | * Implement this interface on Tile Entities which allow for reconfiguration of their facing. 5 | * 6 | * Coordination with the containing block is required. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IReconfigurableFacing { 12 | 13 | /** 14 | * Returns the current facing of the block. 15 | */ 16 | int getFacing(); 17 | 18 | /** 19 | * Returns whether or not the block's face can be aligned with the Y Axis. 20 | */ 21 | boolean allowYAxisFacing(); 22 | 23 | /** 24 | * Attempt to rotate the block. Arbitrary based on implementation. 25 | * 26 | * @return True if rotation was successful, false otherwise. 27 | */ 28 | boolean rotateBlock(); 29 | 30 | /** 31 | * Set the facing of the block. 32 | * 33 | * @param side 34 | * The side to set the facing to. 35 | * @return True if the facing was set, false otherwise. 36 | */ 37 | boolean setFacing(int side); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/IReconfigurableSides.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | /** 4 | * Implement this interface on Tile Entities which allow for reconfiguration of their sides. 5 | * 6 | * Coordination with the containing block is required. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IReconfigurableSides { 12 | 13 | /** 14 | * Decrement the config for a given side. 15 | * 16 | * @param side 17 | * The side to decrement. 18 | * @return True if config was changed, false otherwise. 19 | */ 20 | boolean decrSide(int side); 21 | 22 | /** 23 | * Increment the config for a given side. 24 | * 25 | * @param side 26 | * The side to decrement. 27 | * @return True if config was changed, false otherwise. 28 | */ 29 | boolean incrSide(int side); 30 | 31 | /** 32 | * Set the config for a given side. 33 | * 34 | * @param side 35 | * The side to set. 36 | * @param config 37 | * The config value to use. 38 | * @return True of config was set, false otherwise. 39 | */ 40 | boolean setSide(int side, int config); 41 | 42 | /** 43 | * Reset configs on all sides to their base values. 44 | * 45 | * @return True if reset was successful, false otherwise. 46 | */ 47 | boolean resetSides(); 48 | 49 | /** 50 | * Returns the number of possible config settings for a given side. 51 | */ 52 | int getNumConfig(int side); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/IRedstoneCache.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | /** 4 | * Implement this interface on Tile Entities which cache their redstone status. 5 | * 6 | * Note that {@link IRedstoneControl} is an extension of this. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IRedstoneCache { 12 | 13 | void setPowered(boolean isPowered); 14 | 15 | boolean isPowered(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/IRedstoneControl.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | /** 4 | * Implement this interface on Tile Entities which have Redstone Control functionality. This means that a tile can be set to ignore redstone entirely, or 5 | * respond to a low or high redstone state. 6 | * 7 | * @author King Lemming 8 | * 9 | */ 10 | public interface IRedstoneControl extends IRedstoneCache { 11 | 12 | public static enum ControlMode { 13 | DISABLED(true), LOW(false), HIGH(true); 14 | 15 | private final boolean state; 16 | 17 | private ControlMode(boolean state) { 18 | 19 | this.state = state; 20 | } 21 | 22 | public boolean isDisabled() { 23 | 24 | return this == DISABLED; 25 | } 26 | 27 | public boolean isLow() { 28 | 29 | return this == LOW; 30 | } 31 | 32 | public boolean isHigh() { 33 | 34 | return this == HIGH; 35 | } 36 | 37 | public boolean getState() { 38 | 39 | return state; 40 | } 41 | 42 | public static ControlMode stepForward(ControlMode curControl) { 43 | 44 | return curControl == DISABLED ? LOW : curControl == HIGH ? DISABLED : HIGH; 45 | } 46 | 47 | public static ControlMode stepBackward(ControlMode curControl) { 48 | 49 | return curControl == DISABLED ? HIGH : curControl == HIGH ? LOW : DISABLED; 50 | } 51 | } 52 | 53 | void setControl(ControlMode control); 54 | 55 | ControlMode getControl(); 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/ISecurable.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | import com.mojang.authlib.GameProfile; 4 | 5 | import net.minecraft.entity.player.EntityPlayer; 6 | 7 | /** 8 | * Implement this interface on Tile Entities which can have access restrictions. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public interface ISecurable { 14 | 15 | /** 16 | * Enum for Access Modes - Restricted is Friends Only, Private is Owner only. 17 | * 18 | * @author King Lemming 19 | * 20 | */ 21 | public static enum AccessMode { 22 | PUBLIC, RESTRICTED, PRIVATE; 23 | 24 | public boolean isPublic() { 25 | 26 | return this == PUBLIC; 27 | } 28 | 29 | public boolean isRestricted() { 30 | 31 | return this == RESTRICTED; 32 | } 33 | 34 | public boolean isPrivate() { 35 | 36 | return this == PRIVATE; 37 | } 38 | 39 | public static AccessMode stepForward(AccessMode curAccess) { 40 | 41 | return curAccess == PUBLIC ? RESTRICTED : curAccess == PRIVATE ? PUBLIC : PRIVATE; 42 | } 43 | 44 | public static AccessMode stepBackward(AccessMode curAccess) { 45 | 46 | return curAccess == PUBLIC ? PRIVATE : curAccess == PRIVATE ? RESTRICTED : PUBLIC; 47 | } 48 | } 49 | 50 | boolean setAccess(AccessMode access); 51 | 52 | boolean setOwnerName(String name); 53 | 54 | boolean setOwner(GameProfile name); 55 | 56 | AccessMode getAccess(); 57 | 58 | String getOwnerName(); 59 | 60 | GameProfile getOwner(); 61 | 62 | boolean canPlayerAccess(EntityPlayer player); 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/ISidedTexture.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | import net.minecraft.util.IIcon; 4 | 5 | /** 6 | * Implement this interface on Tile Entities which can change their block's texture based on the current render pass. The block must defer the call to its Tile 7 | * Entity. 8 | * 9 | * @author Zeldo Kavira 10 | * 11 | */ 12 | public interface ISidedTexture { 13 | 14 | /** 15 | * Returns the icon to use for a given side and render pass. 16 | * 17 | * @param side 18 | * Block side to get the texture for. 19 | * @param pass 20 | * Render pass. 21 | * @return The icon to use. 22 | */ 23 | IIcon getTexture(int side, int pass); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/ITileInfo.java: -------------------------------------------------------------------------------- 1 | package cofh.api.tileentity; 2 | 3 | import java.util.List; 4 | 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.util.IChatComponent; 7 | import net.minecraftforge.common.util.ForgeDirection; 8 | 9 | /** 10 | * Implement this interface on Tile Entities which can provide information about themselves. 11 | * 12 | * @author King Lemming 13 | * 14 | */ 15 | public interface ITileInfo { 16 | 17 | /** 18 | * This function appends information to a list provided to it. 19 | * 20 | * @param info 21 | * The list that the information should be appended to. 22 | * @param side 23 | * The side of the block that is being queried. 24 | * @param player 25 | * Player doing the querying - this can be NULL. 26 | * @param debug 27 | * If true, the tile should return "debug" information. 28 | */ 29 | void getTileInfo(List info, ForgeDirection side, EntityPlayer player, boolean debug); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/tileentity/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|tileentity") 6 | package cofh.api.tileentity; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/transport/IEnderAttuned.java: -------------------------------------------------------------------------------- 1 | package cofh.api.transport; 2 | 3 | /** 4 | * Internal Only.
5 | * Not to be implemented directly. 6 | */ 7 | public interface IEnderAttuned { 8 | 9 | /** 10 | * Returns the channel this IEnderAttuned is operating on.
11 | * Typically, this is _public_ or the player's profile (not display) name but can be anything.
12 | * It is used to separate frequency spectrums. 13 | *

14 | * Before changing, the IEnderAttuned must be removed from all registries it has been added to. 15 | * 16 | * @return The channel this IEnderAttuned is operating on. 17 | */ 18 | public String getChannelString(); 19 | 20 | /** 21 | * Returns the frequency this IEnderAttuned is operating on.
22 | * Nominally, this value is positive and user-controlled. 23 | *

24 | * Before changing, the IEnderAttuned must be removed from all registries it has been added to. 25 | * 26 | * @return The frequency this IEnderAttuned is operating on. 27 | */ 28 | public int getFrequency(); 29 | 30 | /** 31 | * Changes the value returned by getFrequency() 32 | * 33 | * @return True if the frequency was successfully modified. 34 | */ 35 | public boolean setFrequency(int frequency); 36 | 37 | /** 38 | * Removes this IEnderAttuned from all registries.
39 | * It is recommended that this not be called from setFrequency(). 40 | * 41 | * @return True if the frequency was successfully modified. 42 | */ 43 | public boolean clearFrequency(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/transport/IEnderDestination.java: -------------------------------------------------------------------------------- 1 | package cofh.api.transport; 2 | 3 | public interface IEnderDestination extends IEnderAttuned { 4 | 5 | public boolean isNotValid(); 6 | 7 | public int x(); 8 | 9 | public int y(); 10 | 11 | public int z(); 12 | 13 | public int dimension(); 14 | 15 | public int getDestination(); 16 | 17 | public boolean setDestination(int frequency); 18 | 19 | public boolean clearDestination(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/transport/IEnderEnergyHandler.java: -------------------------------------------------------------------------------- 1 | package cofh.api.transport; 2 | 3 | /** 4 | * This interface is implemented on Ender Attuned objects which can receive Energy (Redstone Flux). 5 | * 6 | * @author King Lemming 7 | * 8 | */ 9 | public interface IEnderEnergyHandler extends IEnderAttuned { 10 | 11 | /** 12 | * Return whether or not the Ender Attuned object can currently send energy (Redstone Flux). 13 | */ 14 | boolean canSendEnergy(); 15 | 16 | /** 17 | * This should be checked to see if the Ender Attuned object can currently receive energy (Redstone Flux). 18 | * 19 | * Note: In practice, this can (and should) be used to ensure that something does not send to itself. 20 | */ 21 | boolean canReceiveEnergy(); 22 | 23 | /** 24 | * This tells the Ender Attuned object to receive energy. This returns the amount remaining, *not* the amount received - a return of 0 means that all energy 25 | * was received! 26 | * 27 | * @param energy 28 | * Amount of energy to be received. 29 | * @param simulate 30 | * If TRUE, the result will only be simulated. 31 | * @return Amount of energy that is remaining (or would be remaining, if simulated). 32 | */ 33 | int receiveEnergy(int energy, boolean simulate); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/transport/IEnderFluidHandler.java: -------------------------------------------------------------------------------- 1 | package cofh.api.transport; 2 | 3 | import net.minecraftforge.fluids.FluidStack; 4 | 5 | /** 6 | * This interface is implemented on Ender Attuned objects which can receive Fluid. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IEnderFluidHandler extends IEnderAttuned { 12 | 13 | /** 14 | * Return whether or not the Ender Attuned object can currently send FluidStacks. 15 | */ 16 | boolean canSendFluid(); 17 | 18 | /** 19 | * This should be checked to see if the Ender Attuned object can currently receive a FluidStack. 20 | * 21 | * Note: In practice, this can (and should) be used to ensure that something does not send to itself. 22 | */ 23 | boolean canReceiveFluid(); 24 | 25 | /** 26 | * This tells the Ender Attuned object to receive a FluidStack. This returns what remains of the original stack, *not* the amount received - a null return 27 | * means that the entire stack was received! 28 | * 29 | * @param fluid 30 | * FluidStack to be received. 31 | * @param simulate 32 | * If TRUE, the result will only be simulated. 33 | * @return FluidStack representing how much fluid is remaining (or would be remaining, if simulated). 34 | */ 35 | FluidStack receiveFluid(FluidStack fluid, boolean simulate); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/transport/IEnderItemHandler.java: -------------------------------------------------------------------------------- 1 | package cofh.api.transport; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * This interface is implemented on Ender Attuned objects which can receive Items. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IEnderItemHandler extends IEnderAttuned { 12 | 13 | /** 14 | * Return whether or not the Ender Attuned object can currently send ItemStacks. 15 | */ 16 | boolean canSendItems(); 17 | 18 | /** 19 | * This should be checked to see if the Ender Attuned object can currently receive an ItemStack. 20 | * 21 | * Note: In practice, this can (and should) be used to ensure that something does not send to itself. 22 | */ 23 | boolean canReceiveItems(); 24 | 25 | /** 26 | * This tells the Ender Attuned object to receive an ItemStack. This returns what remains of the original stack, *not* the amount received - a null return 27 | * means that the entire stack was received! 28 | * 29 | * This function does not support simulation because Inventory manipulation in Minecraft is an absolute mess and it would be a computational liability to do 30 | * so. 31 | * 32 | * @param item 33 | * ItemStack to be received. 34 | * @return An ItemStack representing how much is remaining. 35 | */ 36 | ItemStack receiveItem(ItemStack item); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/transport/IItemDuct.java: -------------------------------------------------------------------------------- 1 | package cofh.api.transport; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.common.util.ForgeDirection; 5 | 6 | /** 7 | * This interface is implemented on ItemDucts. Use it to attempt to eject items into an entry point. 8 | * 9 | * @author Zeldo Kavira, King Lemming 10 | * 11 | */ 12 | public interface IItemDuct { 13 | 14 | /** 15 | * Insert an ItemStack into the IItemDuct. Will only accept items if there is a valid destination. This returns what is remaining of the original stack - a 16 | * null return means that the entire stack was accepted/routed! 17 | * 18 | * @param from 19 | * Orientation the item is inserted from. 20 | * @param item 21 | * ItemStack to be inserted. The size of this stack corresponds to the maximum amount to insert. 22 | * @return An ItemStack representing how much is remaining after the item was inserted into the Duct. 23 | */ 24 | public ItemStack insertItem(ForgeDirection from, ItemStack item); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/transport/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|transport") 6 | package cofh.api.transport; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/world/IFeatureGenerator.java: -------------------------------------------------------------------------------- 1 | package cofh.api.world; 2 | 3 | import java.util.Random; 4 | 5 | import net.minecraft.world.World; 6 | import net.minecraft.world.gen.feature.WorldGenerator; 7 | 8 | /** 9 | * This interface should be implemented on classes which define a world feature to be generated in a {@link IFeatureHandler}. It is essentially a more robust 10 | * version of {@link WorldGenerator}, and may include one or more WorldGenerators should you wish. 11 | * 12 | * @author King Lemming 13 | * 14 | */ 15 | public interface IFeatureGenerator { 16 | 17 | /** 18 | * Returns the name of the feature, used for unique identification in configs and retrogen. 19 | */ 20 | public String getFeatureName(); 21 | 22 | /** 23 | * Generates the world feature. 24 | * 25 | * @param random 26 | * Random derived from the world seed. 27 | * @param chunkX 28 | * Minimum X chunk-coordinate of the chunk. (x16 for block coordinate) 29 | * @param chunkZ 30 | * Minimum Z chunk-coordinate of the chunk. (x16 for block coordinate) 31 | * @param world 32 | * The world to generate in. 33 | * @param newGen 34 | * True on initial generation, false on retrogen. 35 | * @return True if generation happened, false otherwise. 36 | */ 37 | public boolean generateFeature(Random random, int chunkX, int chunkZ, World world, boolean newGen); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/world/IFeatureHandler.java: -------------------------------------------------------------------------------- 1 | package cofh.api.world; 2 | 3 | /** 4 | * Provides an interface to allow for the addition of Features to world generation. 5 | * 6 | * See {@link IFeatureGenerator}. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IFeatureHandler { 12 | 13 | /** 14 | * Register a feature with an IFeatureHandler. 15 | * 16 | * @param feature 17 | * The feature to register. 18 | * @return True if the registration was successful, false if a feature with that name existed. 19 | */ 20 | public boolean registerFeature(IFeatureGenerator feature); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/world/IFeatureParser.java: -------------------------------------------------------------------------------- 1 | package cofh.api.world; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | import org.apache.logging.log4j.Logger; 6 | 7 | public interface IFeatureParser { 8 | 9 | /** 10 | * Parse a {@link JsonObject} for registration with an with an {@link IFeatureHandler}. 11 | * 12 | * @param featureName 13 | * The name of the feature to register. 14 | * @param genObject 15 | * The JsonObject to parse. 16 | * @param log 17 | * The {@link Logger} to log debug/error/etc. messages to. 18 | * @return The {@link IFeatureGenerator} to be registered with an IFeatureHandler 19 | */ 20 | public IFeatureGenerator parseFeature(String featureName, JsonObject genObject, Logger log); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/world/IGeneratorParser.java: -------------------------------------------------------------------------------- 1 | package cofh.api.world; 2 | 3 | import cofh.lib.util.WeightedRandomBlock; 4 | import com.google.gson.JsonObject; 5 | 6 | import java.util.List; 7 | 8 | import net.minecraft.world.gen.feature.WorldGenerator; 9 | 10 | import org.apache.logging.log4j.Logger; 11 | 12 | public interface IGeneratorParser { 13 | 14 | /** 15 | * Parse a {@link JsonObject} for registration with an with an {@link IFeatureGenerator}. 16 | * 17 | * @param generatorName 18 | * The name of the generator to register. 19 | * @param genObject 20 | * The JsonObject to parse. 21 | * @param log 22 | * The {@link Logger} to log debug/error/etc. messages to. 23 | * @param resList 24 | * The processed list of resources to generate 25 | * @param clusterSize 26 | * The processed size of the cluster 27 | * @param matList 28 | * The processed list of materials to generate in 29 | * @return The {@link WorldGenerator} to be registered with an IFeatureGenerator 30 | */ 31 | public WorldGenerator parseGenerator(String generatorName, JsonObject genObject, Logger log, List resList, int clusterSize, 32 | List matList); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/api/world/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHAPIProps.VERSION, owner = "CoFHAPI", provides = "CoFHAPI|world") 6 | package cofh.api.world; 7 | 8 | import cofh.api.CoFHAPIProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/CoFHLibProps.java: -------------------------------------------------------------------------------- 1 | package cofh.lib; 2 | 3 | public class CoFHLibProps { 4 | 5 | private CoFHLibProps() { 6 | 7 | } 8 | 9 | public static final String VERSION = "1.7.10R1.0.4B1"; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/audio/ISoundSource.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.audio; 2 | 3 | import net.minecraft.client.audio.ISound; 4 | 5 | public interface ISoundSource { 6 | 7 | /** 8 | * Should actually return an ISound. The object return prevents server crashes. 9 | */ 10 | ISound getSound(); 11 | 12 | boolean shouldPlaySound(); 13 | } 14 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/audio/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|audio") 6 | package cofh.lib.audio; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/GuiBook.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | 5 | public class GuiBook extends GuiScreen { 6 | 7 | protected int mouseX = 0; 8 | protected int mouseY = 0; 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/GuiProps.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui; 2 | 3 | public class GuiProps { 4 | 5 | /* GUI */ 6 | public static final String PATH_GFX = "cofh:textures/"; 7 | public static final String PATH_ARMOR = PATH_GFX + "armor/"; 8 | public static final String PATH_GUI = PATH_GFX + "gui/"; 9 | public static final String PATH_RENDER = PATH_GFX + "blocks/"; 10 | public static final String PATH_ELEMENTS = PATH_GUI + "elements/"; 11 | public static final String PATH_ICON = PATH_GUI + "icons/"; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/TabTracker.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui; 2 | 3 | import cofh.lib.gui.element.TabBase; 4 | 5 | /** 6 | * Keeps track of which tabs should be open by default when a player opens a GUI. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public class TabTracker { 12 | 13 | private static Class openedLeftTab; 14 | private static Class openedRightTab; 15 | 16 | public static Class getOpenedLeftTab() { 17 | 18 | return openedLeftTab; 19 | } 20 | 21 | public static Class getOpenedRightTab() { 22 | 23 | return openedRightTab; 24 | } 25 | 26 | public static void setOpenedLeftTab(Class tabClass) { 27 | 28 | openedLeftTab = tabClass; 29 | } 30 | 31 | public static void setOpenedRightTab(Class tabClass) { 32 | 33 | openedRightTab = tabClass; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/container/ContainerFalse.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.container; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.inventory.Container; 5 | 6 | /** 7 | * Basic false container class. You'll know if you need one. 8 | * 9 | * @author King Lemming 10 | * 11 | */ 12 | public final class ContainerFalse extends Container { 13 | 14 | @Override 15 | public boolean canInteractWith(EntityPlayer player) { 16 | 17 | return false; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/container/IAugmentableContainer.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.container; 2 | 3 | import net.minecraft.inventory.Slot; 4 | 5 | /** 6 | * Implement this interface on Container objects (the backend of a GUI). These are basically passthrough functions which should call back to the Tile Entity. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface IAugmentableContainer { 12 | 13 | /** 14 | * Used by a tab to set lock status so that new Augments cannot be added (there may be many reasons for this). 15 | */ 16 | void setAugmentLock(boolean lock); 17 | 18 | /** 19 | * Returns the Augment slots. 20 | */ 21 | Slot[] getAugmentSlots(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/container/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|gui|container") 6 | package cofh.lib.gui.container; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementButtonBase.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.gui.GuiProps; 5 | 6 | import net.minecraft.util.ResourceLocation; 7 | 8 | public abstract class ElementButtonBase extends ElementBase { 9 | 10 | public static final ResourceLocation HOVER = new ResourceLocation(GuiProps.PATH_ELEMENTS + "Button_Hover.png"); 11 | public static final ResourceLocation ENABLED = new ResourceLocation(GuiProps.PATH_ELEMENTS + "Button_Enabled.png"); 12 | public static final ResourceLocation DISABLED = new ResourceLocation(GuiProps.PATH_ELEMENTS + "Button_Disabled.png"); 13 | 14 | public ElementButtonBase(GuiBase containerScreen, int posX, int posY, int sizeX, int sizeY) { 15 | 16 | super(containerScreen, posX, posY, sizeX, sizeY); 17 | } 18 | 19 | @Override 20 | public boolean onMousePressed(int mouseX, int mouseY, int mouseButton) { 21 | 22 | playSound(mouseButton); 23 | switch (mouseButton) { 24 | case 0: 25 | onClick(); 26 | break; 27 | case 1: 28 | onRightClick(); 29 | break; 30 | case 2: 31 | onMiddleClick(); 32 | break; 33 | } 34 | return true; 35 | } 36 | 37 | protected void playSound(int button) { 38 | 39 | if (button == 0) { 40 | GuiBase.playSound("random.click", 1.0F, 1.0F); 41 | } 42 | } 43 | 44 | public void onClick() { 45 | 46 | } 47 | 48 | public void onRightClick() { 49 | 50 | } 51 | 52 | public void onMiddleClick() { 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementButtonOption.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | 8 | public abstract class ElementButtonOption extends ElementButtonManaged { 9 | 10 | private final Map _values = new HashMap(); 11 | private int _currentValue = 0; 12 | private int _maxValue; 13 | 14 | public ElementButtonOption(GuiBase containerScreen, int x, int y, int width, int height) { 15 | 16 | super(containerScreen, x, y, width, height, ""); 17 | } 18 | 19 | public void setValue(int value, String label) { 20 | 21 | _values.put(value, label); 22 | if (value > _maxValue) { 23 | _maxValue = value; 24 | } 25 | } 26 | 27 | @Override 28 | public void onClick() { 29 | 30 | int nextValue = _currentValue; 31 | do { 32 | nextValue++; 33 | if (nextValue > _maxValue) { 34 | nextValue = 0; 35 | } 36 | } while (_values.get(nextValue) == null); 37 | setSelectedIndex(nextValue); 38 | } 39 | 40 | @Override 41 | public void onRightClick() { 42 | 43 | int nextValue = _currentValue; 44 | 45 | do { 46 | nextValue--; 47 | if (nextValue < 0) { 48 | nextValue = _maxValue; 49 | } 50 | } while (_values.get(nextValue) == null); 51 | setSelectedIndex(nextValue); 52 | } 53 | 54 | public int getSelectedIndex() { 55 | 56 | return _currentValue; 57 | } 58 | 59 | public void setSelectedIndex(int index) { 60 | 61 | _currentValue = index; 62 | setText(_values.get(_currentValue)); 63 | onValueChanged(_currentValue, _values.get(_currentValue)); 64 | } 65 | 66 | public String getValue() { 67 | 68 | return _values.get(_currentValue); 69 | } 70 | 71 | public abstract void onValueChanged(int value, String label); 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementDualScaled.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.render.RenderHelper; 5 | 6 | public class ElementDualScaled extends ElementBase { 7 | 8 | public int quantity; 9 | public int mode; 10 | public boolean background = true; 11 | 12 | public ElementDualScaled(GuiBase gui, int posX, int posY) { 13 | 14 | super(gui, posX, posY); 15 | } 16 | 17 | public ElementDualScaled setBackground(boolean background) { 18 | 19 | this.background = background; 20 | return this; 21 | } 22 | 23 | public ElementDualScaled setMode(int mode) { 24 | 25 | this.mode = mode; 26 | return this; 27 | } 28 | 29 | public ElementDualScaled setQuantity(int quantity) { 30 | 31 | this.quantity = quantity; 32 | return this; 33 | } 34 | 35 | @Override 36 | public void drawBackground(int mouseX, int mouseY, float gameTicks) { 37 | 38 | RenderHelper.bindTexture(texture); 39 | 40 | if (background) { 41 | drawTexturedModalRect(posX, posY, 0, 0, sizeX, sizeY); 42 | } 43 | switch (mode) { 44 | case 0: 45 | // vertical bottom -> top 46 | drawTexturedModalRect(posX, posY + sizeY - quantity, sizeX, sizeY - quantity, sizeX, quantity); 47 | return; 48 | case 1: 49 | // horizontal left -> right 50 | drawTexturedModalRect(posX, posY, sizeX, 0, quantity, sizeY); 51 | return; 52 | case 2: 53 | // horizontal right -> left 54 | drawTexturedModalRect(posX + sizeX - quantity, posY, sizeX + sizeX - quantity, 0, quantity, sizeY); 55 | return; 56 | } 57 | } 58 | 59 | @Override 60 | public void drawForeground(int mouseX, int mouseY) { 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementFluid.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.util.helpers.FluidHelper; 5 | 6 | import net.minecraftforge.fluids.Fluid; 7 | import net.minecraftforge.fluids.FluidStack; 8 | 9 | public class ElementFluid extends ElementBase { 10 | 11 | public FluidStack fluid; 12 | 13 | public ElementFluid(GuiBase gui, int posX, int posY) { 14 | 15 | super(gui, posX, posY); 16 | } 17 | 18 | public ElementFluid setFluid(FluidStack stack) { 19 | 20 | this.fluid = stack; 21 | return this; 22 | } 23 | 24 | public ElementFluid setFluid(Fluid fluid) { 25 | 26 | this.fluid = new FluidStack(fluid, FluidHelper.BUCKET_VOLUME); 27 | return this; 28 | } 29 | 30 | @Override 31 | public void drawBackground(int mouseX, int mouseY, float gameTicks) { 32 | 33 | gui.drawFluid(posX, posY, fluid, sizeX, sizeY); 34 | } 35 | 36 | @Override 37 | public void drawForeground(int mouseX, int mouseY) { 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementIcon.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.gui.GuiColor; 5 | 6 | import net.minecraft.util.IIcon; 7 | 8 | import org.lwjgl.opengl.GL11; 9 | 10 | public class ElementIcon extends ElementBase { 11 | 12 | protected IIcon icon; 13 | protected int spriteSheet; 14 | protected GuiColor color = new GuiColor(-1); 15 | 16 | public ElementIcon(GuiBase gui, int posX, int posY, IIcon icon) { 17 | 18 | this(gui, posX, posY, icon, 0); 19 | } 20 | 21 | public ElementIcon(GuiBase gui, int posX, int posY, IIcon icon, int spriteSheet) { 22 | 23 | super(gui, posX, posY); 24 | this.icon = icon; 25 | this.spriteSheet = spriteSheet; 26 | } 27 | 28 | public ElementIcon setColor(Number color) { 29 | 30 | this.color = new GuiColor(color.intValue()); 31 | return this; 32 | } 33 | 34 | public ElementIcon setIcon(IIcon icon) { 35 | 36 | this.icon = icon; 37 | return this; 38 | } 39 | 40 | public ElementIcon setSpriteSheet(int spriteSheet) { 41 | 42 | this.spriteSheet = spriteSheet; 43 | return this; 44 | } 45 | 46 | public int getColor() { 47 | 48 | return color.getColor(); 49 | } 50 | 51 | @Override 52 | public void drawBackground(int mouseX, int mouseY, float gameTicks) { 53 | 54 | if (icon != null) { 55 | GL11.glColor4f(color.getFloatR(), color.getFloatG(), color.getFloatB(), color.getFloatA()); 56 | gui.drawColorIcon(icon, posX, posY, spriteSheet); 57 | GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); 58 | } 59 | } 60 | 61 | @Override 62 | public void drawForeground(int mouseX, int mouseY) { 63 | 64 | return; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementSimple.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.render.RenderHelper; 5 | 6 | /** 7 | * Basic element which can render an arbitrary texture. 8 | * 9 | * @author King Lemming 10 | * 11 | */ 12 | public class ElementSimple extends ElementBase { 13 | 14 | int texU = 0; 15 | int texV = 0; 16 | 17 | public ElementSimple(GuiBase gui, int posX, int posY) { 18 | 19 | super(gui, posX, posY); 20 | } 21 | 22 | public ElementSimple setTextureOffsets(int u, int v) { 23 | 24 | texU = u; 25 | texV = v; 26 | return this; 27 | } 28 | 29 | @Override 30 | public void drawBackground(int mouseX, int mouseY, float gameTicks) { 31 | 32 | RenderHelper.bindTexture(texture); 33 | drawTexturedModalRect(posX, posY, texU, texV, sizeX, sizeY); 34 | } 35 | 36 | @Override 37 | public void drawForeground(int mouseX, int mouseY) { 38 | 39 | return; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementSimpleBox.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | 5 | public class ElementSimpleBox extends ElementBase { 6 | 7 | protected int color; 8 | 9 | public ElementSimpleBox(GuiBase gui, int posX, int posY, Number color) { 10 | 11 | this(gui, posX, posY, 16, 16, color); 12 | } 13 | 14 | public ElementSimpleBox(GuiBase gui, int posX, int posY, int width, int height, Number color) { 15 | 16 | super(gui, posX, posY, width, height); 17 | setColor(color); 18 | } 19 | 20 | public ElementSimpleBox setColor(Number color) { 21 | 22 | this.color = color.intValue(); 23 | return this; 24 | } 25 | 26 | @Override 27 | public void drawBackground(int mouseX, int mouseY, float gameTicks) { 28 | 29 | drawModalRect(posX, posY, posX + sizeX, posY + sizeY, color); 30 | } 31 | 32 | @Override 33 | public void drawForeground(int mouseX, int mouseY) { 34 | 35 | return; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementSimpleToolTip.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.render.RenderHelper; 5 | import cofh.lib.util.helpers.StringHelper; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Basic element which can render an arbitrary texture and may have a tooltip. 11 | * 12 | * @author King Lemming 13 | * 14 | */ 15 | public class ElementSimpleToolTip extends ElementBase { 16 | 17 | int texU = 0; 18 | int texV = 0; 19 | boolean tooltipLocalized = false; 20 | String tooltip; 21 | 22 | public ElementSimpleToolTip(GuiBase gui, int posX, int posY) { 23 | 24 | super(gui, posX, posY); 25 | } 26 | 27 | public ElementSimpleToolTip setTextureOffsets(int u, int v) { 28 | 29 | texU = u; 30 | texV = v; 31 | return this; 32 | } 33 | 34 | public ElementSimpleToolTip clearToolTip() { 35 | 36 | this.tooltip = null; 37 | return this; 38 | } 39 | 40 | public ElementSimpleToolTip setToolTip(String tooltip) { 41 | 42 | this.tooltip = tooltip; 43 | return this; 44 | } 45 | 46 | public ElementSimpleToolTip setToolTipLocalized(boolean localized) { 47 | 48 | this.tooltipLocalized = localized; 49 | return this; 50 | } 51 | 52 | @Override 53 | public void drawBackground(int mouseX, int mouseY, float gameTicks) { 54 | 55 | RenderHelper.bindTexture(texture); 56 | drawTexturedModalRect(posX, posY, texU, texV, sizeX, sizeY); 57 | } 58 | 59 | @Override 60 | public void drawForeground(int mouseX, int mouseY) { 61 | 62 | return; 63 | } 64 | 65 | @Override 66 | public void addTooltip(List list) { 67 | 68 | if (tooltip != null) { 69 | if (tooltipLocalized) { 70 | list.add(tooltip); 71 | } else { 72 | list.add(StringHelper.localize(tooltip)); 73 | } 74 | } 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementTextFieldFiltered.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.util.CharacterSingleton; 5 | 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | public class ElementTextFieldFiltered extends ElementTextField { 10 | 11 | protected boolean includeVanilla = true; 12 | protected CharacterSingleton seq = new CharacterSingleton(); 13 | protected Matcher filter; 14 | 15 | public ElementTextFieldFiltered(GuiBase gui, int posX, int posY, int width, int height) { 16 | 17 | super(gui, posX, posY, width, height); 18 | } 19 | 20 | public ElementTextFieldFiltered(GuiBase gui, int posX, int posY, int width, int height, short limit) { 21 | 22 | super(gui, posX, posY, width, height, limit); 23 | } 24 | 25 | /** 26 | * 27 | * @param pattern 28 | * Regex limit what characters can be typed 29 | * @param includeVanilla 30 | * Include vanilla disallowed characters 31 | * @return this 32 | */ 33 | public ElementTextFieldFiltered setFilter(Pattern pattern, boolean includeVanilla) { 34 | 35 | filter = pattern.matcher(seq); 36 | this.includeVanilla = includeVanilla; 37 | return this; 38 | } 39 | 40 | @Override 41 | public boolean isAllowedCharacter(char charTyped) { 42 | 43 | seq.character = charTyped; 44 | return (!includeVanilla || super.isAllowedCharacter(charTyped)) && (filter == null || filter.reset().matches()); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/ElementTextFieldLimited.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | 5 | public class ElementTextFieldLimited extends ElementTextField { 6 | 7 | protected boolean includeVanilla = true; 8 | protected String filter; 9 | 10 | public ElementTextFieldLimited(GuiBase gui, int posX, int posY, int width, int height) { 11 | 12 | super(gui, posX, posY, width, height); 13 | } 14 | 15 | public ElementTextFieldLimited(GuiBase gui, int posX, int posY, int width, int height, short limit) { 16 | 17 | super(gui, posX, posY, width, height, limit); 18 | } 19 | 20 | /** 21 | * 22 | * @param pattern 23 | * String containing all characters permitted 24 | * @param includeVanilla 25 | * Include vanilla disallowed characters 26 | * @return this 27 | */ 28 | public ElementTextFieldLimited setFilter(String pattern, boolean includeVanilla) { 29 | 30 | filter = pattern; 31 | this.includeVanilla = includeVanilla; 32 | return this; 33 | } 34 | 35 | @Override 36 | public boolean isAllowedCharacter(char charTyped) { 37 | 38 | return (!includeVanilla || super.isAllowedCharacter(charTyped)) && (filter == null || filter.indexOf(charTyped) >= 0); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/listbox/IListBoxElement.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element.listbox; 2 | 3 | import cofh.lib.gui.element.ElementListBox; 4 | 5 | public interface IListBoxElement { 6 | 7 | public int getHeight(); 8 | 9 | public int getWidth(); 10 | 11 | public Object getValue(); 12 | 13 | public void draw(ElementListBox listBox, int x, int y, int backColor, int textColor); 14 | } 15 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/listbox/ListBoxElementText.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element.listbox; 2 | 3 | import cofh.lib.gui.element.ElementListBox; 4 | 5 | import net.minecraft.client.Minecraft; 6 | 7 | public class ListBoxElementText implements IListBoxElement { 8 | 9 | private final String _text; 10 | 11 | public ListBoxElementText(String text) { 12 | 13 | _text = text; 14 | } 15 | 16 | @Override 17 | public Object getValue() { 18 | 19 | return _text; 20 | } 21 | 22 | @Override 23 | public int getHeight() { 24 | 25 | return 10; 26 | } 27 | 28 | @Override 29 | public int getWidth() { 30 | 31 | return Minecraft.getMinecraft().fontRenderer.getStringWidth(_text); 32 | } 33 | 34 | @Override 35 | public void draw(ElementListBox listBox, int x, int y, int backColor, int textColor) { 36 | 37 | listBox.getFontRenderer().drawStringWithShadow(_text, x, y, textColor); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/listbox/SliderHorizontal.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element.listbox; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.gui.element.ElementSlider; 5 | 6 | public class SliderHorizontal extends ElementSlider { 7 | 8 | public SliderHorizontal(GuiBase containerScreen, int x, int y, int width, int height, int maxValue) { 9 | 10 | this(containerScreen, x, y, width, height, maxValue, 0); 11 | } 12 | 13 | public SliderHorizontal(GuiBase containerScreen, int x, int y, int width, int height, int maxValue, int minValue) { 14 | 15 | super(containerScreen, x, y, width, height, maxValue, minValue); 16 | int dist = maxValue - minValue; 17 | setSliderSize(dist <= 0 ? width : Math.max(width / ++dist, 9), height); 18 | } 19 | 20 | @Override 21 | public ElementSlider setLimits(int min, int max) { 22 | 23 | int dist = max - min; 24 | setSliderSize(dist <= 0 ? getWidth() : Math.max(getWidth() / ++dist, 9), getHeight()); 25 | return super.setLimits(min, max); 26 | } 27 | 28 | @Override 29 | public int getSliderX() { 30 | 31 | int dist = _valueMax - _valueMin; 32 | int maxPos = sizeX - _sliderWidth; 33 | return Math.min(dist == 0 ? 0 : maxPos * (_value - _valueMin) / dist, maxPos); 34 | } 35 | 36 | @Override 37 | public void dragSlider(int v, int y) { 38 | 39 | v += Math.round(_sliderWidth * (v / (float) sizeX) + (_sliderWidth * 0.25f)); 40 | setValue(_valueMin + ((_valueMax - _valueMin) * v / sizeX)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/listbox/SliderVertical.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.element.listbox; 2 | 3 | import cofh.lib.gui.GuiBase; 4 | import cofh.lib.gui.element.ElementSlider; 5 | 6 | public class SliderVertical extends ElementSlider { 7 | 8 | public SliderVertical(GuiBase containerScreen, int x, int y, int width, int height, int maxValue) { 9 | 10 | this(containerScreen, x, y, width, height, maxValue, 0); 11 | } 12 | 13 | public SliderVertical(GuiBase containerScreen, int x, int y, int width, int height, int maxValue, int minValue) { 14 | 15 | super(containerScreen, x, y, width, height, maxValue, minValue); 16 | int dist = maxValue - minValue; 17 | setSliderSize(width, dist <= 0 ? height : Math.max(height / ++dist, 9)); 18 | } 19 | 20 | @Override 21 | public ElementSlider setLimits(int min, int max) { 22 | 23 | int dist = max - min; 24 | setSliderSize(getWidth(), dist <= 0 ? getHeight() : Math.max(getHeight() / ++dist, 9)); 25 | return super.setLimits(min, max); 26 | } 27 | 28 | @Override 29 | public int getSliderY() { 30 | 31 | int dist = _valueMax - _valueMin; 32 | int maxPos = sizeY - _sliderHeight; 33 | return Math.min(dist == 0 ? 0 : maxPos * (_value - _valueMin) / dist, maxPos); 34 | } 35 | 36 | @Override 37 | public void dragSlider(int x, int v) { 38 | 39 | v += Math.round(_sliderHeight * (v / (float) sizeY) + (_sliderHeight * 0.25f)); 40 | setValue(_valueMin + ((_valueMax - _valueMin) * v / sizeY)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/listbox/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|gui|element|listbox") 6 | package cofh.lib.gui.element.listbox; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/element/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|gui|element") 6 | package cofh.lib.gui.element; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|gui") 6 | package cofh.lib.gui; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/ISlotValidator.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.item.ItemStack; 4 | 5 | /** 6 | * Interface used in conjunction with {@link SlotValidated}. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public interface ISlotValidator { 12 | 13 | /** 14 | * Essentially a passthrough so an arbitrary criterion can be checked against. 15 | */ 16 | boolean isItemValid(ItemStack stack); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotAcceptAssignable.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.inventory.IInventory; 4 | import net.minecraft.inventory.Slot; 5 | import net.minecraft.item.Item; 6 | import net.minecraft.item.ItemStack; 7 | 8 | /** 9 | * Slot that will only accept ItemStacks whose items are a subclass of the given class. 10 | */ 11 | public class SlotAcceptAssignable extends Slot { 12 | 13 | protected Class clazz; 14 | 15 | public SlotAcceptAssignable(IInventory inventory, int index, int x, int y, Class c) { 16 | 17 | super(inventory, index, x, y); 18 | clazz = c; 19 | } 20 | 21 | @Override 22 | public boolean isItemValid(ItemStack stack) { 23 | 24 | return stack != null && clazz.isInstance(stack.getItem()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotAcceptInsertable.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.inventory.IInventory; 4 | import net.minecraft.inventory.ISidedInventory; 5 | import net.minecraft.item.ItemStack; 6 | 7 | /** 8 | * Slot that will only accept ItemStacks when the IInventory returns true from isItemValidForSlot. 9 | * 10 | * If an ISidedInventory, canInsertItem (from side 6 (UNKNOWN)) must also return true. 11 | */ 12 | public class SlotAcceptInsertable extends SlotAcceptValid { 13 | 14 | protected ISidedInventory sidedInv; 15 | 16 | public SlotAcceptInsertable(IInventory inventory, int index, int x, int y) { 17 | 18 | super(inventory, index, x, y); 19 | 20 | if (inventory instanceof ISidedInventory) { 21 | sidedInv = (ISidedInventory) inventory; 22 | } else { 23 | sidedInv = null; 24 | } 25 | } 26 | 27 | @Override 28 | public boolean isItemValid(ItemStack stack) { 29 | 30 | boolean valid = super.isItemValid(stack); 31 | 32 | return valid && sidedInv != null ? sidedInv.canInsertItem(slotNumber, stack, 6) : valid; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotAcceptValid.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.inventory.IInventory; 4 | import net.minecraft.inventory.Slot; 5 | import net.minecraft.item.ItemStack; 6 | 7 | /** 8 | * Slot that will only accept ItemStacks when the IInventory returns true from isItemValidForSlot. 9 | */ 10 | public class SlotAcceptValid extends Slot { 11 | 12 | public SlotAcceptValid(IInventory inventory, int index, int x, int y) { 13 | 14 | super(inventory, index, x, y); 15 | } 16 | 17 | @Override 18 | public boolean isItemValid(ItemStack stack) { 19 | 20 | return stack != null && this.inventory.isItemValidForSlot(this.slotNumber, stack); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotCraftingLocked.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.inventory.IInventory; 5 | import net.minecraft.inventory.SlotCrafting; 6 | import net.minecraft.item.ItemStack; 7 | 8 | /** 9 | * Crafting result slot where the result cannot be removed. 10 | * 11 | * @author King Lemming 12 | * 13 | */ 14 | public class SlotCraftingLocked extends SlotCrafting { 15 | 16 | public SlotCraftingLocked(EntityPlayer player, IInventory craftMatrix, IInventory inventory, int index, int x, int y) { 17 | 18 | super(player, craftMatrix, inventory, index, x, y); 19 | } 20 | 21 | @Override 22 | public boolean isItemValid(ItemStack stack) { 23 | 24 | return false; 25 | } 26 | 27 | @Override 28 | public boolean canTakeStack(EntityPlayer player) { 29 | 30 | return false; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotEnergy.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import cofh.lib.util.helpers.EnergyHelper; 4 | 5 | import net.minecraft.inventory.IInventory; 6 | import net.minecraft.inventory.Slot; 7 | import net.minecraft.item.ItemStack; 8 | 9 | /** 10 | * Slot which only accepts Energy (Redstone Flux) Containers as valid. 11 | * 12 | * @author King Lemming 13 | * 14 | */ 15 | public class SlotEnergy extends Slot { 16 | 17 | public SlotEnergy(IInventory inventory, int index, int x, int y) { 18 | 19 | super(inventory, index, x, y); 20 | } 21 | 22 | @Override 23 | public boolean isItemValid(ItemStack stack) { 24 | 25 | return EnergyHelper.isEnergyContainerItem(stack); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotFalseCopy.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.inventory.IInventory; 5 | import net.minecraft.inventory.Slot; 6 | import net.minecraft.item.ItemStack; 7 | 8 | /** 9 | * Slot which copies an ItemStack when clicked on, does not decrement the ItemStack on the cursor. 10 | * 11 | * @author King Lemming 12 | * 13 | */ 14 | public class SlotFalseCopy extends Slot { 15 | 16 | public int slotIndex = 0; 17 | 18 | public SlotFalseCopy(IInventory inventory, int index, int x, int y) { 19 | 20 | super(inventory, index, x, y); 21 | slotIndex = index; 22 | } 23 | 24 | @Override 25 | public boolean canTakeStack(EntityPlayer player) { 26 | 27 | return false; 28 | } 29 | 30 | @Override 31 | public boolean isItemValid(ItemStack stack) { 32 | 33 | return true; 34 | } 35 | 36 | @Override 37 | public void putStack(ItemStack stack) { 38 | 39 | if (stack != null) { 40 | stack.stackSize = 1; 41 | } 42 | this.inventory.setInventorySlotContents(this.slotIndex, stack); 43 | this.onSlotChanged(); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotInvisible.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.inventory.IInventory; 8 | import net.minecraft.inventory.Slot; 9 | import net.minecraft.item.ItemStack; 10 | 11 | /** 12 | * Slot that will redirect inserts to another inventory slot (other than index), but not be visible. 13 | * 14 | * Used primarily for containers that have a larger internal inventory than external (e.g., DeepStorageUnit) 15 | */ 16 | public class SlotInvisible extends Slot { 17 | 18 | protected final int slotIndex; 19 | 20 | public SlotInvisible(IInventory inventory, int index, int x, int y, int slot) { 21 | 22 | super(inventory, index, x, y); 23 | slotIndex = slot; 24 | } 25 | 26 | @Override 27 | public void putStack(ItemStack stack) { 28 | 29 | this.inventory.setInventorySlotContents(slotIndex, stack); 30 | this.onSlotChanged(); 31 | } 32 | 33 | @Override 34 | public ItemStack getStack() { 35 | 36 | return null; 37 | } 38 | 39 | @Override 40 | public ItemStack decrStackSize(int par1) { 41 | 42 | return null; 43 | } 44 | 45 | @Override 46 | public boolean canTakeStack(EntityPlayer p) { 47 | 48 | return false; 49 | } 50 | 51 | @Override 52 | @SideOnly(Side.CLIENT) 53 | public boolean func_111238_b() { 54 | 55 | return false; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotLocked.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.inventory.IInventory; 8 | import net.minecraft.inventory.Slot; 9 | import net.minecraft.item.ItemStack; 10 | 11 | /** 12 | * A slot that can only be used to display an item, not edited. Can optionally not highlight when moused over. 13 | */ 14 | public class SlotLocked extends Slot { 15 | 16 | protected boolean showHighlight; 17 | 18 | public SlotLocked(IInventory inventory, int index, int x, int y) { 19 | 20 | this(inventory, index, x, y, false); 21 | } 22 | 23 | public SlotLocked(IInventory inventory, int index, int x, int y, boolean highlight) { 24 | 25 | super(inventory, index, x, y); 26 | showHighlight = highlight; 27 | } 28 | 29 | @Override 30 | public boolean canTakeStack(EntityPlayer player) { 31 | 32 | return false; 33 | } 34 | 35 | @Override 36 | public boolean isItemValid(ItemStack stack) { 37 | 38 | return false; 39 | } 40 | 41 | @Override 42 | @SideOnly(Side.CLIENT) 43 | public boolean func_111238_b() { 44 | 45 | return showHighlight; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotPotion.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.init.Items; 4 | import net.minecraft.inventory.IInventory; 5 | import net.minecraft.inventory.Slot; 6 | import net.minecraft.item.ItemStack; 7 | 8 | /** 9 | * Slot that will only accept Potions. 10 | */ 11 | public class SlotPotion extends Slot { 12 | 13 | public SlotPotion(IInventory inventory, int index, int x, int y) { 14 | 15 | super(inventory, index, x, y); 16 | } 17 | 18 | @Override 19 | public boolean isItemValid(ItemStack stack) { 20 | 21 | return stack != null && stack.getItem().equals(Items.potionitem); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotPotionIngredient.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.inventory.IInventory; 4 | import net.minecraft.inventory.Slot; 5 | import net.minecraft.item.ItemStack; 6 | 7 | /** 8 | * Slot that will only accept Potion Ingredients. 9 | */ 10 | public class SlotPotionIngredient extends Slot { 11 | 12 | public SlotPotionIngredient(IInventory inventory, int index, int x, int y) { 13 | 14 | super(inventory, index, x, y); 15 | } 16 | 17 | @Override 18 | public boolean isItemValid(ItemStack stack) { 19 | 20 | return stack != null && stack.getItem().isPotionIngredient(stack); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotRemoveOnly.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.inventory.IInventory; 4 | import net.minecraft.inventory.Slot; 5 | import net.minecraft.item.ItemStack; 6 | 7 | /** 8 | * Slot which players can only remove items from. 9 | */ 10 | public class SlotRemoveOnly extends Slot { 11 | 12 | public SlotRemoveOnly(IInventory inventory, int index, int x, int y) { 13 | 14 | super(inventory, index, x, y); 15 | } 16 | 17 | @Override 18 | public boolean isItemValid(ItemStack stack) { 19 | 20 | return false; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotSpecificItem.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import cofh.lib.inventory.ComparableItemStack; 4 | 5 | import net.minecraft.init.Blocks; 6 | import net.minecraft.inventory.IInventory; 7 | import net.minecraft.inventory.Slot; 8 | import net.minecraft.item.ItemStack; 9 | 10 | /** 11 | * Slot which is restricted to a specific item and maximum amount. 12 | * 13 | * @author King Lemming 14 | * 15 | */ 16 | public class SlotSpecificItem extends Slot { 17 | 18 | protected final ComparableItemStack stack; 19 | protected ComparableItemStack query = new ComparableItemStack(new ItemStack(Blocks.stone)); 20 | protected int slotStackLimit = -1; 21 | 22 | public SlotSpecificItem(IInventory inventory, int index, int x, int y, ItemStack stack) { 23 | 24 | super(inventory, index, x, y); 25 | 26 | this.stack = new ComparableItemStack(stack); 27 | } 28 | 29 | @Override 30 | public boolean isItemValid(ItemStack stack) { 31 | 32 | return this.stack.isItemEqual(query.set(stack)); 33 | } 34 | 35 | public SlotSpecificItem setSlotStackLimit(int slotStackLimit) { 36 | 37 | this.slotStackLimit = slotStackLimit; 38 | return this; 39 | } 40 | 41 | @Override 42 | public int getSlotStackLimit() { 43 | 44 | return slotStackLimit <= 0 ? inventory.getInventoryStackLimit() : slotStackLimit; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotValidated.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import net.minecraft.inventory.IInventory; 4 | import net.minecraft.inventory.Slot; 5 | import net.minecraft.item.ItemStack; 6 | 7 | /** 8 | * A slot where the input can be validated based on any arbitrary criteria by using a passthrough method to an {@link ISlotValidator}. 9 | * 10 | * @author King Lemming 11 | * 12 | */ 13 | public class SlotValidated extends Slot { 14 | 15 | ISlotValidator validator; 16 | 17 | public SlotValidated(ISlotValidator validator, IInventory inventory, int index, int x, int y) { 18 | 19 | super(inventory, index, x, y); 20 | this.validator = validator; 21 | } 22 | 23 | @Override 24 | public boolean isItemValid(ItemStack stack) { 25 | 26 | return validator.isItemValid(stack); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/SlotViewOnly.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.gui.slot; 2 | 3 | import cpw.mods.fml.relauncher.Side; 4 | import cpw.mods.fml.relauncher.SideOnly; 5 | 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.inventory.IInventory; 8 | import net.minecraft.inventory.Slot; 9 | import net.minecraft.item.ItemStack; 10 | 11 | /** 12 | * A slot that can only be used to display an item, not edited. Can optionally not highlight when moused over. 13 | */ 14 | public class SlotViewOnly extends Slot { 15 | 16 | protected boolean showHighlight; 17 | 18 | public SlotViewOnly(IInventory inventory, int index, int x, int y) { 19 | 20 | this(inventory, index, x, y, false); 21 | } 22 | 23 | public SlotViewOnly(IInventory inventory, int index, int x, int y, boolean highlight) { 24 | 25 | super(inventory, index, x, y); 26 | showHighlight = highlight; 27 | } 28 | 29 | @Override 30 | public void putStack(ItemStack stack) { 31 | 32 | } 33 | 34 | @Override 35 | public ItemStack decrStackSize(int i) { 36 | 37 | return null; 38 | } 39 | 40 | @Override 41 | public boolean canTakeStack(EntityPlayer player) { 42 | 43 | return false; 44 | } 45 | 46 | @Override 47 | public boolean isItemValid(ItemStack stack) { 48 | 49 | return false; 50 | } 51 | 52 | @Override 53 | @SideOnly(Side.CLIENT) 54 | public boolean func_111238_b() { 55 | 56 | return showHighlight; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/gui/slot/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|gui|slot") 6 | package cofh.lib.gui.slot; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/inventory/ComparableItemStackNBT.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.inventory; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | 6 | /** 7 | * Extension of {@link ComparableItemStack} except NBT sensitive. 8 | * 9 | * It is expected that this will have limited use, so this is a child class for overhead performance reasons. 10 | * 11 | * @author King Lemming 12 | * 13 | */ 14 | public class ComparableItemStackNBT extends ComparableItemStack { 15 | 16 | public NBTTagCompound tag; 17 | 18 | public ComparableItemStackNBT(ItemStack stack) { 19 | 20 | super(stack); 21 | 22 | if (stack != null) { 23 | if (stack.stackTagCompound != null) { 24 | tag = (NBTTagCompound) stack.stackTagCompound.copy(); 25 | } 26 | } 27 | } 28 | 29 | @Override 30 | public boolean isStackEqual(ComparableItemStack other) { 31 | 32 | return super.isStackEqual(other) && isStackTagEqual((ComparableItemStackNBT) other); 33 | } 34 | 35 | private boolean isStackTagEqual(ComparableItemStackNBT other) { 36 | 37 | return tag == null ? other.tag == null : other.tag == null ? false : tag.equals(other.tag); 38 | } 39 | 40 | @Override 41 | public ItemStack toItemStack() { 42 | 43 | ItemStack ret = super.toItemStack(); 44 | if (ret != null) { 45 | ret.stackTagCompound = (NBTTagCompound) tag.copy(); 46 | } 47 | return ret; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/inventory/IInventoryManager.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.inventory; 2 | 3 | import java.util.Map; 4 | 5 | import net.minecraft.item.ItemStack; 6 | 7 | public interface IInventoryManager { 8 | 9 | public boolean canAddItem(ItemStack stack, int slot); 10 | 11 | public boolean canRemoveItem(ItemStack stack, int slot); 12 | 13 | public ItemStack addItem(ItemStack stack); 14 | 15 | public ItemStack removeItem(int maxRemove); 16 | 17 | public ItemStack removeItem(int maxRemove, ItemStack type); 18 | 19 | public ItemStack getSlotContents(int slot); 20 | 21 | public int hasItem(ItemStack type); 22 | 23 | public int findItem(ItemStack type); 24 | 25 | public int[] getSlots(); 26 | 27 | public Map getContents(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/inventory/InventoryCraftingFalse.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.inventory; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.inventory.Container; 5 | import net.minecraft.inventory.IInventory; 6 | import net.minecraft.inventory.InventoryCrafting; 7 | 8 | /** 9 | * This class is used to get recipes (IRecipe requires it...) with a Container. 10 | * 11 | * @author King Lemming 12 | * 13 | */ 14 | public final class InventoryCraftingFalse extends InventoryCrafting { 15 | 16 | private static final NullContainer nullContainer = new NullContainer(); 17 | 18 | /* NULL INNER CLASS */ 19 | public static class NullContainer extends Container { 20 | 21 | @Override 22 | public void onCraftMatrixChanged(IInventory inventory) { 23 | 24 | } 25 | 26 | @Override 27 | public boolean canInteractWith(EntityPlayer player) { 28 | 29 | return false; 30 | } 31 | 32 | } 33 | 34 | public InventoryCraftingFalse(int width, int height) { 35 | 36 | super(nullContainer, width, height); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/inventory/InventoryManager.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.inventory; 2 | 3 | import net.minecraft.inventory.IInventory; 4 | import net.minecraft.inventory.ISidedInventory; 5 | import net.minecraftforge.common.util.ForgeDirection; 6 | 7 | public class InventoryManager { 8 | 9 | public static IInventoryManager create(Object inventory, ForgeDirection targetSide) { 10 | 11 | if (inventory instanceof ISidedInventory) { 12 | return new InventoryManagerSided((ISidedInventory) inventory, targetSide); 13 | } else if (inventory instanceof IInventory) { 14 | return new InventoryManagerStandard((IInventory) inventory, targetSide); 15 | } else { 16 | return null; 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/inventory/InventoryManagerSided.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.inventory; 2 | 3 | import net.minecraft.inventory.ISidedInventory; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraftforge.common.util.ForgeDirection; 6 | 7 | public class InventoryManagerSided extends InventoryManagerStandard { 8 | 9 | private final ISidedInventory _sidedInv; 10 | 11 | public InventoryManagerSided(ISidedInventory inventory, ForgeDirection targetSide) { 12 | 13 | super(inventory, targetSide); 14 | _sidedInv = inventory; 15 | } 16 | 17 | @Override 18 | public boolean canAddItem(ItemStack stack, int slot) { 19 | 20 | return super.canAddItem(stack, slot) && _sidedInv.canInsertItem(slot, stack, _targetSide.ordinal()); 21 | } 22 | 23 | @Override 24 | public boolean canRemoveItem(ItemStack stack, int slot) { 25 | 26 | return _sidedInv.canExtractItem(slot, stack, _targetSide.ordinal()); 27 | } 28 | 29 | @Override 30 | public int[] getSlots() { 31 | 32 | return _sidedInv.getAccessibleSlotsFromSide(_targetSide.ordinal()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/inventory/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|inventory") 6 | package cofh.lib.inventory; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHCore", provides = "CoFHLib") 6 | package cofh.lib; 7 | 8 | import cpw.mods.fml.common.API; 9 | 10 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/render/IFluidOverlayItem.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.render; 2 | 3 | /** 4 | * Simple fluid containers that implement this can be assigned the FactoryFluidOverlayItem. The mask for the fluid is assumed to be for render pass 1, with the 5 | * base icon render pass 0. {@link getRenderPasses(int)} is called to see if the item needs an overlay (return 2) 6 | * 7 | * @author skyboy 8 | */ 9 | public interface IFluidOverlayItem { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/render/RenderItemAsBlock.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.render; 2 | 3 | import net.minecraft.client.renderer.RenderBlocks; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraftforge.client.IItemRenderer; 6 | 7 | import org.lwjgl.opengl.GL11; 8 | 9 | /** 10 | * Easy way of rendering an item which should look like a block. 11 | * 12 | * @author King Lemming 13 | * 14 | */ 15 | public class RenderItemAsBlock implements IItemRenderer { 16 | 17 | public static RenderItemAsBlock instance = new RenderItemAsBlock(); 18 | 19 | @Override 20 | public boolean handleRenderType(ItemStack item, ItemRenderType type) { 21 | 22 | return true; 23 | } 24 | 25 | @Override 26 | public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { 27 | 28 | return true; 29 | } 30 | 31 | @Override 32 | public void renderItem(ItemRenderType type, ItemStack item, Object... data) { 33 | 34 | double offset = -0.5; 35 | if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) { 36 | offset = 0; 37 | } else if (type == ItemRenderType.ENTITY) { 38 | GL11.glScalef(0.5F, 0.5F, 0.5F); 39 | } 40 | RenderHelper.renderItemAsBlock((RenderBlocks) data[0], item, offset, offset, offset); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/render/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|render") 6 | package cofh.lib.render; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/render/particle/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|render|particle") 6 | package cofh.lib.render.particle; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/transport/IEnderChannelRegistry.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.transport; 2 | 3 | import com.google.common.primitives.Ints; 4 | 5 | import java.util.List; 6 | 7 | public interface IEnderChannelRegistry { 8 | 9 | public List getFrequencyList(String channel); 10 | 11 | public String getFrequency(String channel, int freq); 12 | 13 | public String setFrequency(String channel, int freq, String name); 14 | 15 | public String removeFrequency(String channel, int freq); 16 | 17 | public int updated(); 18 | 19 | public static class Frequency implements Comparable { 20 | 21 | public final int freq; 22 | public final String name; 23 | 24 | public Frequency(int freq, String name) { 25 | 26 | this.freq = freq; 27 | this.name = name; 28 | } 29 | 30 | @Override 31 | public int compareTo(Frequency o) { 32 | 33 | if (o == null) { 34 | return 1; 35 | } 36 | return Ints.compare(freq, o.freq); 37 | } 38 | 39 | @Override 40 | public boolean equals(Object o) { 41 | 42 | if (o instanceof Frequency) { 43 | return ((Frequency) o).freq == freq; 44 | } 45 | return false; 46 | } 47 | 48 | @Override 49 | public int hashCode() { 50 | 51 | return freq; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/CharacterSingleton.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | public class CharacterSingleton implements CharSequence { 4 | 5 | public char character; 6 | 7 | @Override 8 | public int length() { 9 | 10 | return 1; 11 | } 12 | 13 | @Override 14 | public char charAt(int index) { 15 | 16 | return character; 17 | } 18 | 19 | @Override 20 | public CharSequence subSequence(int start, int end) { 21 | 22 | if (start == end) { 23 | return ""; 24 | } 25 | return this; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/IdentityLinkedHashList.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | import java.util.Collection; 4 | 5 | @SuppressWarnings("unchecked") 6 | public class IdentityLinkedHashList extends LinkedHashList { 7 | 8 | private static final long serialVersionUID = 4893829808146776641L; 9 | 10 | public IdentityLinkedHashList() { 11 | 12 | super(); 13 | } 14 | 15 | public IdentityLinkedHashList(int size) { 16 | 17 | super(size); 18 | } 19 | 20 | public IdentityLinkedHashList(Collection col) { 21 | 22 | super(col); 23 | } 24 | 25 | @Override 26 | protected int hash(Object o) { 27 | 28 | return System.identityHashCode(o); 29 | } 30 | 31 | @Override 32 | protected Entry seek(Object obj, int hash) { 33 | 34 | for (Entry entry = hashTable[hash & mask]; entry != null; entry = entry.nextInBucket) { 35 | if (obj == entry.key) { 36 | return entry; 37 | } 38 | } 39 | 40 | return null; 41 | } 42 | 43 | @Override 44 | public IdentityLinkedHashList clone() { 45 | 46 | return new IdentityLinkedHashList(this); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/ItemWrapper.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | import net.minecraft.item.Item; 4 | import net.minecraft.item.ItemStack; 5 | 6 | /** 7 | * Wrapper for an Item/Metadata combination post 1.7. Quick and dirty, allows for Integer-based Hashes without collisions. 8 | * 9 | * @author King Lemming 10 | * 11 | */ 12 | public final class ItemWrapper extends ComparableItem { 13 | 14 | public static ItemWrapper fromItemStack(ItemStack stack) { 15 | 16 | return new ItemWrapper(stack); 17 | } 18 | 19 | public ItemWrapper(Item item, int metadata) { 20 | 21 | super(item, metadata); 22 | } 23 | 24 | public ItemWrapper(ItemStack stack) { 25 | 26 | super(stack); 27 | } 28 | 29 | public ItemWrapper(ItemWrapper stack) { 30 | 31 | super(stack); 32 | } 33 | 34 | @Override 35 | public ItemWrapper clone() { 36 | 37 | return new ItemWrapper(this); 38 | } 39 | 40 | @Override 41 | public boolean equals(Object o) { 42 | 43 | if (!(o instanceof ItemWrapper)) { 44 | return false; 45 | } 46 | return isEqual((ItemWrapper) o); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/OreDictionaryProxy.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | import cofh.lib.util.helpers.ItemHelper; 4 | 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraftforge.oredict.OreDictionary; 7 | 8 | /** 9 | * Don't instantiate this or call these methods in any way. Use the methods in {@link ItemHelper}. 10 | * 11 | * @author King Lemming 12 | * 13 | */ 14 | @SuppressWarnings("deprecation") 15 | public class OreDictionaryProxy { 16 | 17 | public ItemStack getOre(String oreName) { 18 | 19 | if (OreDictionary.getOres(oreName).isEmpty()) { 20 | return null; 21 | } 22 | return ItemHelper.cloneStack(OreDictionary.getOres(oreName).get(0), 1); 23 | } 24 | 25 | public int getOreID(ItemStack stack) { 26 | 27 | return OreDictionary.getOreID(stack); 28 | } 29 | 30 | public int getOreID(String oreName) { 31 | 32 | return OreDictionary.getOreID(oreName); 33 | } 34 | 35 | public String getOreName(ItemStack stack) { 36 | 37 | return OreDictionary.getOreName(OreDictionary.getOreID(stack)); 38 | } 39 | 40 | public String getOreName(int oreID) { 41 | 42 | return OreDictionary.getOreName(oreID); 43 | } 44 | 45 | public boolean isOreIDEqual(ItemStack stack, int oreID) { 46 | 47 | return OreDictionary.getOreID(stack) == oreID; 48 | } 49 | 50 | public boolean isOreNameEqual(ItemStack stack, String oreName) { 51 | 52 | return OreDictionary.getOreName(OreDictionary.getOreID(stack)).equals(oreName); 53 | } 54 | 55 | public boolean oreNameExists(String oreName) { 56 | 57 | return OreDictionary.doesOreNameExist(oreName); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/TimeTracker.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | import net.minecraft.world.World; 4 | 5 | /** 6 | * A basic time tracker class. Nothing surprising here. 7 | * 8 | * @author King Lemming 9 | * 10 | */ 11 | public class TimeTracker { 12 | 13 | private long lastMark = Long.MIN_VALUE; 14 | 15 | public boolean hasDelayPassed(World world, int delay) { 16 | 17 | long currentTime = world.getTotalWorldTime(); 18 | 19 | if (currentTime < lastMark) { 20 | lastMark = currentTime; 21 | return false; 22 | } else if (lastMark + delay <= currentTime) { 23 | lastMark = currentTime; 24 | return true; 25 | } 26 | return false; 27 | } 28 | 29 | public void markTime(World world) { 30 | 31 | lastMark = world.getTotalWorldTime(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/WeightedRandomItemStack.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraft.util.WeightedRandom; 5 | 6 | public class WeightedRandomItemStack extends WeightedRandom.Item { 7 | 8 | private final ItemStack stack; 9 | 10 | public WeightedRandomItemStack(ItemStack stack) { 11 | 12 | this(stack, 100); 13 | } 14 | 15 | public WeightedRandomItemStack(ItemStack stack, int weight) { 16 | 17 | super(weight); 18 | this.stack = stack; 19 | } 20 | 21 | public ItemStack getStack() { 22 | 23 | if (stack == null) { 24 | return null; 25 | } 26 | return stack.copy(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/WeightedRandomNBTTag.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | import net.minecraft.nbt.NBTBase; 4 | import net.minecraft.util.WeightedRandom; 5 | 6 | public class WeightedRandomNBTTag extends WeightedRandom.Item { 7 | 8 | public final NBTBase tag; 9 | 10 | public WeightedRandomNBTTag(int weight, NBTBase tag) { 11 | 12 | super(weight); 13 | this.tag = tag; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/WeightedRandomWorldGenerator.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util; 2 | 3 | import net.minecraft.util.WeightedRandom; 4 | import net.minecraft.world.gen.feature.WorldGenerator; 5 | 6 | public final class WeightedRandomWorldGenerator extends WeightedRandom.Item { 7 | 8 | public final WorldGenerator generator; 9 | 10 | public WeightedRandomWorldGenerator(WorldGenerator worldgen) { 11 | 12 | this(worldgen, 100); 13 | } 14 | 15 | public WeightedRandomWorldGenerator(WorldGenerator worldgen, int weight) { 16 | 17 | super(weight); 18 | generator = worldgen; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/helpers/AugmentHelper.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util.helpers; 2 | 3 | import cofh.api.item.IAugmentItem; 4 | 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import net.minecraft.nbt.NBTTagList; 8 | 9 | public class AugmentHelper { 10 | 11 | private AugmentHelper() { 12 | 13 | } 14 | 15 | /* NBT TAG HELPERS */ 16 | public static void writeAugmentsToNBT(NBTTagCompound nbt, ItemStack[] augments) { 17 | 18 | if (augments.length <= 0) { 19 | return; 20 | } 21 | NBTTagList list = new NBTTagList(); 22 | for (int i = 0; i < augments.length; i++) { 23 | if (augments[i] != null) { 24 | NBTTagCompound tag = new NBTTagCompound(); 25 | tag.setInteger("Slot", i); 26 | augments[i].writeToNBT(tag); 27 | list.appendTag(tag); 28 | } 29 | } 30 | nbt.setTag("Augments", list); 31 | } 32 | 33 | /* ITEM HELPERS */ 34 | public static void writeAugments(ItemStack stack, ItemStack[] augments) { 35 | 36 | if (augments.length <= 0) { 37 | return; 38 | } 39 | if (stack.stackTagCompound == null) { 40 | stack.setTagCompound(new NBTTagCompound()); 41 | } 42 | NBTTagList list = new NBTTagList(); 43 | for (int i = 0; i < augments.length; i++) { 44 | if (augments[i] != null) { 45 | NBTTagCompound tag = new NBTTagCompound(); 46 | tag.setInteger("Slot", i); 47 | augments[i].writeToNBT(tag); 48 | list.appendTag(tag); 49 | } 50 | } 51 | stack.stackTagCompound.setTag("Augments", list); 52 | } 53 | 54 | public static boolean isAugmentItem(ItemStack stack) { 55 | 56 | return stack != null && stack.getItem() instanceof IAugmentItem; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/helpers/ServerHelper.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util.helpers; 2 | 3 | import cpw.mods.fml.client.FMLClientHandler; 4 | import cpw.mods.fml.common.FMLCommonHandler; 5 | 6 | import net.minecraft.client.network.NetHandlerPlayClient; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; 10 | import net.minecraft.world.World; 11 | 12 | /** 13 | * Contains various helper functions to assist with determining Server/Client status. 14 | * 15 | * @author King Lemming 16 | * 17 | */ 18 | public final class ServerHelper { 19 | 20 | private ServerHelper() { 21 | 22 | } 23 | 24 | public static final boolean isClientWorld(World world) { 25 | 26 | return world.isRemote; 27 | } 28 | 29 | public static final boolean isServerWorld(World world) { 30 | 31 | return !world.isRemote; 32 | } 33 | 34 | public static final boolean isSinglePlayerServer() { 35 | 36 | return FMLCommonHandler.instance().getMinecraftServerInstance() != null; 37 | } 38 | 39 | public static final boolean isMultiPlayerServer() { 40 | 41 | return FMLCommonHandler.instance().getMinecraftServerInstance() == null; 42 | } 43 | 44 | /** 45 | * This function circumvents a miserable failing. 46 | */ 47 | public static final void sendItemUsePacket(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int hitSide, float hitX, float hitY, 48 | float hitZ) { 49 | 50 | if (isServerWorld(world)) { 51 | return; 52 | } 53 | NetHandlerPlayClient netClientHandler = (NetHandlerPlayClient) FMLClientHandler.instance().getClientPlayHandler(); 54 | netClientHandler.addToSendQueue(new C08PacketPlayerBlockPlacement(x, y, z, hitSide, player.inventory.getCurrentItem(), hitX, hitY, hitZ)); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/helpers/SoundHelper.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util.helpers; 2 | 3 | import cofh.lib.audio.SoundBase; 4 | import cpw.mods.fml.client.FMLClientHandler; 5 | 6 | import net.minecraft.client.audio.ISound; 7 | import net.minecraft.client.audio.SoundHandler; 8 | 9 | /** 10 | * Contains various helper functions to assist with Sound manipulation. 11 | * 12 | * @author King Lemming 13 | * 14 | */ 15 | public class SoundHelper { 16 | 17 | public static final SoundHandler soundManager = FMLClientHandler.instance().getClient().getSoundHandler(); 18 | 19 | /** 20 | * This allows you to have some tricky functionality with Tile Entities. Just be sure you aren't dumb. 21 | */ 22 | public static void playSound(Object sound) { 23 | 24 | if (sound instanceof ISound) { 25 | soundManager.playSound((ISound) sound); 26 | } 27 | } 28 | 29 | public static void playSound(ISound sound) { 30 | 31 | soundManager.playSound(sound); 32 | } 33 | 34 | public static void playSound(String soundName, float x, float y, float z, float volume, float pitch) { 35 | 36 | soundManager.playSound(new SoundBase(soundName, volume, pitch, x, y, z)); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/helpers/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|util|helpers") 6 | package cofh.lib.util.helpers; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|util") 6 | package cofh.lib.util; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/position/IRotateableTile.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.util.position; 2 | 3 | import net.minecraftforge.common.util.ForgeDirection; 4 | 5 | public interface IRotateableTile { 6 | 7 | public boolean canRotate(); 8 | 9 | public boolean canRotate(ForgeDirection axis); 10 | 11 | public void rotate(ForgeDirection axis); 12 | 13 | public void rotateDirectlyTo(int facing); 14 | 15 | public ForgeDirection getDirectionFacing(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/util/position/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|util|position") 6 | package cofh.lib.util.position; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/WorldGenMinablePlate.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.world; 2 | 3 | import static cofh.lib.world.WorldGenMinableCluster.generateBlock; 4 | 5 | import cofh.lib.util.WeightedRandomBlock; 6 | 7 | import java.util.List; 8 | import java.util.Random; 9 | 10 | import net.minecraft.world.World; 11 | import net.minecraft.world.gen.feature.WorldGenerator; 12 | 13 | public class WorldGenMinablePlate extends WorldGenerator { 14 | 15 | private final List cluster; 16 | private final WeightedRandomBlock[] genBlock; 17 | private final int radius; 18 | public byte height = 1; 19 | public byte variation = 2; 20 | public boolean slim = false; 21 | 22 | public WorldGenMinablePlate(List resource, int clusterSize, List block) { 23 | 24 | cluster = resource; 25 | radius = clusterSize; 26 | genBlock = block.toArray(new WeightedRandomBlock[block.size()]); 27 | } 28 | 29 | @Override 30 | public boolean generate(World world, Random rand, int x, int y, int z) { 31 | 32 | ++y; 33 | int size = radius; 34 | if (radius > variation + 1) { 35 | size = rand.nextInt(radius - variation) + variation; 36 | } 37 | final int dist = size * size; 38 | byte height = this.height; 39 | 40 | boolean r = false; 41 | for (int posX = x - size; posX <= x + size; ++posX) { 42 | int xDist = posX - x; 43 | xDist *= xDist; 44 | for (int posZ = z - size; posZ <= z + size; ++posZ) { 45 | int zSize = posZ - z; 46 | 47 | if (zSize * zSize + xDist <= dist) { 48 | for (int posY = y - height; slim ? posY < y + height : posY <= y + height; ++posY) { 49 | r |= generateBlock(world, posX, posY, posZ, genBlock, cluster); 50 | } 51 | } 52 | } 53 | } 54 | 55 | return r; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/WorldGenMulti.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.world; 2 | 3 | import cofh.lib.util.WeightedRandomWorldGenerator; 4 | 5 | import java.util.ArrayList; 6 | import java.util.Random; 7 | 8 | import net.minecraft.util.WeightedRandom; 9 | import net.minecraft.world.World; 10 | import net.minecraft.world.gen.feature.WorldGenerator; 11 | 12 | public class WorldGenMulti extends WorldGenerator { 13 | 14 | private final WeightedRandomWorldGenerator[] generators; 15 | 16 | public WorldGenMulti(ArrayList values) { 17 | 18 | generators = values.toArray(new WeightedRandomWorldGenerator[values.size()]); 19 | } 20 | 21 | @Override 22 | public boolean generate(World world, Random random, int x, int y, int z) { 23 | 24 | WeightedRandomWorldGenerator gen = (WeightedRandomWorldGenerator) WeightedRandom.getRandomItem(random, generators); 25 | return gen.generator.generate(world, random, x, y, z); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/WorldGenStalactite.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.world; 2 | 3 | import static cofh.lib.world.WorldGenMinableCluster.*; 4 | 5 | import cofh.lib.util.WeightedRandomBlock; 6 | 7 | import java.util.List; 8 | import java.util.Random; 9 | 10 | import net.minecraft.world.World; 11 | 12 | public class WorldGenStalactite extends WorldGenStalagmite { 13 | 14 | public WorldGenStalactite(List resource, List block, List gblock) { 15 | 16 | super(resource, block, gblock); 17 | } 18 | 19 | @Override 20 | public boolean generate(World world, Random rand, int xStart, int yStart, int zStart) { 21 | 22 | int end = world.getActualHeight(); 23 | while (world.isAirBlock(xStart, yStart, zStart) && yStart < end) { 24 | ++yStart; 25 | } 26 | 27 | if (!canGenerateInBlock(world, xStart, yStart--, zStart, baseBlock)) { 28 | return false; 29 | } 30 | 31 | int maxHeight = rand.nextInt(heightVariance) + minHeight; 32 | 33 | int size = genSize > 0 ? genSize : maxHeight / heightMod + rand.nextInt(sizeVariance); 34 | boolean r = false; 35 | for (int x = -size; x <= size; ++x) { 36 | for (int z = -size; z <= size; ++z) { 37 | if (!canGenerateInBlock(world, xStart + x, yStart + 1, zStart + z, baseBlock)) { 38 | continue; 39 | } 40 | int height = getHeight(x, z, size, rand, maxHeight); 41 | for (int y = 0; y < height; ++y) { 42 | r |= generateBlock(world, xStart + x, yStart - y, zStart + z, genBlock, cluster); 43 | } 44 | } 45 | } 46 | return r; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/biome/BiomeDictionaryArbiter.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.world.biome; 2 | 3 | import cpw.mods.fml.common.Loader; 4 | import cpw.mods.fml.common.LoaderState; 5 | 6 | import java.util.HashMap; 7 | 8 | import net.minecraft.world.biome.BiomeGenBase; 9 | import net.minecraftforge.common.BiomeDictionary; 10 | import net.minecraftforge.common.BiomeDictionary.Type; 11 | 12 | public class BiomeDictionaryArbiter { 13 | 14 | private static HashMap types = new HashMap(); 15 | private static HashMap biomes = new HashMap(); 16 | private static boolean loaded = Loader.instance().isInState(LoaderState.AVAILABLE); 17 | 18 | public static Type[] getTypesForBiome(BiomeGenBase biome) { 19 | 20 | if (loaded) { 21 | Type[] r = types.get(biome); 22 | if (r == null) { 23 | types.put(biome, r = BiomeDictionary.getTypesForBiome(biome)); 24 | } 25 | return r; 26 | } 27 | loaded = Loader.instance().isInState(LoaderState.AVAILABLE); 28 | return BiomeDictionary.getTypesForBiome(biome); 29 | } 30 | 31 | public static BiomeGenBase[] getTypesForBiome(Type type) { 32 | 33 | if (loaded) { 34 | BiomeGenBase[] r = biomes.get(type); 35 | if (r == null) { 36 | biomes.put(type, r = BiomeDictionary.getBiomesForType(type)); 37 | } 38 | return r; 39 | } 40 | loaded = Loader.instance().isInState(LoaderState.AVAILABLE); 41 | return BiomeDictionary.getBiomesForType(type); 42 | } 43 | 44 | private BiomeDictionaryArbiter() { 45 | 46 | throw new IllegalArgumentException(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/biome/BiomeInfoRarity.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.world.biome; 2 | 3 | import java.util.Random; 4 | 5 | import net.minecraft.world.biome.BiomeGenBase; 6 | 7 | public class BiomeInfoRarity extends BiomeInfo { 8 | 9 | private final int rarity; 10 | 11 | public BiomeInfoRarity(String name, int r) { 12 | 13 | super(name); 14 | rarity = r; 15 | } 16 | 17 | public BiomeInfoRarity(Object d, int t, boolean wl, int r) { 18 | 19 | super(d, t, wl); 20 | rarity = r; 21 | } 22 | 23 | @Override 24 | public boolean isBiomeEqual(BiomeGenBase biome, Random rand) { 25 | 26 | boolean r = super.isBiomeEqual(biome, rand); 27 | if (rand != null) { 28 | return r ? rarity <= 1 || rand.nextInt(rarity) == 0 : false; 29 | } 30 | return r; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/feature/FeatureGenNormal.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.world.feature; 2 | 3 | import java.util.Random; 4 | 5 | import net.minecraft.world.World; 6 | import net.minecraft.world.gen.feature.WorldGenerator; 7 | 8 | public class FeatureGenNormal extends FeatureBase { 9 | 10 | final WorldGenerator worldGen; 11 | final int count; 12 | final int meanY; 13 | final int maxVar; 14 | 15 | public FeatureGenNormal(String name, WorldGenerator worldGen, int count, int meanY, int maxVar, GenRestriction biomeRes, boolean regen, 16 | GenRestriction dimRes) { 17 | 18 | super(name, biomeRes, regen, dimRes); 19 | this.worldGen = worldGen; 20 | this.count = count; 21 | this.meanY = meanY; 22 | this.maxVar = maxVar; 23 | } 24 | 25 | @Override 26 | public boolean generateFeature(Random random, int chunkX, int chunkZ, World world) { 27 | 28 | int blockX = chunkX * 16; 29 | int blockZ = chunkZ * 16; 30 | 31 | boolean generated = false; 32 | for (int i = 0; i < count; i++) { 33 | int x = blockX + random.nextInt(16); 34 | int y = maxVar <= 1 ? meanY : (random.nextInt(maxVar) + random.nextInt(maxVar) + meanY - maxVar); 35 | int z = blockZ + random.nextInt(16); 36 | if (!canGenerateInBiome(world, x, z, random)) { 37 | continue; 38 | } 39 | 40 | generated |= worldGen.generate(world, random, x, y, z); 41 | } 42 | return generated; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/feature/FeatureGenUniform.java: -------------------------------------------------------------------------------- 1 | package cofh.lib.world.feature; 2 | 3 | import java.util.Random; 4 | 5 | import net.minecraft.world.World; 6 | import net.minecraft.world.gen.feature.WorldGenerator; 7 | 8 | public class FeatureGenUniform extends FeatureBase { 9 | 10 | final WorldGenerator worldGen; 11 | final int count; 12 | final int minY; 13 | final int maxY; 14 | 15 | public FeatureGenUniform(String name, WorldGenerator worldGen, int count, int minY, int maxY, GenRestriction biomeRes, boolean regen, GenRestriction dimRes) { 16 | 17 | super(name, biomeRes, regen, dimRes); 18 | this.worldGen = worldGen; 19 | this.count = count; 20 | this.minY = minY; 21 | this.maxY = maxY; 22 | } 23 | 24 | @Override 25 | public boolean generateFeature(Random random, int chunkX, int chunkZ, World world) { 26 | 27 | int blockX = chunkX * 16; 28 | int blockZ = chunkZ * 16; 29 | 30 | boolean generated = false; 31 | for (int i = 0; i < count; i++) { 32 | int x = blockX + random.nextInt(16); 33 | int y = minY + random.nextInt(maxY - minY); 34 | int z = blockZ + random.nextInt(16); 35 | if (!canGenerateInBiome(world, x, z, random)) { 36 | continue; 37 | } 38 | 39 | generated |= worldGen.generate(world, random, x, y, z); 40 | } 41 | return generated; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/feature/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|world|feature") 6 | package cofh.lib.world.feature; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/java/cofh/lib/world/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * (C) 2014 Team CoFH / CoFH / Cult of the Full Hub 3 | * http://www.teamcofh.com 4 | */ 5 | @API(apiVersion = CoFHLibProps.VERSION, owner = "CoFHLib", provides = "CoFHLib|world") 6 | package cofh.lib.world; 7 | 8 | import cofh.lib.CoFHLibProps; 9 | import cpw.mods.fml.common.API; 10 | 11 | -------------------------------------------------------------------------------- /src/packapi/resources/cofhlib_at.cfg: -------------------------------------------------------------------------------- 1 | 2 | protected net.minecraft.inventory.Container * # senseless to have private stuff here 3 | protected net.minecraft.client.gui.inventory.GuiContainer * # senseless to have private stuff here 4 | public net.minecraft.util.RegistrySimple field_82596_a # registryObjects 5 | public-f net.minecraft.util.RegistryNamespaced field_148759_a # underlyingIntegerMap 6 | 7 | public net.minecraft.server.management.PlayerManager func_72690_a(IIZ)Lnet/minecraft/server/management/PlayerManager$PlayerInstance; # getOrCreateChunkWatcher 8 | public net.minecraft.server.management.PlayerManager$PlayerInstance 9 | --------------------------------------------------------------------------------