├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── screenshots ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png ├── 6.png ├── 7.png └── 8.png ├── src ├── main │ ├── java │ │ └── com │ │ │ └── warmthdawn │ │ │ └── mod │ │ │ └── gugu_utils │ │ │ ├── GuGuUtils.java │ │ │ ├── ModBlocks.java │ │ │ ├── ModItems.java │ │ │ ├── asm │ │ │ ├── GuGuUtilsCore.java │ │ │ ├── common │ │ │ │ ├── GuGuAsmTransformer.java │ │ │ │ └── MyTransformer.java │ │ │ ├── mixin │ │ │ │ └── MixinModularMachinery.java │ │ │ ├── transformers │ │ │ │ ├── ActiveMachineRecipeTransformer.java │ │ │ │ ├── DynamicMachineDeserializerTransformer.java │ │ │ │ └── TileMachineControllerTransformer.java │ │ │ └── utils │ │ │ │ ├── AsmUtils.java │ │ │ │ └── SafeClassWriter.java │ │ │ ├── botania │ │ │ ├── BotaniaCompact.java │ │ │ ├── SubtileRegisterOverride.java │ │ │ ├── lens │ │ │ │ ├── ItemLensAddition.java │ │ │ │ ├── ItemLensOverclocking.java │ │ │ │ ├── ItemLensTransform.java │ │ │ │ ├── LensOverclocking.java │ │ │ │ └── LensTransform.java │ │ │ ├── recipes │ │ │ │ └── TransformRecipe.java │ │ │ └── subtitle │ │ │ │ ├── SubTileArcaneRoseModified.java │ │ │ │ ├── SubTileDandelifeonModified.java │ │ │ │ ├── SubTileEndoflameModified.java │ │ │ │ ├── SubTileEntropinnyumModified.java │ │ │ │ ├── SubTileRafflowsiaModified.java │ │ │ │ ├── SubTileShulkMeNotModified.java │ │ │ │ ├── SubTileSpectrolusModified.java │ │ │ │ └── Tools.java │ │ │ ├── client │ │ │ ├── ParticleTypes.java │ │ │ └── particle │ │ │ │ └── ParticleEnergyBall.java │ │ │ ├── command │ │ │ └── GuGuCraftCommand.java │ │ │ ├── common │ │ │ ├── Constants.java │ │ │ ├── Enables.java │ │ │ ├── GenericBlock.java │ │ │ ├── IGuiProvider.java │ │ │ ├── IRestorableTileEntity.java │ │ │ ├── VariantBlock.java │ │ │ ├── VariantItem.java │ │ │ └── slot │ │ │ │ ├── DisplayFluidSlot.java │ │ │ │ ├── GenericSlot.java │ │ │ │ ├── GhostFluidSlot.java │ │ │ │ └── GhostItemSlot.java │ │ │ ├── compat │ │ │ └── PneumaticCraftCompat.java │ │ │ ├── config │ │ │ ├── CoreConfig.java │ │ │ ├── GuGuUtilsConfig.java │ │ │ ├── HatchesConfig.java │ │ │ ├── PluginsConfig.java │ │ │ └── TweaksConfig.java │ │ │ ├── crafttweaker │ │ │ ├── CraftTweakerCompact.java │ │ │ ├── gugu │ │ │ │ ├── BurstTransform.java │ │ │ │ ├── ITransformContext.java │ │ │ │ ├── ITransformEvent.java │ │ │ │ ├── ITransformFunction.java │ │ │ │ └── TransformContext.java │ │ │ ├── modularmachenary │ │ │ │ └── RecipePrimerExt.java │ │ │ └── psi │ │ │ │ └── TrickInfusionRecipe.java │ │ │ ├── gugucrttool │ │ │ ├── AdditionalInfoInventory.java │ │ │ ├── CrtToolContainer.java │ │ │ ├── CrtToolGui.java │ │ │ ├── FluidAmountContainer.java │ │ │ ├── FluidAmountGui.java │ │ │ ├── GhostAddtionalInfoSlot.java │ │ │ ├── GhostJEIHandler.java │ │ │ └── GuGuZsBuilder.java │ │ │ ├── gui │ │ │ ├── FluidInventory.java │ │ │ ├── GenericContainer.java │ │ │ ├── GenericGui.java │ │ │ ├── GuGuCrtToolProvider.java │ │ │ ├── GuiEvent.java │ │ │ └── ModIndependentGuis.java │ │ │ ├── handler │ │ │ ├── ClientEventHandler.java │ │ │ ├── GuiHandler.java │ │ │ ├── MiscEventHandler.java │ │ │ ├── StarlightHandler.java │ │ │ └── tweaks │ │ │ │ ├── EntropinnyumTNTHandler.java │ │ │ │ └── GaiaHandler.java │ │ │ ├── jei │ │ │ ├── InfoHelper.java │ │ │ ├── JEICompact.java │ │ │ ├── LayoutWapper.java │ │ │ ├── botania │ │ │ │ ├── BurstTransformCategory.java │ │ │ │ └── BurstTransformWapper.java │ │ │ ├── components │ │ │ │ ├── JEIComponentAspect.java │ │ │ │ ├── JEIComponentAura.java │ │ │ │ ├── JEIComponentCompressedAir.java │ │ │ │ ├── JEIComponentEmber.java │ │ │ │ ├── JEIComponentEnvironment.java │ │ │ │ ├── JEIComponentHotAir.java │ │ │ │ ├── JEIComponentMana.java │ │ │ │ └── JEIComponentStarlight.java │ │ │ ├── ingedients │ │ │ │ ├── IngredientAspect.java │ │ │ │ ├── IngredientAura.java │ │ │ │ ├── IngredientCompressedAir.java │ │ │ │ ├── IngredientEmber.java │ │ │ │ ├── IngredientEnvironment.java │ │ │ │ ├── IngredientHotAir.java │ │ │ │ ├── IngredientInfo.java │ │ │ │ ├── IngredientMana.java │ │ │ │ └── IngredientStarlight.java │ │ │ └── renders │ │ │ │ ├── RendererAspect.java │ │ │ │ ├── RendererAura.java │ │ │ │ ├── RendererCompressedAir.java │ │ │ │ ├── RendererEmber.java │ │ │ │ ├── RendererEnvironment.java │ │ │ │ ├── RendererHotAir.java │ │ │ │ ├── RendererMana.java │ │ │ │ └── RendererStarlight.java │ │ │ ├── modularmachenary │ │ │ ├── CommonMMTile.java │ │ │ ├── IColorableTileEntity.java │ │ │ ├── MMCompoments.java │ │ │ ├── MMRequirements.java │ │ │ ├── ModularMachenaryCompact.java │ │ │ ├── aspect │ │ │ │ ├── BlockAspectHatch.java │ │ │ │ └── TileAspectHatch.java │ │ │ ├── aura │ │ │ │ ├── BlockAuraInputHatch.java │ │ │ │ ├── TileAuraHatch.java │ │ │ │ └── TileAuraInputHatch.java │ │ │ ├── common │ │ │ │ └── IOHatchVariant.java │ │ │ ├── components │ │ │ │ ├── ComponentAspect.java │ │ │ │ ├── ComponentAura.java │ │ │ │ ├── ComponentCompressedAir.java │ │ │ │ ├── ComponentEmber.java │ │ │ │ ├── ComponentEnvironment.java │ │ │ │ ├── ComponentHotAir.java │ │ │ │ ├── ComponentMana.java │ │ │ │ ├── ComponentStarlight.java │ │ │ │ └── GenericMachineCompoment.java │ │ │ ├── embers │ │ │ │ ├── BlockEmberInputHatch.java │ │ │ │ ├── EmbersHatchVariant.java │ │ │ │ └── TileEmberInputHatch.java │ │ │ ├── environment │ │ │ │ ├── BlockEnvironmentHatch.java │ │ │ │ ├── TileEnvironmentHatch.java │ │ │ │ └── envtypes │ │ │ │ │ ├── EnvAltitude.java │ │ │ │ │ ├── EnvBoime.java │ │ │ │ │ ├── EnvDimension.java │ │ │ │ │ ├── EnvMoonPhase.java │ │ │ │ │ ├── EnvTime.java │ │ │ │ │ ├── EnvWeather.java │ │ │ │ │ └── EnvironmentType.java │ │ │ ├── hotair │ │ │ │ ├── BlockHotAirInputHatch.java │ │ │ │ ├── HotAirHatchState.java │ │ │ │ └── TileHotAirInputHatch.java │ │ │ ├── mana │ │ │ │ ├── BlockSparkManaHatch.java │ │ │ │ ├── ItemManaBlock.java │ │ │ │ ├── TileSparkManaHatch.java │ │ │ │ ├── TileSparkManaInputHatch.java │ │ │ │ └── TileSparkManaOutputHatch.java │ │ │ ├── mek │ │ │ │ └── laser │ │ │ │ │ ├── BlockMekLaserHatch.java │ │ │ │ │ └── TileEntityMekLaser.java │ │ │ ├── pressure │ │ │ │ ├── BlockPressureHatch.java │ │ │ │ ├── ContainerPressureHatch.java │ │ │ │ ├── GuiPressureHatch.java │ │ │ │ ├── IUpgradeAcceptorWrapper.java │ │ │ │ ├── PressureHatchVariant.java │ │ │ │ ├── TilePressureHatch.java │ │ │ │ ├── TilePressureInputHatch.java │ │ │ │ └── TilePressureOutputHatch.java │ │ │ ├── requirements │ │ │ │ ├── RequirementAspect.java │ │ │ │ ├── RequirementAspectOutput.java │ │ │ │ ├── RequirementAura.java │ │ │ │ ├── RequirementCompressedAir.java │ │ │ │ ├── RequirementCompressedAirPerTick.java │ │ │ │ ├── RequirementEmber.java │ │ │ │ ├── RequirementEnvironment.java │ │ │ │ ├── RequirementHotAir.java │ │ │ │ ├── RequirementMana.java │ │ │ │ ├── RequirementManaPerTick.java │ │ │ │ ├── RequirementStarlight.java │ │ │ │ ├── basic │ │ │ │ │ ├── ComponentRequirementAdapter.java │ │ │ │ │ ├── CraftingResourceHolder.java │ │ │ │ │ ├── IComponentRequirement.java │ │ │ │ │ ├── IConsumable.java │ │ │ │ │ ├── ICraftNotifier.java │ │ │ │ │ ├── ICraftingResourceHolder.java │ │ │ │ │ ├── IGeneratable.java │ │ │ │ │ ├── IResourceToken.java │ │ │ │ │ ├── RequirementConsumeOnce.java │ │ │ │ │ ├── RequirementConsumePerTick.java │ │ │ │ │ └── RequirementUtils.java │ │ │ │ └── types │ │ │ │ │ ├── RequirementTypeAdapter.java │ │ │ │ │ ├── RequirementTypeAspect.java │ │ │ │ │ ├── RequirementTypeAura.java │ │ │ │ │ ├── RequirementTypeCompressedAir.java │ │ │ │ │ ├── RequirementTypeCompressedAirPerTick.java │ │ │ │ │ ├── RequirementTypeEmber.java │ │ │ │ │ ├── RequirementTypeEnvironment.java │ │ │ │ │ ├── RequirementTypeHotAir.java │ │ │ │ │ ├── RequirementTypeMana.java │ │ │ │ │ ├── RequirementTypeManaPerTick.java │ │ │ │ │ └── RequirementTypeStarlight.java │ │ │ ├── starlight │ │ │ │ ├── BlockStarightInputHatch.java │ │ │ │ ├── ContainerStarlightInputHatch.java │ │ │ │ ├── GuiStarlightInputHatch.java │ │ │ │ ├── StarlightHatchVariant.java │ │ │ │ └── TileStarlightInputHatch.java │ │ │ ├── tools │ │ │ │ └── ItemRangedConstructTool.java │ │ │ ├── tweak │ │ │ │ └── MMRecipeFailureActions.java │ │ │ └── vanilla │ │ │ │ ├── BlockEnergyOutputPort.java │ │ │ │ ├── OutputPortState.java │ │ │ │ ├── TESREnergyOutputPort.java │ │ │ │ └── TileEnergyOutputPort.java │ │ │ ├── network │ │ │ ├── Messages.java │ │ │ ├── PacketCollectorPostion.java │ │ │ ├── PacketMana.java │ │ │ ├── PacketParticles.java │ │ │ ├── PacketSetContainerSlot.java │ │ │ └── PacketStarlight.java │ │ │ ├── proxy │ │ │ ├── ClientProxy.java │ │ │ ├── CommonProxy.java │ │ │ └── ServerProxy.java │ │ │ ├── psi │ │ │ ├── PieceTrickAccelerate.java │ │ │ └── PsiCompact.java │ │ │ └── tools │ │ │ ├── CIELab.java │ │ │ ├── ItemNBTUtils.java │ │ │ ├── OpenGlDebugging.java │ │ │ ├── RenderTools.java │ │ │ ├── RenderToolsInternal.java │ │ │ ├── RenderUtils.java │ │ │ ├── ResourceUtils.java │ │ │ └── StackUtils.java │ └── resources │ │ ├── META-INF │ │ └── gugu_at.cfg │ │ ├── assets │ │ └── gugu-utils │ │ │ ├── blockstates │ │ │ ├── aspecthatch.json │ │ │ ├── aspectinputhatch.json │ │ │ ├── aurainputhatch.json │ │ │ ├── emberinputhatch.json │ │ │ ├── energyoutputport.json │ │ │ ├── environmenthatch.json │ │ │ ├── hotairinputhatch.json │ │ │ ├── overclocking_spreader.json │ │ │ ├── pressurehatch.json │ │ │ ├── psiinputhatch.json │ │ │ ├── sparkmanahatch.json │ │ │ └── starlightinputhatch.json │ │ │ ├── lang │ │ │ ├── en_us.lang │ │ │ └── zh_cn.lang │ │ │ ├── models │ │ │ ├── block │ │ │ │ ├── aspectinputhatch.json │ │ │ │ ├── aspectoutputhatch.json │ │ │ │ ├── blockmodel_overlay_column.json │ │ │ │ ├── emberinputhatch_big.json │ │ │ │ ├── emberinputhatch_extreme.json │ │ │ │ ├── emberinputhatch_huge.json │ │ │ │ ├── emberinputhatch_ludicrous.json │ │ │ │ ├── emberinputhatch_medium.json │ │ │ │ ├── emberinputhatch_reinforced.json │ │ │ │ ├── emberinputhatch_small.json │ │ │ │ ├── emberinputhatch_tiny.json │ │ │ │ ├── pressureinputhatch.json │ │ │ │ ├── pressureoutputhatch.json │ │ │ │ ├── sparkmanainputhatch.json │ │ │ │ ├── sparkmanaoutputhatch.json │ │ │ │ ├── spreader_overclocking.json │ │ │ │ ├── starlightinputhatch_basic.json │ │ │ │ ├── starlightinputhatch_brilliant.json │ │ │ │ └── starlightinputhatch_trait.json │ │ │ └── item │ │ │ │ ├── constructionranged.json │ │ │ │ ├── lensoverclocking.json │ │ │ │ └── lenstransform.json │ │ │ └── textures │ │ │ ├── blocks │ │ │ ├── front_energyoutputport.png │ │ │ ├── front_energyoutputport_off.png │ │ │ ├── overlay_airinputhatch_end.png │ │ │ ├── overlay_airinputhatch_off.png │ │ │ ├── overlay_airinputhatch_on.png │ │ │ ├── overlay_aspectinputhatch.png │ │ │ ├── overlay_aspectoutputhatch.png │ │ │ ├── overlay_aurainputhatch.png │ │ │ ├── overlay_emberinputhatch_big.png │ │ │ ├── overlay_emberinputhatch_extreme.png │ │ │ ├── overlay_emberinputhatch_huge.png │ │ │ ├── overlay_emberinputhatch_ludicrous.png │ │ │ ├── overlay_emberinputhatch_medium.png │ │ │ ├── overlay_emberinputhatch_reinforced.png │ │ │ ├── overlay_emberinputhatch_small.png │ │ │ ├── overlay_emberinputhatch_tiny.png │ │ │ ├── overlay_energyoutputport.png │ │ │ ├── overlay_energyoutputport_off.png │ │ │ ├── overlay_environmenthatch.png │ │ │ ├── overlay_pressureinputhatch.png │ │ │ ├── overlay_pressureoutputhatch.png │ │ │ ├── overlay_psiinputhatch.png │ │ │ ├── overlay_psiinputhatch_invaild.png │ │ │ ├── overlay_sparkmanainputhatch.png │ │ │ ├── overlay_sparkmanaoutputhatch.png │ │ │ ├── overlay_starlightinputhatch_basic.png │ │ │ ├── overlay_starlightinputhatch_brilliant.png │ │ │ ├── overlay_starlightinputhatch_brilliant_2.png │ │ │ └── overlay_starlightinputhatch_trait.png │ │ │ ├── gui │ │ │ ├── gui_additional.png │ │ │ ├── gui_amount_specifying.png │ │ │ ├── gui_gugucrt.png │ │ │ ├── gui_gugucrt.psd │ │ │ ├── gui_starlightinputhatch.png │ │ │ └── recipes_ui.png │ │ │ ├── items │ │ │ ├── lens_overclocking.png │ │ │ ├── lens_transform.png │ │ │ └── rangedwrench.png │ │ │ ├── model │ │ │ └── spreader_item │ │ │ │ ├── overclocking_inside.png │ │ │ │ ├── overclocking_material.png │ │ │ │ └── overclocking_side.png │ │ │ ├── particles │ │ │ ├── laser.png │ │ │ ├── laser_still.png │ │ │ ├── round.png │ │ │ └── round.png.mcmeta │ │ │ └── spell │ │ │ └── trick_accelerate.png │ │ ├── mcmod.info │ │ └── pack.mcmeta └── test │ └── resources │ ├── ActiveMachineRecipe_Default.asm │ ├── ActiveMachineRecipe_InjectIsReset.asm │ └── ActiveMachineRecipe_InjectOnFailure.asm └── version.properties /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Gradle 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle 3 | 4 | name: Build 5 | 6 | on: 7 | push: 8 | tags: 9 | - "v*" 10 | workflow_dispatch: 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Set up JDK 1.8 20 | uses: actions/setup-java@v1 21 | with: 22 | java-version: 1.8 23 | - name: Grant execute permission for gradlew 24 | run: chmod +x gradlew 25 | - name: SetupCiWorkspace 26 | run: ./gradlew setupCiWorkspace 27 | - name: Build with Gradle 28 | run: ./gradlew build 29 | - uses: "marvinpinto/action-automatic-releases@latest" 30 | with: 31 | repo_token: "${{ secrets.GITHUB_TOKEN }}" 32 | prerelease: false 33 | files: | 34 | build/libs/*.jar 35 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | bin 3 | *.launch 4 | .settings 5 | .metadata 6 | .classpath 7 | .project 8 | 9 | # idea 10 | out 11 | *.ipr 12 | *.iws 13 | *.iml 14 | .idea 15 | 16 | # gradle 17 | build 18 | .gradle 19 | 20 | # other 21 | eclipse 22 | run 23 | 24 | 25 | lib/ 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 派瑞派对 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gugu-utils 2 | 3 | ### 简介 4 | 5 | 这原本是为了 鸽子之家 这个整合包制作的专属mod 6 | 7 | 但是在开发过程中脑洞越来越大索性打算最终独立出来 8 | 9 | 模组WIP中,咕~ 10 | 11 | [发布地址](https://github.com/ParaParty/gugu-utils/releases) 12 | 13 | ### 现有功能 14 | 15 | 1. ##### 模块化机械附属部分 16 | 1. 魔力输入输出仓:兼容火花、法杖HUD 17 | 2. 星辉输入仓:支持指定星能星能来源,有gui 18 | 3. 余烬输入仓:支持余烬1.14版本更新添加的ember管道 19 | 4. 环境检测器:支持维度,群系,时间,月相,海拔和天气的检测 20 | 5. 能量输出端口:主要修复原版能源仓tps占用过高问题 21 | 6. 灵气输入仓:支持自然灵气的输入 22 | 7. 神秘输入仓:支持神秘输入 23 | 8. 压缩空气输入口:支持压缩空气输入 24 | 2. ##### Botania附属部分 25 | 1. 添加了一个透镜:超频透镜 26 | 2. 提高了部分产能花的产量 27 | 3. 火红莲等花现在在大量放置时候效率会降低,热爆花已经不接受bug复制的tnt 28 | 4. 添加一个新的透镜:转换,可以用于添加更多合成方式 29 | 3. ##### 魔改部分 30 | 1. ~~添加魔改小帮手(WIP)~~ 放弃( 31 | 32 | 4. ##### 其他修改 33 | 1. 添加了一个PSI术士:加速(PSI版本快乐棒) 34 | 35 | 36 | ### 注意事项 37 | ~~因为模块化机械的相关bug,本模组无法兼容curse forge上下载的版本, 38 | 请自行前往 Modular Machenary 的 [Jenkins](https://jenkins.hellfiredev.net/job/ModularMachinery/job/master/) 获取最新版本的模块化机械,否则该部分附属将不会被加载~~ 39 | 40 | **0.7.4版本以上已经不需要了** 41 | 42 | 模组开发中,正如名字咕咕咕~ 43 | 44 | ### 截图 45 | 46 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/1.png) 47 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/2.png) 48 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/3.png) 49 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/4.png) 50 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/5.png) 51 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/6.png) 52 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/7.png) 53 | ![Image](https://github.com/ParaParty/gugu-utils/raw/dev/screenshots/8.png) 54 | 55 | ### 编译 56 | Forge Gradle 2.3版本(FG3莫名原因不支持JEIx) 57 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | mod_version=0.8.4 5 | mc_version=1.12.2 6 | mc_short=1.12 7 | forge_version=14.23.5.2847 8 | #mcp_mappings=snapshot_20171003 9 | mcp_mappings=stable_39 10 | mod_core_plugin=com.warmthdawn.mod.gugu_utils.asm.GuGuUtilsCore 11 | jei_version=4.16.1.302 12 | mcjtylib_version=3.5.4 13 | modularmachinery_version=1.11.1-v52 14 | botania_version=r1.10-364.1 15 | psi_version=r1.1-78.77 16 | arl_version=1.3-27.13 17 | crafttweaker_version=4.1.20.554 18 | mtlib_version=3.0.4.8 19 | baubles_version=1.5.2 20 | embers_version=300777:3010691 21 | astralsorcery_version=1.10.25-v167 22 | ae2_version=rv6-stable-7 23 | ccl_version=3.2.2.353 24 | cofhcore_version=4.6.0.+ 25 | cofhworld_version=1.3.0.6 26 | redstoneflux_version=2.1.0.+ 27 | thermalfoundation_version=2.6.0.+ 28 | thermaldynamics_version=2.5.5.+ 29 | actuallyadditions_version=r152.+ 30 | naturesaura_version=r14-209 31 | patchouli_version=1.0-19.96 32 | bloodmagic_version=2.4.3-105 33 | bloodmagic_version_curse=224791:2822288 34 | guideapi_version=228832:2645992 35 | thaumcraft_version=223628:2629023 36 | pneumaticcraft_repressurized_version=1.12.2-0.11.9-384 37 | #computercraft_version=67504:2478952 38 | computercraft_version=282001:2694855 39 | mekanism_version=268560:2835175 40 | theoneprobe_version=1.12-1.4.28-17 41 | prodigytech_version=297414:2769520 42 | bwm_suite=246760:3289033 43 | bwm_core=294335:2624990 44 | immersive_engineering=231951:2974106 45 | immersive_petroleum=268250:3382321 46 | extra_utilities=225561:2678374 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/1.png -------------------------------------------------------------------------------- /screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/2.png -------------------------------------------------------------------------------- /screenshots/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/3.png -------------------------------------------------------------------------------- /screenshots/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/4.png -------------------------------------------------------------------------------- /screenshots/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/5.png -------------------------------------------------------------------------------- /screenshots/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/6.png -------------------------------------------------------------------------------- /screenshots/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/7.png -------------------------------------------------------------------------------- /screenshots/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/screenshots/8.png -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/asm/GuGuUtilsCore.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.asm; 2 | 3 | import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; 4 | import org.apache.logging.log4j.LogManager; 5 | import org.apache.logging.log4j.Logger; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | import java.util.Map; 9 | 10 | @IFMLLoadingPlugin.MCVersion("1.12.2") 11 | @IFMLLoadingPlugin.Name("gugu-utils-core") 12 | @IFMLLoadingPlugin.TransformerExclusions({"com.warmthdawn.mod.gugu_utils.asm"}) 13 | public class GuGuUtilsCore implements IFMLLoadingPlugin { 14 | 15 | public static final Logger logger = LogManager.getLogger("GuGu Utils Core"); 16 | @Override 17 | public String[] getASMTransformerClass() { 18 | return new String[] { 19 | "com.warmthdawn.mod.gugu_utils.asm.common.GuGuAsmTransformer" 20 | }; 21 | } 22 | 23 | @Override 24 | public String getModContainerClass() { 25 | return null; 26 | } 27 | 28 | @Nullable 29 | @Override 30 | public String getSetupClass() { 31 | return null; 32 | } 33 | 34 | @Override 35 | public void injectData(Map data) { 36 | 37 | } 38 | 39 | @Override 40 | public String getAccessTransformerClass() { 41 | return null; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/asm/common/GuGuAsmTransformer.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.asm.common; 2 | 3 | 4 | import com.warmthdawn.mod.gugu_utils.asm.GuGuUtilsCore; 5 | import com.warmthdawn.mod.gugu_utils.asm.transformers.ActiveMachineRecipeTransformer; 6 | import com.warmthdawn.mod.gugu_utils.asm.transformers.DynamicMachineDeserializerTransformer; 7 | import com.warmthdawn.mod.gugu_utils.asm.transformers.TileMachineControllerTransformer; 8 | import com.warmthdawn.mod.gugu_utils.asm.utils.SafeClassWriter; 9 | import net.minecraft.launchwrapper.IClassTransformer; 10 | import org.apache.logging.log4j.LogManager; 11 | import org.apache.logging.log4j.Logger; 12 | import org.objectweb.asm.ClassReader; 13 | import org.objectweb.asm.ClassWriter; 14 | import org.objectweb.asm.tree.ClassNode; 15 | 16 | import java.util.HashMap; 17 | import java.util.Map; 18 | 19 | public class GuGuAsmTransformer implements IClassTransformer { 20 | private static final Map tweakedClasses = new HashMap<>(); 21 | 22 | static { 23 | tweakedClasses.put("hellfirepvp.modularmachinery.common.tiles.TileMachineController", new TileMachineControllerTransformer()); 24 | tweakedClasses.put("hellfirepvp.modularmachinery.common.crafting.ActiveMachineRecipe", new ActiveMachineRecipeTransformer()); 25 | tweakedClasses.put("hellfirepvp.modularmachinery.common.machine.DynamicMachine$MachineDeserializer", new DynamicMachineDeserializerTransformer()); 26 | } 27 | 28 | 29 | 30 | @Override 31 | public byte[] transform(String name, String transformedName, byte[] basicClass) { 32 | if (!tweakedClasses.containsKey(transformedName)) { 33 | return basicClass; 34 | } 35 | 36 | GuGuUtilsCore.logger.info("Transforming: " + transformedName); 37 | try { 38 | ClassNode classNode = new ClassNode(); 39 | ClassReader classReader = new ClassReader(basicClass); 40 | classReader.accept(classNode, 0); 41 | 42 | tweakedClasses.getOrDefault(transformedName, MyTransformer.EMPTY_TRANSFORMER).transform(classNode); 43 | 44 | ClassWriter classWriter = new SafeClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES); 45 | classNode.accept(classWriter); 46 | return classWriter.toByteArray(); 47 | } catch (Exception e) { 48 | e.printStackTrace(); 49 | } 50 | return basicClass; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/asm/common/MyTransformer.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.asm.common; 2 | 3 | import org.objectweb.asm.tree.ClassNode; 4 | 5 | public interface MyTransformer { 6 | void transform(ClassNode classNode); 7 | 8 | MyTransformer EMPTY_TRANSFORMER = new MyTransformer() { 9 | @Override 10 | public void transform(ClassNode classNode) { 11 | 12 | } 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/asm/transformers/DynamicMachineDeserializerTransformer.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.asm.transformers; 2 | 3 | import com.warmthdawn.mod.gugu_utils.asm.common.MyTransformer; 4 | import com.warmthdawn.mod.gugu_utils.asm.utils.AsmUtils; 5 | import org.objectweb.asm.Opcodes; 6 | import org.objectweb.asm.tree.*; 7 | 8 | import java.util.Optional; 9 | 10 | public class DynamicMachineDeserializerTransformer implements MyTransformer { 11 | @Override 12 | public void transform(ClassNode classNode) { 13 | Optional deserialize = AsmUtils.findMethod(classNode, "deserialize", null); 14 | if (!deserialize.isPresent()) 15 | return; 16 | InsnList instructions = deserialize.get().instructions; 17 | InsnList hook = new InsnList(); 18 | hook.add(new VarInsnNode(Opcodes.ALOAD, 1)); 19 | MethodInsnNode call = new MethodInsnNode(Opcodes.INVOKESTATIC, 20 | "com/warmthdawn/mod/gugu_utils/asm/mixin/MixinModularMachinery", 21 | "inject_machineRecipe_deserialize", "(Lcom/google/gson/JsonElement;)V", false); 22 | hook.add(call); 23 | instructions.insert(hook); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/asm/transformers/TileMachineControllerTransformer.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.asm.transformers; 2 | 3 | import com.warmthdawn.mod.gugu_utils.asm.common.MyTransformer; 4 | import com.warmthdawn.mod.gugu_utils.asm.utils.AsmUtils; 5 | import org.objectweb.asm.Opcodes; 6 | import org.objectweb.asm.tree.*; 7 | 8 | import java.util.ListIterator; 9 | import java.util.Optional; 10 | 11 | public class TileMachineControllerTransformer implements MyTransformer { 12 | @Override 13 | public void transform(ClassNode classNode) { 14 | Optional tryColorize = AsmUtils.findMethod(classNode, "tryColorize", null); 15 | if (!tryColorize.isPresent()) 16 | return; 17 | 18 | InsnList ins = tryColorize.get().instructions; 19 | ListIterator inserator = ins.iterator(); 20 | while (inserator.hasNext()) { 21 | AbstractInsnNode in = inserator.next(); 22 | 23 | if (!AsmUtils.matchMethodInsn(in, Opcodes.INVOKEVIRTUAL, "getTileEntity", "func_175625_s", null, null, null)) { 24 | continue; 25 | } 26 | InsnList hook = new InsnList(); 27 | hook.add(new VarInsnNode(Opcodes.ALOAD, 0)); 28 | hook.add(new VarInsnNode(Opcodes.ALOAD, 1)); 29 | hook.add(new VarInsnNode(Opcodes.ILOAD, 2)); 30 | hook.add(new VarInsnNode(Opcodes.ALOAD, 3)); 31 | MethodInsnNode call = new MethodInsnNode(Opcodes.INVOKESTATIC, 32 | "com/warmthdawn/mod/gugu_utils/asm/mixin/MixinModularMachinery", 33 | "inject_tryColorize", 34 | "(Lnet/minecraft/tileentity/TileEntity;Lnet/minecraft/util/math/BlockPos;ILnet/minecraft/tileentity/TileEntity;)V", false); 35 | hook.add(call); 36 | 37 | ins.insert(in.getNext(), hook); 38 | return; 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/asm/utils/SafeClassWriter.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.asm.utils; 2 | 3 | import net.minecraft.launchwrapper.Launch; 4 | import org.objectweb.asm.ClassReader; 5 | import org.objectweb.asm.ClassWriter; 6 | 7 | /** 8 | * Created by Thiakil on 16/11/2017. 9 | */ 10 | public class SafeClassWriter extends ClassWriter { 11 | public SafeClassWriter(int flags) { 12 | super(flags); 13 | } 14 | 15 | public SafeClassWriter(ClassReader classReader, int flags) { 16 | super(classReader, flags); 17 | } 18 | 19 | protected String getCommonSuperClass(final String type1, final String type2) { 20 | Class c, d; 21 | ClassLoader classLoader = Launch.classLoader; 22 | try { 23 | c = Class.forName(type1.replace('/', '.'), false, classLoader); 24 | d = Class.forName(type2.replace('/', '.'), false, classLoader); 25 | } catch (Exception e) { 26 | throw new RuntimeException(e.toString()); 27 | } 28 | if (c.isAssignableFrom(d)) { 29 | return type1; 30 | } 31 | if (d.isAssignableFrom(c)) { 32 | return type2; 33 | } 34 | if (c.isInterface() || d.isInterface()) { 35 | return "java/lang/Object"; 36 | } else { 37 | do { 38 | c = c.getSuperclass(); 39 | } while (!c.isAssignableFrom(d)); 40 | return c.getName().replace('.', '/'); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/botania/BotaniaCompact.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.botania; 2 | 3 | import com.warmthdawn.mod.gugu_utils.botania.recipes.TransformRecipe; 4 | import com.warmthdawn.mod.gugu_utils.crafttweaker.gugu.ITransformEvent; 5 | import com.warmthdawn.mod.gugu_utils.crafttweaker.gugu.ITransformFunction; 6 | import crafttweaker.api.item.IIngredient; 7 | import crafttweaker.api.item.IItemStack; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | public class BotaniaCompact { 13 | public static final List recipeBurstTransform = new ArrayList<>(); 14 | 15 | public static TransformRecipe registerBurstTransformRecipe(IItemStack output, int mana, IIngredient input) { 16 | TransformRecipe recipe = new TransformRecipe(output, mana, input, null, null); 17 | recipeBurstTransform.add(recipe); 18 | return recipe; 19 | } 20 | public static TransformRecipe registerBurstTransformRecipe(IItemStack output, int mana, IIngredient input, ITransformFunction function) { 21 | TransformRecipe recipe = new TransformRecipe(output, mana, input, function, null); 22 | recipeBurstTransform.add(recipe); 23 | return recipe; 24 | } 25 | public static TransformRecipe registerBurstTransformRecipe(IItemStack output, int mana, IIngredient input, ITransformFunction function, ITransformEvent recipeEvent) { 26 | TransformRecipe recipe = new TransformRecipe(output, mana, input, function, recipeEvent); 27 | recipeBurstTransform.add(recipe); 28 | return recipe; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/botania/lens/ItemLensOverclocking.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This class was created by . It's distributed as 3 | * part of the Botania Mod. Get the Source Code in github: 4 | * https://github.com/Vazkii/Botania 5 | *

6 | * Botania is Open Source and distributed under the 7 | * Botania License: http://botaniamod.net/license.php 8 | *

9 | * File Created @ [Jan 31, 2014, 3:02:58 PM (GMT)] 10 | */ 11 | package com.warmthdawn.mod.gugu_utils.botania.lens; 12 | 13 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 14 | import vazkii.botania.common.item.lens.Lens; 15 | 16 | import static com.warmthdawn.mod.gugu_utils.common.Constants.NAME_LENS_OVERCLOCKING; 17 | import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; 18 | 19 | public class ItemLensOverclocking extends ItemLensAddition { 20 | public static final Lens LENS = new LensOverclocking(); 21 | 22 | public ItemLensOverclocking() { 23 | super(); 24 | setCreativeTab(GuGuUtils.creativeTab); 25 | setTranslationKey(j(GuGuUtils.MODID, NAME_LENS_OVERCLOCKING)); 26 | } 27 | 28 | @Override 29 | public Lens getLens() { 30 | return LENS; 31 | } 32 | 33 | 34 | } -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/botania/lens/ItemLensTransform.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.botania.lens; 2 | 3 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 4 | import vazkii.botania.common.item.lens.Lens; 5 | 6 | import static com.warmthdawn.mod.gugu_utils.common.Constants.NAME_LENS_TRANSFORM; 7 | import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; 8 | 9 | public class ItemLensTransform extends ItemLensAddition { 10 | public static final Lens LENS = new LensTransform(); 11 | 12 | public ItemLensTransform() { 13 | super(); 14 | setCreativeTab(GuGuUtils.creativeTab); 15 | setTranslationKey(j(GuGuUtils.MODID, NAME_LENS_TRANSFORM)); 16 | } 17 | 18 | @Override 19 | public Lens getLens() { 20 | return LENS; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/botania/lens/LensOverclocking.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.botania.lens; 2 | 3 | import net.minecraft.entity.projectile.EntityThrowable; 4 | import net.minecraft.item.ItemStack; 5 | import vazkii.botania.api.internal.IManaBurst; 6 | import vazkii.botania.api.mana.BurstProperties; 7 | import vazkii.botania.api.mana.IManaReceiver; 8 | import vazkii.botania.common.item.lens.Lens; 9 | 10 | public class LensOverclocking extends Lens { 11 | public static final int SPREAD_LOSS_PER_TICK = 50; 12 | 13 | @Override 14 | public void apply(ItemStack stack, BurstProperties props) { 15 | super.apply(stack, props); 16 | switch (props.maxMana) { 17 | case 640: 18 | props.maxMana = 6400; 19 | break; 20 | case 240: 21 | case 160: 22 | props.maxMana = 1000; 23 | break; 24 | } 25 | 26 | props.motionModifier *= 2F; 27 | props.ticksBeforeManaLoss = 5; 28 | props.manaLossPerTick *= 10F; 29 | } 30 | 31 | @Override 32 | public int getManaToTransfer(IManaBurst burst, EntityThrowable entity, ItemStack stack, IManaReceiver receiver) { 33 | return (int) (burst.getMana() * 0.75); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/botania/recipes/TransformRecipe.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.botania.recipes; 2 | 3 | import com.warmthdawn.mod.gugu_utils.crafttweaker.gugu.ITransformEvent; 4 | import com.warmthdawn.mod.gugu_utils.crafttweaker.gugu.ITransformFunction; 5 | import crafttweaker.api.item.IIngredient; 6 | import crafttweaker.api.item.IItemStack; 7 | import crafttweaker.api.minecraft.CraftTweakerMC; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.item.crafting.Ingredient; 10 | 11 | public class TransformRecipe { 12 | private final IItemStack output; 13 | private final IIngredient input; 14 | private final int inputNum; 15 | private final ITransformFunction function; 16 | private final ITransformEvent recipeEvent; 17 | 18 | 19 | private final int mana; 20 | 21 | public TransformRecipe(IItemStack output, int mana, IIngredient input, ITransformFunction function, ITransformEvent recipeEvent) { 22 | this.output = output; 23 | this.input = input; 24 | this.mana = mana; 25 | this.inputNum = input.getAmount(); 26 | this.function = function; 27 | this.recipeEvent = recipeEvent; 28 | } 29 | 30 | public boolean matches(ItemStack item) { 31 | return input.matches(CraftTweakerMC.getIItemStack(item)) && item.getCount() >= getInputNum(); 32 | } 33 | 34 | public int getInputNum() { 35 | return inputNum; 36 | } 37 | 38 | public ITransformFunction getFunction() { 39 | return function; 40 | } 41 | 42 | public ITransformEvent getEvent() { 43 | return recipeEvent; 44 | } 45 | 46 | public Ingredient getInput() { 47 | return CraftTweakerMC.getIngredient(input); 48 | } 49 | 50 | 51 | public ItemStack getOutputStack() { 52 | return CraftTweakerMC.getItemStack(output); 53 | } 54 | public IItemStack getOutput() { 55 | return output; 56 | } 57 | 58 | public int getMana() { 59 | return mana; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/botania/subtitle/SubTileShulkMeNotModified.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.botania.subtitle; 2 | 3 | import com.warmthdawn.mod.gugu_utils.config.GuGuUtilsConfig; 4 | import vazkii.botania.common.block.subtile.generating.SubTileShulkMeNot; 5 | 6 | public class SubTileShulkMeNotModified extends SubTileShulkMeNot { 7 | 8 | private final int MAX_MANA; 9 | 10 | public SubTileShulkMeNotModified() { 11 | MAX_MANA = (int) (super.getMaxMana() * GuGuUtilsConfig.Tweaks.SHULKMENOT_GENERATIONG_MULTIPLE); 12 | } 13 | 14 | @Override 15 | public int getMaxMana() { 16 | return MAX_MANA; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/client/ParticleTypes.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.client; 2 | 3 | public enum ParticleTypes { 4 | ENERGY_BALL 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/command/GuGuCraftCommand.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.command; 2 | 3 | import com.warmthdawn.mod.gugu_utils.gui.GuiEvent; 4 | import com.warmthdawn.mod.gugu_utils.gui.ModIndependentGuis; 5 | import net.minecraft.command.CommandBase; 6 | import net.minecraft.command.CommandException; 7 | import net.minecraft.command.ICommandSender; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.server.MinecraftServer; 10 | import net.minecraftforge.common.MinecraftForge; 11 | 12 | public class GuGuCraftCommand extends CommandBase { 13 | @Override 14 | public String getName() { 15 | return "gugu_craft"; 16 | } 17 | 18 | @Override 19 | public String getUsage(ICommandSender sender) { 20 | return "gugu_craft "; 21 | } 22 | 23 | @Override 24 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { 25 | EntityPlayer player = (EntityPlayer) sender; 26 | MinecraftForge.EVENT_BUS.post(new GuiEvent(player, player.world, ModIndependentGuis.guGuCraftingTableGui)); 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/common/IGuiProvider.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.common; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.inventory.Container; 6 | import net.minecraftforge.fml.relauncher.Side; 7 | import net.minecraftforge.fml.relauncher.SideOnly; 8 | 9 | 10 | public interface IGuiProvider { 11 | Container createContainer(EntityPlayer player); 12 | 13 | @SideOnly(Side.CLIENT) 14 | GuiScreen createGui(EntityPlayer player); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/common/IRestorableTileEntity.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.common; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | 5 | public interface IRestorableTileEntity { 6 | void readRestorableFromNBT(NBTTagCompound tagCompound); 7 | NBTTagCompound writeRestorableToNBT(NBTTagCompound compound); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/common/VariantItem.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.common; 2 | 3 | import net.minecraft.block.properties.PropertyEnum; 4 | import net.minecraft.item.ItemBlock; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraft.util.IStringSerializable; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class VariantItem & IStringSerializable> extends ItemBlock { 10 | public final PropertyEnum VARIANT; 11 | public final Class variantType; 12 | public VariantItem(VariantBlock block) { 13 | super(block); 14 | this.setMaxDamage(0); 15 | this.setHasSubtypes(true); 16 | this.VARIANT = block.getVariant(); 17 | this.variantType = block.variantType; 18 | } 19 | 20 | 21 | @Override 22 | public int getMetadata(int meta) { 23 | return meta; 24 | } 25 | 26 | @Override 27 | @NotNull 28 | public String getTranslationKey(ItemStack stack) { 29 | int meta = stack.getMetadata() < variantType.getEnumConstants().length ? stack.getMetadata() : 0; 30 | return super.getTranslationKey(stack) + "." + variantType.getEnumConstants()[meta].getName(); 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/common/slot/DisplayFluidSlot.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.common.slot; 2 | 3 | import com.warmthdawn.mod.gugu_utils.gui.FluidInventory; 4 | import net.minecraft.item.ItemStack; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class DisplayFluidSlot extends GhostFluidSlot { 8 | public DisplayFluidSlot(FluidInventory inventory, int inventoryIndex, int x, int y) { 9 | super(inventory, inventoryIndex, x, y, true); 10 | } 11 | @Override 12 | public boolean isItemValid(@NotNull ItemStack stack) { 13 | return false; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/common/slot/GenericSlot.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.common.slot; 2 | 3 | import net.minecraftforge.items.IItemHandler; 4 | import net.minecraftforge.items.SlotItemHandler; 5 | 6 | import java.util.function.Supplier; 7 | 8 | public class GenericSlot extends SlotItemHandler { 9 | public static final int FLAG_INPUT = 1; 10 | private Supplier enableHandler = () -> true; 11 | private int flags; 12 | public GenericSlot(IItemHandler itemHandler, int index, int xPosition, int yPosition) { 13 | super(itemHandler, index, xPosition, yPosition); 14 | } 15 | 16 | public GenericSlot setEnableHandler(Supplier enableHandler) { 17 | this.enableHandler = enableHandler; 18 | 19 | return this; 20 | } 21 | 22 | @Override 23 | public boolean isEnabled() { 24 | return enableHandler.get(); 25 | } 26 | 27 | public GenericSlot setFlags(int flags) { 28 | this.flags = flags; 29 | return this; 30 | } 31 | 32 | public boolean hasFlag(int flags) { 33 | return (this.flags & flags) == flags; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/common/slot/GhostFluidSlot.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.common.slot; 2 | 3 | import com.warmthdawn.mod.gugu_utils.gui.FluidInventory; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraftforge.fluids.FluidStack; 7 | import net.minecraftforge.items.ItemStackHandler; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | import javax.annotation.Nonnull; 11 | 12 | public class GhostFluidSlot extends GenericSlot { 13 | 14 | private final FluidInventory fluidInventory; 15 | private boolean isSizeAllowed = false; 16 | 17 | public GhostFluidSlot(FluidInventory inventory, int inventoryIndex, int x, int y, boolean isSizeAllowed) { 18 | super(new ItemStackHandler(inventory.getSlots()), inventoryIndex, x, y); 19 | this.isSizeAllowed = isSizeAllowed; 20 | this.fluidInventory = inventory; 21 | } 22 | 23 | public GhostFluidSlot(FluidInventory inventory, int inventoryIndex, int x, int y) { 24 | this(inventory, inventoryIndex, x, y, false); 25 | } 26 | 27 | @Override 28 | public boolean isItemValid(@Nonnull ItemStack stack) { 29 | return false; 30 | } 31 | 32 | 33 | @NotNull 34 | @Override 35 | public ItemStack getStack() { 36 | return ItemStack.EMPTY; 37 | } 38 | 39 | @Override 40 | public void putStack(@NotNull ItemStack stack) { 41 | fluidInventory.setFluidFromItem(getSlotIndex(), stack); 42 | } 43 | 44 | @Override 45 | public boolean canTakeStack(EntityPlayer playerIn) { 46 | return false; 47 | } 48 | 49 | public boolean isSizeAllowed() { 50 | return isSizeAllowed; 51 | } 52 | 53 | public FluidInventory getFluidInventory() { 54 | return fluidInventory; 55 | } 56 | 57 | public FluidStack getFluidStack() { 58 | return this.fluidInventory.getFluid(this.getSlotIndex()); 59 | } 60 | 61 | public void onContainerClicked(ItemStack itemStack) { 62 | fluidInventory.setFluidFromItem(getSlotIndex(), itemStack); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/common/slot/GhostItemSlot.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.common.slot; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraftforge.items.IItemHandler; 6 | 7 | import javax.annotation.Nonnull; 8 | 9 | public class GhostItemSlot extends GenericSlot { 10 | 11 | private boolean isSizeAllowed = false; 12 | 13 | public GhostItemSlot(IItemHandler handler, int inventoryIndex, int x, int y, boolean isSizeAllowed) { 14 | super(handler, inventoryIndex, x, y); 15 | 16 | this.isSizeAllowed = isSizeAllowed; 17 | } 18 | 19 | public GhostItemSlot(IItemHandler handler, int inventoryIndex, int x, int y) { 20 | this(handler, inventoryIndex, x, y, false); 21 | } 22 | @Override 23 | public boolean canTakeStack(EntityPlayer playerIn) { 24 | return false; 25 | } 26 | 27 | @Override 28 | public void putStack(@Nonnull ItemStack stack) { 29 | if (!stack.isEmpty() && !isSizeAllowed()) { 30 | stack.setCount(1); 31 | } 32 | 33 | super.putStack(stack); 34 | } 35 | 36 | public boolean isSizeAllowed() { 37 | return isSizeAllowed; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/compat/PneumaticCraftCompat.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.compat; 2 | 3 | import com.warmthdawn.mod.gugu_utils.modularmachenary.pressure.IUpgradeAcceptorWrapper; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.pressure.TilePressureInputHatch; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.pressure.TilePressureOutputHatch; 6 | import me.desht.pneumaticcraft.api.PneumaticRegistry; 7 | 8 | public class PneumaticCraftCompat { 9 | public static void postInit() { 10 | PneumaticRegistry.getInstance().getItemRegistry().registerUpgradeAcceptor(new IUpgradeAcceptorWrapper(new TilePressureInputHatch())); 11 | PneumaticRegistry.getInstance().getItemRegistry().registerUpgradeAcceptor(new IUpgradeAcceptorWrapper(new TilePressureOutputHatch())); 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/config/CoreConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.warmthdawn.mod.gugu_utils.config; 3 | 4 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 5 | import net.minecraftforge.common.config.Config; 6 | 7 | @Config(modid = GuGuUtils.MODID, name = "Core") 8 | 9 | public class CoreConfig { 10 | @Config.Comment("Actions when a recipe failure whit per tick input, can be 'reset', 'still' and 'decrease'.") 11 | public static String DEFAULT_RECIPE_FAILURE_ACTION = "reset"; 12 | } 13 | 14 | */ 15 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/config/HatchesConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.warmthdawn.mod.gugu_utils.config; 3 | 4 | 5 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 6 | import net.minecraftforge.common.config.Config; 7 | 8 | @Config(modid = GuGuUtils.MODID, name = "Hatches") 9 | public class HatchesConfig { 10 | 11 | @Config.Comment("Max aspect in aspect output hatch") 12 | @Config.RangeInt(min = 1) 13 | public static int ASPECT_OUTPUT_HATCH_MAX_STORAGE = 500; 14 | 15 | @Config.Comment("Actions when a aspect output hatch are full, can be 'spill_random', 'spill_all' and 'halt'.") 16 | @Config.RequiresMcRestart 17 | public static String ASPECT_OUTPUT_HATCH_FULL_ACTION = "spill_random"; 18 | 19 | } 20 | 21 | */ 22 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/config/PluginsConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.warmthdawn.mod.gugu_utils.config; 3 | 4 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 5 | import net.minecraftforge.common.config.Config; 6 | 7 | @Config(modid = GuGuUtils.MODID, name = "Plugins") 8 | 9 | public class PluginsConfig { 10 | 11 | @Config.Comment("NOTE: If false, this will disable all the features related to Thaumcraft!") 12 | @Config.RequiresMcRestart 13 | public static boolean ENABLE_THAUMCRAFT_SUPPORT = true; 14 | 15 | @Config.Comment("NOTE: If false, this will disable all the features related to Blood Magic!") 16 | @Config.RequiresMcRestart 17 | public static boolean ENABLE_BLOOD_MAGIC_SUPPORT = true; 18 | 19 | @Config.Comment("NOTE: If false, this will disable all the features related to Nature's Aura!") 20 | @Config.RequiresMcRestart 21 | public static boolean ENABLE_NATURES_AURA_SUPPORT = true; 22 | 23 | @Config.Comment("Note: If false, This will disable all the features related to Botania!") 24 | @Config.RequiresMcRestart 25 | public static boolean ENABLE_BOTANIA_SUPPORT = true; 26 | 27 | @Config.Comment("Note: If false, This will disable all the features related to Astral Sorcery!") 28 | @Config.RequiresMcRestart 29 | public static boolean ENABLE_ASTRAL_SORCERY_SUPPORT = true; 30 | 31 | @Config.Comment("Note: If false, This will disable all the features related to Embers!") 32 | @Config.RequiresMcRestart 33 | public static boolean ENABLE_EMBERS_SUPPORT = true; 34 | 35 | @Config.Comment("Note: If false, This will disable all the features related to Modular Machinery!") 36 | @Config.RequiresMcRestart 37 | public static boolean ENABLE_MODULAR_MACHIENARY_SUPPORT = true; 38 | 39 | @Config.Comment("Note: If false, This will disable all the features related to Psi!") 40 | @Config.RequiresMcRestart 41 | public static boolean ENABLE_PSI_SUPPORT = true; 42 | 43 | @Config.Comment("Note: If false, This will disable all the features related to PneumaticCraft: Repressurized!") 44 | @Config.RequiresMcRestart 45 | public static boolean ENABLE_PNEUMATICCRAFT_SUPPORT = true; 46 | 47 | @Config.Comment("Note: If false, This will disable all the features related to Prodigy Tech!") 48 | @Config.RequiresMcRestart 49 | public static boolean ENABLE_PRODIGYTECH_SUPPORT = true; 50 | 51 | // @Config.Comment("Note: If false, This will disable all the features related to Mekanism!") 52 | // @Config.RequiresMcRestart 53 | // public static boolean ENABLE_MEKANISM_SUPPORT = true; 54 | 55 | } 56 | 57 | 58 | */ -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/config/TweaksConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.warmthdawn.mod.gugu_utils.config; 3 | 4 | 5 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 6 | import net.minecraftforge.common.config.Config; 7 | 8 | @Config(modid = GuGuUtils.MODID, name = "Tweaks") 9 | public class TweaksConfig { 10 | 11 | @Config.Comment("Enable psi accelate trick") 12 | public static boolean ENABLE_ACCELATE_TRICK = true; 13 | @Config.Comment("Set to false to disable all generate flower tweaks") 14 | public static boolean TWEAKS_GENERATORS = true; 15 | @Config.Comment("Set to false to disable gaia player number tweaks") 16 | public static boolean TWEAKS_GAIA = true; 17 | @Config.Comment("Set to false to disable all lens added") 18 | public static boolean TWEAKE_LENS = true; 19 | 20 | public static boolean ENABLE_LENS_OVERCLOCKING = true; 21 | public static boolean ENABLE_LENS_TRASNFORM = true; 22 | 23 | 24 | @Config.Comment("Enable endoflame efficiency reduce") 25 | public static boolean TWEAK_ENDOFLAME_EFFICIENCY = true; 26 | @Config.Comment("Max flowers that endoflame's efficiency begin to reduce") 27 | public static int ENDOFLAME_MAX_FLOWERS = 5; 28 | 29 | @Config.Comment("Enable arcanerose efficiency reduce") 30 | public static boolean TWEAK_ARCANEROSE_EFFICIENCY = true; 31 | @Config.Comment("Max flowers that arcanerose's efficiency begin to reduce") 32 | public static int ARCANEROSE_MAX_FLOWERS = 4; 33 | 34 | @Config.Comment("Enable entropinnyum refuse to accept copied tnt") 35 | public static boolean ENTROPINNYUM_NOT_ACCEPT_COPY_TNT = true; 36 | public static int ENTROPINNYUM_GENERATING = 8000; 37 | 38 | public static double DANDELIFEON_GENERATING_MULTIPLE = 4; 39 | public static double RAFFLOWSIA_GENERATIONG_MULTIPLE = 2; 40 | public static double SHULKMENOT_GENERATIONG_MULTIPLE = 1.25; 41 | public static double SPECTROLUS_GENERATIONG_MULTIPLE = 2; 42 | 43 | @Config.Comment("Configure the maximum transmission distance of the energy outlet") 44 | @Config.RangeInt(min = 1,max = 256) 45 | public static int Energy_Outlet_Transmission = 3; 46 | 47 | 48 | } 49 | 50 | 51 | */ -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/crafttweaker/CraftTweakerCompact.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.crafttweaker; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.Enables; 4 | import com.warmthdawn.mod.gugu_utils.crafttweaker.modularmachenary.RecipePrimerExt; 5 | import crafttweaker.CraftTweakerAPI; 6 | import crafttweaker.IAction; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | public class CraftTweakerCompact { 12 | public static final List LATE_ADDITIONS = new ArrayList<>(); 13 | public static final List LATE_REMOVALS = new ArrayList<>(); 14 | 15 | public static void preInit() { 16 | if(Enables.MODULAR_MACHIENARY) 17 | CraftTweakerAPI.registerClass(RecipePrimerExt.class); 18 | 19 | } 20 | 21 | public static void postInit() { 22 | LATE_REMOVALS.forEach(CraftTweakerAPI::apply); 23 | LATE_ADDITIONS.forEach(CraftTweakerAPI::apply); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/crafttweaker/gugu/BurstTransform.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.crafttweaker.gugu; 2 | 3 | import com.warmthdawn.mod.gugu_utils.botania.BotaniaCompact; 4 | import crafttweaker.annotations.ZenRegister; 5 | import crafttweaker.api.item.IIngredient; 6 | import crafttweaker.api.item.IItemStack; 7 | import crafttweaker.api.minecraft.CraftTweakerMC; 8 | import net.minecraftforge.fml.common.Optional; 9 | import stanhebben.zenscript.annotations.ZenClass; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | 12 | @ZenRegister 13 | @ZenClass("mods.guguutils.BurstTransform") 14 | public class BurstTransform { 15 | 16 | @ZenMethod 17 | @Optional.Method(modid = "botania") 18 | public static void addRecipe(IItemStack output, int mana, IIngredient input) { 19 | BotaniaCompact.registerBurstTransformRecipe( 20 | output, 21 | mana, input); 22 | } 23 | 24 | @ZenMethod 25 | @Optional.Method(modid = "botania") 26 | public static void addRecipe(IItemStack output, int mana, IIngredient input, ITransformFunction function) { 27 | BotaniaCompact.registerBurstTransformRecipe( 28 | output, 29 | mana, input, function); 30 | } 31 | 32 | @ZenMethod 33 | @Optional.Method(modid = "botania") 34 | public static void addRecipe(IItemStack output, int mana, IIngredient input, ITransformFunction function, ITransformEvent recipeEvent) { 35 | BotaniaCompact.registerBurstTransformRecipe( 36 | output, 37 | mana, input, function, recipeEvent); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/crafttweaker/gugu/ITransformContext.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.crafttweaker.gugu; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import crafttweaker.api.entity.IEntity; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.world.IBlockPos; 7 | import net.minecraft.item.ItemStack; 8 | import stanhebben.zenscript.annotations.ZenClass; 9 | import stanhebben.zenscript.annotations.ZenGetter; 10 | import stanhebben.zenscript.annotations.ZenMethod; 11 | import stanhebben.zenscript.annotations.ZenSetter; 12 | 13 | 14 | @ZenRegister 15 | @ZenClass("mods.guguutils.ITransformContext") 16 | public interface ITransformContext { 17 | @ZenGetter("manaBurstEntity") 18 | @ZenMethod 19 | IEntity getManaBurstEntity(); 20 | 21 | @ZenGetter("spreaderPos") 22 | @ZenMethod 23 | IBlockPos getSpreaderPos(); 24 | 25 | @ZenGetter("output") 26 | @ZenMethod 27 | IItemStack getOutput(); 28 | 29 | @ZenSetter("output") 30 | @ZenMethod 31 | void setOutput(IItemStack itemStack); 32 | 33 | @ZenGetter("mana") 34 | @ZenMethod 35 | int getMana(); 36 | 37 | @ZenSetter("mana") 38 | @ZenMethod 39 | void setMana(int mana); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/crafttweaker/gugu/ITransformEvent.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.crafttweaker.gugu; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import crafttweaker.api.entity.IEntity; 5 | import crafttweaker.api.item.IItemStack; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | 8 | @ZenRegister 9 | @ZenClass("mods.guguutils.ITransformEvent") 10 | public interface ITransformEvent { 11 | boolean process(IItemStack output, IEntity manaBurstEntity, int craftTimes); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/crafttweaker/gugu/ITransformFunction.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.crafttweaker.gugu; 2 | 3 | import crafttweaker.annotations.ZenRegister; 4 | import crafttweaker.api.entity.IEntityItem; 5 | import crafttweaker.api.item.IItemStack; 6 | import stanhebben.zenscript.annotations.ZenClass; 7 | 8 | @ZenRegister 9 | @ZenClass("mods.guguutils.ITransformFunction") 10 | public interface ITransformFunction { 11 | boolean process(IEntityItem input, ITransformContext context); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/crafttweaker/gugu/TransformContext.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.crafttweaker.gugu; 2 | 3 | import com.warmthdawn.mod.gugu_utils.botania.recipes.TransformRecipe; 4 | import crafttweaker.api.entity.IEntity; 5 | import crafttweaker.api.item.IItemStack; 6 | import crafttweaker.api.minecraft.CraftTweakerMC; 7 | import crafttweaker.api.world.IBlockPos; 8 | import net.minecraft.entity.Entity; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.util.math.BlockPos; 11 | import vazkii.botania.api.internal.IManaBurst; 12 | 13 | public class TransformContext implements ITransformContext { 14 | private int mana; 15 | private IItemStack output; 16 | private IEntity manaBurstEntity; 17 | private IBlockPos spreaderPos; 18 | 19 | public TransformContext(int mana, IItemStack output, IEntity manaBurstEntity, IBlockPos spreaderPos) { 20 | this.mana = mana; 21 | this.output = output; 22 | this.manaBurstEntity = manaBurstEntity; 23 | this.spreaderPos = spreaderPos; 24 | } 25 | 26 | public static TransformContext create(Entity burstEntity, BlockPos spreaderPos, TransformRecipe recipe) { 27 | return new TransformContext( 28 | recipe.getMana(), 29 | recipe.getOutput(), 30 | CraftTweakerMC.getIEntity(burstEntity), 31 | CraftTweakerMC.getIBlockPos(spreaderPos)); 32 | } 33 | 34 | public ItemStack getOutputStack() { 35 | return CraftTweakerMC.getItemStack(output); 36 | } 37 | 38 | @Override 39 | public IEntity getManaBurstEntity() { 40 | return manaBurstEntity; 41 | } 42 | 43 | @Override 44 | public IBlockPos getSpreaderPos() { 45 | return spreaderPos; 46 | } 47 | 48 | @Override 49 | public IItemStack getOutput() { 50 | return output; 51 | } 52 | 53 | @Override 54 | public void setOutput(IItemStack itemStack) { 55 | this.output = itemStack; 56 | } 57 | 58 | @Override 59 | public int getMana() { 60 | return mana; 61 | } 62 | 63 | @Override 64 | public void setMana(int mana) { 65 | this.mana = mana; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gugucrttool/AdditionalInfoInventory.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gugucrttool; 2 | 3 | import javax.annotation.Nullable; 4 | import java.util.function.Consumer; 5 | 6 | public class AdditionalInfoInventory { 7 | protected Consumer listener; 8 | private RecipeNecessities[] infos; 9 | private int maxAmount; 10 | private boolean empty = true; 11 | 12 | 13 | private void updateEmptyState() { 14 | this.empty = true; 15 | 16 | for (RecipeNecessities info : infos) { 17 | if (info != null) { 18 | this.empty = false; 19 | return; 20 | } 21 | } 22 | 23 | } 24 | public int getSlots() { 25 | return infos.length; 26 | } 27 | 28 | public RecipeNecessities[] getInfos() { 29 | return infos; 30 | } 31 | 32 | @Nullable 33 | public RecipeNecessities getInfo(int slot) { 34 | return infos[slot]; 35 | } 36 | 37 | public void setFluid(int slot, @Nullable RecipeNecessities info) { 38 | infos[slot] = info; 39 | if (listener != null) { 40 | listener.accept(slot); 41 | } 42 | updateEmptyState(); 43 | } 44 | 45 | 46 | public boolean isEmpty() { 47 | return empty; 48 | } 49 | 50 | public static class RecipeNecessities { 51 | private String name; 52 | private int value; 53 | 54 | public String getName() { 55 | return name; 56 | } 57 | 58 | public void setName(String name) { 59 | this.name = name; 60 | } 61 | 62 | public int getValue() { 63 | return value; 64 | } 65 | 66 | public void setValue(int value) { 67 | this.value = value; 68 | } 69 | 70 | public RecipeNecessities(String name) { 71 | this.name = name; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gugucrttool/FluidAmountContainer.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gugucrttool; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.slot.DisplayFluidSlot; 4 | import com.warmthdawn.mod.gugu_utils.gui.FluidInventory; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.inventory.ClickType; 7 | import net.minecraft.inventory.Container; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraftforge.fluids.FluidStack; 10 | 11 | public class FluidAmountContainer extends Container { 12 | public FluidAmountContainer(EntityPlayer player, FluidStack stack) { 13 | FluidInventory inventory = new FluidInventory(1); 14 | inventory.setFluid(0, stack); 15 | addSlotToContainer(new DisplayFluidSlot(inventory, 0, 89, 48)); 16 | } 17 | 18 | @Override 19 | public boolean canInteractWith(EntityPlayer playerIn) { 20 | return true; 21 | } 22 | 23 | @Override 24 | public ItemStack slotClick(int slotId, int dragType, ClickType clickTypeIn, EntityPlayer player) { 25 | return ItemStack.EMPTY; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gugucrttool/GhostAddtionalInfoSlot.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gugucrttool; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.slot.GenericSlot; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.item.ItemStack; 6 | import net.minecraftforge.items.ItemStackHandler; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | import javax.annotation.Nonnull; 10 | 11 | public class GhostAddtionalInfoSlot extends GenericSlot { 12 | private final AdditionalInfoInventory inventory; 13 | 14 | public GhostAddtionalInfoSlot(AdditionalInfoInventory inventory, int index, int x, int y) { 15 | super(new ItemStackHandler(inventory.getSlots()), index, x, y); 16 | this.inventory = inventory; 17 | } 18 | 19 | @Override 20 | public boolean isItemValid(@Nonnull ItemStack stack) { 21 | return false; 22 | } 23 | 24 | 25 | @NotNull 26 | @Override 27 | public ItemStack getStack() { 28 | return ItemStack.EMPTY; 29 | } 30 | 31 | @Override 32 | public void putStack(@NotNull ItemStack stack) { 33 | 34 | } 35 | 36 | @Override 37 | public boolean canTakeStack(EntityPlayer playerIn) { 38 | return false; 39 | } 40 | 41 | public boolean isSizeAllowed() { 42 | return false; 43 | } 44 | 45 | public AdditionalInfoInventory getInventory() { 46 | return inventory; 47 | } 48 | 49 | public AdditionalInfoInventory.RecipeNecessities getInfo() { 50 | return this.inventory.getInfo(this.getSlotIndex()); 51 | } 52 | 53 | public void onContainerClicked(ItemStack stack) { 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gugucrttool/GhostJEIHandler.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gugucrttool; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.slot.GhostFluidSlot; 4 | import com.warmthdawn.mod.gugu_utils.common.slot.GhostItemSlot; 5 | import com.warmthdawn.mod.gugu_utils.tools.StackUtils; 6 | import mezz.jei.api.gui.IGhostIngredientHandler; 7 | import net.minecraft.inventory.Slot; 8 | import net.minecraft.item.ItemStack; 9 | import org.lwjgl.input.Keyboard; 10 | 11 | import java.awt.*; 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | public class GhostJEIHandler implements IGhostIngredientHandler { 16 | @Override 17 | public List> getTargets(CrtToolGui gui, I ingredient, boolean doStart) { 18 | List> targets = new ArrayList<>(); 19 | if (ingredient instanceof ItemStack) { 20 | ItemStack stack = ((ItemStack) ingredient).copy(); 21 | for (Slot slot : gui.inventorySlots.inventorySlots) { 22 | if (slot instanceof GhostItemSlot && slot.isEnabled() && slot.isItemValid(stack)) { 23 | targets.add(new GhostTarget<>(slot, gui.getGuiLeft(), gui.getGuiTop())); 24 | } else if (slot instanceof GhostFluidSlot && slot.isEnabled() && StackUtils.getFluid(stack, true).getFluidStack() != null) { 25 | targets.add(new GhostTarget<>(slot, gui.getGuiLeft(), gui.getGuiTop())); 26 | } 27 | } 28 | } 29 | return targets; 30 | } 31 | 32 | @Override 33 | public void onComplete() { 34 | 35 | } 36 | 37 | private static class GhostTarget implements IGhostIngredientHandler.Target { 38 | private final Rectangle rectangle; 39 | private final Slot slot; 40 | 41 | public GhostTarget(Slot slot, int xoff, int yoff) { 42 | this.rectangle = new Rectangle(slot.xPos + xoff, slot.yPos + yoff, 16, 16); 43 | this.slot = slot; 44 | } 45 | 46 | @Override 47 | public Rectangle getArea() { 48 | return rectangle; 49 | } 50 | 51 | @Override 52 | public void accept(I ingredient) { 53 | if (ingredient instanceof ItemStack) { 54 | ItemStack stack = ((ItemStack) ingredient).copy(); 55 | if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) 56 | stack.setCount(stack.getMaxStackSize()); 57 | slot.putStack(stack); 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gui/FluidInventory.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gui; 2 | 3 | import com.warmthdawn.mod.gugu_utils.tools.StackUtils; 4 | import net.minecraft.item.ItemStack; 5 | import net.minecraftforge.fluids.FluidStack; 6 | 7 | import javax.annotation.Nonnull; 8 | import javax.annotation.Nullable; 9 | import java.util.function.Consumer; 10 | 11 | public class FluidInventory { 12 | @Nullable 13 | protected Consumer listener; 14 | private final FluidStack[] fluids; 15 | private final int maxAmount; 16 | private boolean empty = true; 17 | 18 | public FluidInventory(int size, int maxAmount, @Nullable Consumer listener) { 19 | this.fluids = new FluidStack[size]; 20 | this.maxAmount = maxAmount; 21 | } 22 | 23 | public FluidInventory(int size, @Nullable Consumer listener) { 24 | this(size, Integer.MAX_VALUE, listener); 25 | } 26 | 27 | public FluidInventory(int size) { 28 | this(size, Integer.MAX_VALUE, null); 29 | } 30 | 31 | public int getSlots() { 32 | return fluids.length; 33 | } 34 | 35 | public int getMaxAmount() { 36 | return maxAmount; 37 | } 38 | 39 | public FluidStack[] getFluids() { 40 | return fluids; 41 | } 42 | 43 | @Nullable 44 | public FluidStack getFluid(int slot) { 45 | return fluids[slot]; 46 | } 47 | 48 | public void setFluid(int slot, @Nullable FluidStack stack) { 49 | if (stack != null && stack.amount <= 0 && stack.amount > maxAmount) { 50 | throw new IllegalArgumentException("Fluid size is invalid (given: " + stack.amount + ", max size: " + maxAmount + ")"); 51 | } 52 | 53 | fluids[slot] = stack; 54 | 55 | if (listener != null) { 56 | listener.accept(slot); 57 | } 58 | 59 | updateEmptyState(); 60 | } 61 | 62 | public void setFluidFromItem(int slot, @Nonnull ItemStack stack) { 63 | if (stack.isEmpty()) { 64 | setFluid(slot, null); 65 | } else { 66 | FluidStack fluid = StackUtils.getFluid(stack, true).getFluidStack(); 67 | 68 | if (fluid != null) { 69 | setFluid(slot, fluid); 70 | } 71 | } 72 | } 73 | 74 | private void updateEmptyState() { 75 | this.empty = true; 76 | 77 | for (FluidStack fluid : fluids) { 78 | if (fluid != null) { 79 | this.empty = false; 80 | 81 | return; 82 | } 83 | } 84 | } 85 | 86 | public boolean isEmpty() { 87 | return empty; 88 | } 89 | } -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gui/GenericContainer.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gui; 2 | 3 | 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.inventory.Container; 6 | 7 | public class GenericContainer extends Container { 8 | 9 | @Override 10 | public boolean canInteractWith(EntityPlayer playerIn) { 11 | return true; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gui/GenericGui.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gui; 2 | 3 | 4 | import net.minecraft.client.gui.inventory.GuiContainer; 5 | import net.minecraft.inventory.Container; 6 | 7 | public abstract class GenericGui extends GuiContainer { 8 | public GenericGui(Container inventorySlots, int width, int height) { 9 | super(inventorySlots); 10 | } 11 | 12 | @Override 13 | protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { 14 | 15 | } 16 | 17 | public abstract void init(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gui/GuGuCrtToolProvider.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gui; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.IGuiProvider; 4 | import com.warmthdawn.mod.gugu_utils.gugucrttool.CrtToolContainer; 5 | import com.warmthdawn.mod.gugu_utils.gugucrttool.CrtToolGui; 6 | import net.minecraft.client.gui.GuiScreen; 7 | import net.minecraft.entity.player.EntityPlayer; 8 | import net.minecraft.inventory.Container; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | import net.minecraftforge.fml.relauncher.SideOnly; 11 | 12 | public class GuGuCrtToolProvider implements IGuiProvider { 13 | 14 | @Override 15 | public Container createContainer(EntityPlayer player) { 16 | return new CrtToolContainer(player); 17 | } 18 | 19 | @Override 20 | @SideOnly(Side.CLIENT) 21 | public GuiScreen createGui(EntityPlayer player) { 22 | return new CrtToolGui(new CrtToolContainer(player)); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gui/GuiEvent.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gui; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.world.World; 5 | import net.minecraftforge.fml.common.eventhandler.Event; 6 | 7 | public class GuiEvent extends Event{ 8 | 9 | private final EntityPlayer player; 10 | private final World world; 11 | 12 | public int getId() { 13 | return id; 14 | } 15 | 16 | private final int id; 17 | 18 | 19 | public GuiEvent(EntityPlayer player, World world, int id) { 20 | this.player = player; 21 | this.world = world; 22 | this.id = id; 23 | } 24 | 25 | public EntityPlayer getPlayer() { 26 | return player; 27 | } 28 | 29 | public World getWorld() { 30 | return world; 31 | } 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/gui/ModIndependentGuis.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.gui; 2 | 3 | import com.google.common.collect.Maps; 4 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 5 | import com.warmthdawn.mod.gugu_utils.common.IGuiProvider; 6 | import net.minecraftforge.fml.common.Mod; 7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 8 | 9 | import java.util.Map; 10 | 11 | @Mod.EventBusSubscriber 12 | public class ModIndependentGuis { 13 | 14 | //魔改gui帮手 15 | public static int guGuCraftingTableGui; 16 | 17 | 18 | public static int beginIndex = 10; 19 | public static Map providers = Maps.newHashMap(); 20 | 21 | 22 | public static void init() { 23 | guGuCraftingTableGui = register(new GuGuCrtToolProvider()); 24 | } 25 | 26 | public static int register(IGuiProvider provider) { 27 | providers.put(beginIndex, provider); 28 | beginIndex++; 29 | return beginIndex - 1; 30 | 31 | } 32 | 33 | @SubscribeEvent 34 | public static void onGuiEvent(GuiEvent event) { 35 | event.getPlayer().openGui(GuGuUtils.instance, event.getId(), event.getWorld(), 0, -1, 0); 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/handler/GuiHandler.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.handler; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.IGuiProvider; 4 | import com.warmthdawn.mod.gugu_utils.gui.ModIndependentGuis; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import net.minecraft.tileentity.TileEntity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import net.minecraftforge.fml.common.Mod; 10 | import net.minecraftforge.fml.common.network.IGuiHandler; 11 | 12 | import javax.annotation.Nullable; 13 | 14 | @Mod.EventBusSubscriber 15 | public class GuiHandler implements IGuiHandler { 16 | 17 | @Nullable 18 | @Override 19 | public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { 20 | if (id >= 10) { 21 | if (ModIndependentGuis.providers.containsKey(id)) { 22 | return ModIndependentGuis.providers.get(id).createContainer(player); 23 | } 24 | return null; 25 | } 26 | BlockPos pos = new BlockPos(x, y, z); 27 | TileEntity te = world.getTileEntity(pos); 28 | if (te instanceof IGuiProvider) { 29 | return ((IGuiProvider) te).createContainer(player); 30 | } 31 | return null; 32 | } 33 | 34 | @Nullable 35 | @Override 36 | public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { 37 | if (id >= 10) { 38 | if (ModIndependentGuis.providers.containsKey(id)) { 39 | return ModIndependentGuis.providers.get(id).createGui(player); 40 | } 41 | return null; 42 | } 43 | BlockPos pos = new BlockPos(x, y, z); 44 | TileEntity te = world.getTileEntity(pos); 45 | if (te instanceof IGuiProvider) { 46 | return ((IGuiProvider) te).createGui(player); 47 | } 48 | return null; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/handler/MiscEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.handler; 2 | 3 | import WayofTime.bloodmagic.core.RegistrarBloodMagic; 4 | import com.warmthdawn.mod.gugu_utils.common.Enables; 5 | import net.minecraft.entity.EntityLivingBase; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraftforge.event.entity.living.LivingEvent; 8 | import net.minecraftforge.event.entity.living.LivingSpawnEvent; 9 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 10 | import net.minecraftforge.fml.common.gameevent.PlayerEvent; 11 | 12 | import java.util.HashSet; 13 | import java.util.Set; 14 | import java.util.UUID; 15 | 16 | public class MiscEventHandler { 17 | public static final Set playersWithBMFlight = new HashSet<>(); 18 | 19 | @SubscribeEvent 20 | public void onEntityUpdate(LivingEvent.LivingUpdateEvent event) { 21 | EntityLivingBase entity = event.getEntityLiving(); 22 | if (entity instanceof EntityPlayer) { 23 | EntityPlayer player = (EntityPlayer) entity; 24 | if (!player.world.isRemote && Enables.BLOOD_MAGIC) { 25 | if (player.isPotionActive(RegistrarBloodMagic.FLIGHT)) { 26 | if (!player.isSpectator() && !player.capabilities.allowFlying) { 27 | player.capabilities.allowFlying = true; 28 | player.sendPlayerAbilities(); 29 | } 30 | if (!player.isSpectator()) { 31 | playersWithBMFlight.add(player.getUniqueID()); 32 | } 33 | } else { 34 | if (playersWithBMFlight.contains(player.getUniqueID())) { 35 | player.capabilities.allowFlying = false; 36 | player.capabilities.isFlying = false; 37 | player.sendPlayerAbilities(); 38 | playersWithBMFlight.remove(player.getUniqueID()); 39 | } 40 | } 41 | 42 | } 43 | } 44 | } 45 | 46 | 47 | 48 | 49 | 50 | 51 | @SubscribeEvent 52 | public void playerLoggedOut(PlayerEvent.PlayerLoggedOutEvent event) { 53 | UUID uuid = event.player.getUniqueID(); 54 | playersWithBMFlight.remove(uuid); 55 | } 56 | 57 | @SubscribeEvent 58 | public void onEntitySpecialSpawn(LivingSpawnEvent.SpecialSpawn event) { 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/handler/StarlightHandler.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.handler; 2 | 3 | import com.warmthdawn.mod.gugu_utils.modularmachenary.starlight.TileStarlightInputHatch; 4 | import crafttweaker.annotations.ModOnly; 5 | import hellfirepvp.astralsorcery.common.event.StarlightNetworkEvent; 6 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 7 | 8 | @ModOnly("astralsorcery") 9 | public class StarlightHandler { 10 | @SubscribeEvent 11 | public void onStarlightTransmissionRegister(StarlightNetworkEvent.TransmissionRegister event) { 12 | event.getRegistry().registerProvider(new TileStarlightInputHatch.Provider()); 13 | } 14 | 15 | @SubscribeEvent 16 | public void onStarlightSourceRegister(StarlightNetworkEvent.SourceProviderRegistry event) { 17 | // event.getRegistry().registerProvider(new TileStarlightOutput.Provider()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/handler/tweaks/EntropinnyumTNTHandler.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.handler.tweaks; 2 | 3 | import com.warmthdawn.mod.gugu_utils.botania.subtitle.SubTileEntropinnyumModified; 4 | import net.minecraft.block.BlockRailDetector; 5 | import net.minecraft.block.BlockSlime; 6 | import net.minecraft.block.state.IBlockState; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.entity.item.EntityTNTPrimed; 9 | import net.minecraft.init.Blocks; 10 | import net.minecraft.tileentity.TileEntity; 11 | import net.minecraft.tileentity.TileEntityPiston; 12 | import net.minecraft.util.math.BlockPos; 13 | import net.minecraftforge.event.entity.EntityJoinWorldEvent; 14 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 15 | 16 | public class EntropinnyumTNTHandler { 17 | 18 | public static boolean isTNTUnethical(Entity e) { 19 | if (!e.world.isBlockLoaded(e.getPosition())) { 20 | return false; 21 | } 22 | 23 | BlockPos center = e.getPosition(); 24 | int x = center.getX(); 25 | int y = center.getY(); 26 | int z = center.getZ(); 27 | int range = 3; 28 | 29 | 30 | int movingPistons = 0; 31 | int rails = 0; 32 | int slimes = 0; 33 | for (BlockPos pos : BlockPos.getAllInBoxMutable(x - range, y - range, z - range, x + range + 1, y + range + 1, z + range + 1)) { 34 | IBlockState state = e.world.getBlockState(pos); 35 | if (state.getBlock() == Blocks.PISTON_EXTENSION) { 36 | movingPistons++; 37 | TileEntity te = e.world.getTileEntity(pos); 38 | if (te instanceof TileEntityPiston) { 39 | state = ((TileEntityPiston) te).getPistonState(); 40 | } 41 | } 42 | 43 | if (state.getBlock() instanceof BlockRailDetector) { 44 | rails++; 45 | } else if (state.getBlock() instanceof BlockSlime) { 46 | slimes++; 47 | } 48 | if (movingPistons > 0 || rails > 0 || slimes > 0) { 49 | return true; 50 | } 51 | 52 | } 53 | 54 | 55 | return false; 56 | } 57 | 58 | @SubscribeEvent 59 | public void onEntityJoinWorld(EntityJoinWorldEvent evt) { 60 | if (!evt.getWorld().isRemote) { 61 | if (evt.getEntity() instanceof EntityTNTPrimed && isTNTUnethical(evt.getEntity())) { 62 | evt.getEntity().getTags().add(SubTileEntropinnyumModified.TAG_UNETHICAL); 63 | } 64 | } 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/handler/tweaks/GaiaHandler.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.handler.tweaks; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | import net.minecraft.entity.SharedMonsterAttributes; 5 | import net.minecraftforge.event.entity.living.LivingAttackEvent; 6 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 7 | import vazkii.botania.common.entity.EntityDoppleganger; 8 | 9 | import java.lang.reflect.Field; 10 | import java.util.List; 11 | import java.util.UUID; 12 | 13 | public class GaiaHandler { 14 | 15 | private Field playersWhoAttacked; 16 | private Field playerCount; 17 | 18 | public GaiaHandler() { 19 | try { 20 | this.playersWhoAttacked = EntityDoppleganger.class.getDeclaredField("playersWhoAttacked"); 21 | this.playersWhoAttacked.setAccessible(true); 22 | this.playerCount = EntityDoppleganger.class.getDeclaredField("playerCount"); 23 | this.playerCount.setAccessible(true); 24 | } catch (NoSuchFieldException e) { 25 | e.printStackTrace(); 26 | } 27 | } 28 | 29 | @SubscribeEvent 30 | @SuppressWarnings("unchecked") 31 | public void onLivingAttack(LivingAttackEvent event) { 32 | EntityLivingBase entity = event.getEntityLiving(); 33 | //盖亚受伤事件 34 | if (playersWhoAttacked != null && playerCount != null && entity instanceof EntityDoppleganger) { 35 | try { 36 | final List playersWhoAttacked = (List) this.playersWhoAttacked.get(entity); 37 | final int playerCount = this.playerCount.getInt(entity); 38 | int currentCount = playersWhoAttacked.size(); 39 | if (playerCount <= currentCount) { 40 | this.playerCount.setInt(entity, currentCount); 41 | final int BASE_MAX_HEALTH = (int) (entity.getMaxHealth() / playerCount); 42 | entity.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH) 43 | .setBaseValue(BASE_MAX_HEALTH * currentCount); 44 | entity.setHealth(entity.getHealth() + BASE_MAX_HEALTH * (currentCount - playerCount)); 45 | } 46 | } catch (IllegalAccessException e) { 47 | e.printStackTrace(); 48 | } 49 | } 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/InfoHelper.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei; 2 | 3 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 4 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientInfo; 5 | import mezz.jei.api.ingredients.IIngredientHelper; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public class InfoHelper implements IIngredientHelper { 9 | @Nullable 10 | @Override 11 | public T getMatch(Iterable ingredients, T ingredientToMatch) { 12 | String re = ingredientToMatch.getResource().toString(); 13 | for (T i : ingredients) { 14 | if (re.equals(i.getResource().toString())) { 15 | return i; 16 | } 17 | } 18 | return null; 19 | } 20 | 21 | 22 | @Override 23 | public String getDisplayName(T ingredient) { 24 | return ingredient.getDisplayName(); 25 | } 26 | 27 | @Override 28 | public String getUniqueId(T ingredient) { 29 | return ingredient.getResource().toString(); 30 | } 31 | 32 | @Override 33 | public String getWildcardId(T ingredient) { 34 | return ingredient.getResource().toString(); 35 | } 36 | 37 | @Override 38 | public String getModId(T ingredient) { 39 | return GuGuUtils.MODID; 40 | } 41 | 42 | @Override 43 | public String getDisplayModId(T ingredient) { 44 | return ingredient.getResource().getNamespace(); 45 | } 46 | 47 | @Override 48 | public String getResourceId(T ingredient) { 49 | return ingredient.getResource().getPath(); 50 | } 51 | 52 | @Override 53 | public T copyIngredient(T ingredient) { 54 | return ingredient; 55 | } 56 | 57 | @Override 58 | public String getErrorInfo(@Nullable T ingredient) { 59 | return "This is an ingredient just for info by GuGu Utils"; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/botania/BurstTransformWapper.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.botania; 2 | 3 | import com.google.common.collect.ImmutableList; 4 | import com.warmthdawn.mod.gugu_utils.botania.recipes.TransformRecipe; 5 | import com.warmthdawn.mod.gugu_utils.tools.RenderUtils; 6 | import mezz.jei.api.ingredients.IIngredients; 7 | import mezz.jei.api.ingredients.VanillaTypes; 8 | import mezz.jei.api.recipe.IRecipeWrapper; 9 | import net.minecraft.client.Minecraft; 10 | import net.minecraft.client.renderer.GlStateManager; 11 | import net.minecraft.client.resources.I18n; 12 | import vazkii.botania.client.core.handler.HUDHandler; 13 | 14 | import java.util.Collections; 15 | import java.util.List; 16 | 17 | public class BurstTransformWapper implements IRecipeWrapper { 18 | 19 | public static final String KEY_MANA_AMOUNT = "tooltips.gugu-utils.mana_amount"; 20 | public final TransformRecipe theRecipe; 21 | 22 | public BurstTransformWapper(TransformRecipe recipe) { 23 | this.theRecipe = recipe; 24 | } 25 | 26 | @Override 27 | public void getIngredients(IIngredients ingredients) { 28 | ingredients.setInputs(VanillaTypes.ITEM, ImmutableList.copyOf(theRecipe.getInput().getMatchingStacks())); 29 | ingredients.setOutput(VanillaTypes.ITEM, theRecipe.getOutputStack()); 30 | } 31 | 32 | @Override 33 | public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { 34 | GlStateManager.enableAlpha(); 35 | HUDHandler.renderManaBar(28, 50, 0x0000FF, 0.75F, theRecipe.getMana(), 2500); 36 | GlStateManager.disableAlpha(); 37 | } 38 | 39 | @Override 40 | public List getTooltipStrings(int mouseX, int mouseY) { 41 | if (RenderUtils.inBounds(28, 50, 102, 5, mouseX, mouseY)) 42 | return Collections.singletonList(I18n.format(KEY_MANA_AMOUNT, theRecipe.getMana())); 43 | return Collections.emptyList(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/components/JEIComponentAspect.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.components; 2 | 3 | import com.warmthdawn.mod.gugu_utils.jei.LayoutWapper; 4 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientAspect; 5 | import com.warmthdawn.mod.gugu_utils.jei.renders.RendererAspect; 6 | import hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement; 7 | import hellfirepvp.modularmachinery.common.integration.recipe.RecipeLayoutPart; 8 | import mezz.jei.api.ingredients.IIngredientRenderer; 9 | import net.minecraft.util.ResourceLocation; 10 | import thaumcraft.api.aspects.Aspect; 11 | 12 | import java.awt.*; 13 | import java.util.Collections; 14 | import java.util.List; 15 | 16 | public class JEIComponentAspect extends ComponentRequirement.JEIComponent { 17 | 18 | private final int amount; 19 | private final Aspect aspect; 20 | 21 | public JEIComponentAspect(int amount, Aspect aspect) { 22 | this.amount = amount; 23 | this.aspect = aspect; 24 | } 25 | 26 | @Override 27 | public Class getJEIRequirementClass() { 28 | return IngredientAspect.class; 29 | } 30 | 31 | @Override 32 | public List getJEIIORequirements() { 33 | return Collections.singletonList(new IngredientAspect("Aspect", amount, new ResourceLocation("thaumcraft", "aspect"), aspect)); 34 | 35 | } 36 | 37 | @Override 38 | public RecipeLayoutPart getLayoutPart(Point offset) { 39 | return new LayoutPart(offset); 40 | } 41 | 42 | @Override 43 | public void onJEIHoverTooltip(int slotIndex, boolean input, IngredientAspect ingredient, List tooltip) { 44 | 45 | } 46 | 47 | public static class LayoutPart extends LayoutWapper { 48 | public LayoutPart(Point offset) { 49 | super(offset, 16, 16, 18, 18, 1, 1, 1, 1, 3, 60); 50 | } 51 | 52 | @Override 53 | public Class getLayoutTypeClass() { 54 | return IngredientAspect.class; 55 | } 56 | 57 | @Override 58 | public IIngredientRenderer provideIngredientRenderer() { 59 | return RendererAspect.INSTANCE; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/components/JEIComponentAura.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.components; 2 | 3 | import com.warmthdawn.mod.gugu_utils.jei.LayoutWapper; 4 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientAura; 5 | import com.warmthdawn.mod.gugu_utils.jei.renders.RendererAura; 6 | import hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement; 7 | import hellfirepvp.modularmachinery.common.integration.recipe.RecipeLayoutPart; 8 | import mezz.jei.api.ingredients.IIngredientRenderer; 9 | import net.minecraft.util.ResourceLocation; 10 | 11 | import java.awt.*; 12 | import java.util.Collections; 13 | import java.util.List; 14 | 15 | public class JEIComponentAura extends ComponentRequirement.JEIComponent { 16 | 17 | private final int aura; 18 | private final int totalTick; 19 | private final boolean force; 20 | 21 | public JEIComponentAura(int aura, int totalTick, boolean force) { 22 | this.aura = aura; 23 | this.totalTick = totalTick; 24 | this.force = force; 25 | } 26 | 27 | @Override 28 | public Class getJEIRequirementClass() { 29 | return IngredientAura.class; 30 | } 31 | 32 | @Override 33 | public List getJEIIORequirements() { 34 | return Collections.singletonList(new IngredientAura("Aura", aura, new ResourceLocation("naturesaura", "aura"), totalTick, force)); 35 | } 36 | 37 | @Override 38 | public RecipeLayoutPart getLayoutPart(Point offset) { 39 | return new JEIComponentAura.LayoutPart(offset); 40 | } 41 | 42 | @Override 43 | public void onJEIHoverTooltip(int slotIndex, boolean input, IngredientAura ingredient, List tooltip) { 44 | 45 | } 46 | 47 | public static class LayoutPart extends LayoutWapper { 48 | public LayoutPart(Point offset) { 49 | super(offset, 6, 80, 6, 100, 0, 10, 8, 4, 2, 200); 50 | } 51 | 52 | @Override 53 | public Class getLayoutTypeClass() { 54 | return IngredientAura.class; 55 | } 56 | 57 | @Override 58 | public IIngredientRenderer provideIngredientRenderer() { 59 | return RendererAura.INSTANCE; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/components/JEIComponentEmber.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.components; 2 | 3 | import com.warmthdawn.mod.gugu_utils.jei.LayoutWapper; 4 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientEmber; 5 | import com.warmthdawn.mod.gugu_utils.jei.renders.RendererEmber; 6 | import hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement; 7 | import hellfirepvp.modularmachinery.common.integration.recipe.RecipeLayoutPart; 8 | import mezz.jei.api.ingredients.IIngredientRenderer; 9 | import net.minecraft.client.Minecraft; 10 | import net.minecraft.util.ResourceLocation; 11 | 12 | import java.awt.*; 13 | import java.util.Collections; 14 | import java.util.List; 15 | 16 | public class JEIComponentEmber extends ComponentRequirement.JEIComponent { 17 | private final double ember; 18 | 19 | public JEIComponentEmber(double ember) { 20 | this.ember = ember; 21 | } 22 | 23 | @Override 24 | public Class getJEIRequirementClass() { 25 | return IngredientEmber.class; 26 | } 27 | 28 | @Override 29 | public List getJEIIORequirements() { 30 | return Collections.singletonList(new IngredientEmber("Ember", ember, new ResourceLocation("embers", "ember"))); 31 | } 32 | 33 | @Override 34 | public RecipeLayoutPart getLayoutPart(Point offset) { 35 | return new LayoutPart(offset); 36 | } 37 | 38 | @Override 39 | public void onJEIHoverTooltip(int slotIndex, boolean input, IngredientEmber ingredient, List tooltip) { 40 | 41 | } 42 | 43 | public static class LayoutPart extends LayoutWapper { 44 | 45 | public LayoutPart(Point offset) { 46 | super(offset, 5, 102, 5, 102, 0, 0, 8, 16, 4, 200); 47 | } 48 | 49 | @Override 50 | public Class getLayoutTypeClass() { 51 | return IngredientEmber.class; 52 | } 53 | 54 | @Override 55 | public IIngredientRenderer provideIngredientRenderer() { 56 | 57 | return RendererEmber.INSTANCE; 58 | } 59 | 60 | @Override 61 | public void drawBackground(Minecraft mc) { 62 | 63 | } 64 | 65 | @Override 66 | public boolean canBeScaled() { 67 | return false; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/components/JEIComponentEnvironment.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.components; 2 | 3 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 4 | import com.warmthdawn.mod.gugu_utils.jei.LayoutWapper; 5 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientEnvironment; 6 | import com.warmthdawn.mod.gugu_utils.jei.renders.RendererEnvironment; 7 | import com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes.EnvironmentType; 8 | import hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement; 9 | import hellfirepvp.modularmachinery.common.integration.recipe.RecipeLayoutPart; 10 | import mezz.jei.api.ingredients.IIngredientRenderer; 11 | import net.minecraft.util.ResourceLocation; 12 | 13 | import java.awt.*; 14 | import java.util.Collections; 15 | import java.util.List; 16 | 17 | public class JEIComponentEnvironment extends ComponentRequirement.JEIComponent { 18 | private final EnvironmentType type; 19 | 20 | public JEIComponentEnvironment(EnvironmentType type) { 21 | this.type = type; 22 | } 23 | 24 | public EnvironmentType getType() { 25 | return type; 26 | } 27 | 28 | @Override 29 | public Class getJEIRequirementClass() { 30 | return IngredientEnvironment.class; 31 | } 32 | 33 | @Override 34 | public List getJEIIORequirements() { 35 | return Collections.singletonList(new IngredientEnvironment("Environment", type, new ResourceLocation(GuGuUtils.MODID, "environment"))); 36 | } 37 | 38 | @Override 39 | public RecipeLayoutPart getLayoutPart(Point offset) { 40 | return new LayoutPart(offset); 41 | } 42 | 43 | @Override 44 | public void onJEIHoverTooltip(int slotIndex, boolean input, IngredientEnvironment ingredient, List tooltip) { 45 | 46 | } 47 | 48 | public static class LayoutPart extends LayoutWapper { 49 | 50 | public LayoutPart(Point offset) { 51 | super(offset, 16, 16, 0, 0, 4, 4, 3, 50); 52 | } 53 | 54 | @Override 55 | public Class getLayoutTypeClass() { 56 | return IngredientEnvironment.class; 57 | } 58 | 59 | @Override 60 | public IIngredientRenderer provideIngredientRenderer() { 61 | return RendererEnvironment.INSTANCE; 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/components/JEIComponentHotAir.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.components; 2 | 3 | import com.warmthdawn.mod.gugu_utils.jei.LayoutWapper; 4 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientAspect; 5 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientHotAir; 6 | import com.warmthdawn.mod.gugu_utils.jei.renders.RendererAspect; 7 | import com.warmthdawn.mod.gugu_utils.jei.renders.RendererHotAir; 8 | import hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement; 9 | import hellfirepvp.modularmachinery.common.integration.recipe.RecipeLayoutPart; 10 | import mezz.jei.api.ingredients.IIngredientRenderer; 11 | import net.minecraft.util.ResourceLocation; 12 | import thaumcraft.api.aspects.Aspect; 13 | 14 | import java.awt.*; 15 | import java.util.Collections; 16 | import java.util.List; 17 | 18 | public class JEIComponentHotAir extends ComponentRequirement.JEIComponent { 19 | 20 | //最低工作温度 21 | private int minTemperature; 22 | 23 | //最高工作温度 24 | private int maxTemperature; 25 | //热量消耗 26 | private int heat; 27 | 28 | 29 | public JEIComponentHotAir(int minTemperature, int maxTemperature, int heat) { 30 | this.minTemperature = minTemperature; 31 | this.maxTemperature = maxTemperature; 32 | this.heat = heat; 33 | } 34 | 35 | @Override 36 | public Class getJEIRequirementClass() { 37 | return IngredientHotAir.class; 38 | } 39 | 40 | @Override 41 | public List getJEIIORequirements() { 42 | return Collections.singletonList(new IngredientHotAir("Hot Air", heat, new ResourceLocation("prodigytech", "hotair"), minTemperature,maxTemperature)); 43 | 44 | } 45 | 46 | @Override 47 | public RecipeLayoutPart getLayoutPart(Point offset) { 48 | return new LayoutPart(offset); 49 | } 50 | 51 | @Override 52 | public void onJEIHoverTooltip(int slotIndex, boolean input, IngredientHotAir ingredient, List tooltip) { 53 | 54 | } 55 | 56 | public static class LayoutPart extends LayoutWapper { 57 | public LayoutPart(Point offset) { 58 | super(offset, 16, 16, 18, 18, 1, 1, 1, 1, 3, 60); 59 | } 60 | 61 | @Override 62 | public Class getLayoutTypeClass() { 63 | return IngredientHotAir.class; 64 | } 65 | 66 | @Override 67 | public IIngredientRenderer provideIngredientRenderer() { 68 | return RendererHotAir.INSTANCE; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientAspect.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | import thaumcraft.api.aspects.Aspect; 5 | 6 | public class IngredientAspect extends IngredientInfo { 7 | 8 | private final Aspect aspect; 9 | 10 | public IngredientAspect(String displayName, Object value, ResourceLocation resourceLocation, Aspect aspect) { 11 | super(displayName, value, resourceLocation); 12 | this.aspect = aspect; 13 | } 14 | 15 | public Aspect getAspect() { 16 | return aspect; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientAura.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | 5 | public class IngredientAura extends IngredientInfo { 6 | private final int ticks; 7 | private final boolean force; 8 | 9 | public IngredientAura(String displayName, Object value, ResourceLocation resourceLocation, int ticks, boolean force) { 10 | super(displayName, value, resourceLocation); 11 | this.ticks = ticks; 12 | this.force = force; 13 | } 14 | 15 | public int getTicks() { 16 | return ticks; 17 | } 18 | 19 | public boolean isForce() { 20 | return this.force; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientCompressedAir.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | 5 | public class IngredientCompressedAir extends IngredientInfo { 6 | public int getTicks() { 7 | return ticks; 8 | } 9 | 10 | private final int ticks; 11 | 12 | public float getMinPressure() { 13 | return minPressure; 14 | } 15 | 16 | private final float minPressure; 17 | 18 | public IngredientCompressedAir(String displayName, int air, ResourceLocation resourceLocation, float minPressure) { 19 | super(displayName, air, resourceLocation); 20 | this.minPressure = minPressure; 21 | this.ticks = -1; 22 | } 23 | public IngredientCompressedAir(String displayName, int air, ResourceLocation resourceLocation, float minPressure, int ticks) { 24 | super(displayName, air, resourceLocation); 25 | this.ticks = ticks; 26 | this.minPressure = minPressure; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientEmber.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | 5 | public class IngredientEmber extends IngredientInfo { 6 | public IngredientEmber(String displayName, Object value, ResourceLocation resourceLocation) { 7 | super(displayName, value, resourceLocation); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientEnvironment.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes.EnvironmentType; 4 | import net.minecraft.util.ResourceLocation; 5 | 6 | public class IngredientEnvironment extends IngredientInfo{ 7 | public EnvironmentType getType() { 8 | return (EnvironmentType) this.getValue(); 9 | } 10 | public IngredientEnvironment(String displayName, Object value, ResourceLocation resourceLocation) { 11 | super(displayName, value, resourceLocation); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientHotAir.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | import thaumcraft.api.aspects.Aspect; 5 | 6 | public class IngredientHotAir extends IngredientInfo { 7 | 8 | //最低工作温度 9 | private int minTemperature; 10 | 11 | //最高工作温度 12 | private int maxTemperature; 13 | 14 | 15 | public IngredientHotAir(String displayName, Object value, ResourceLocation resourceLocation, int minTemperature, int maxTemperature) { 16 | super(displayName, value, resourceLocation); 17 | this.minTemperature = minTemperature; 18 | this.maxTemperature = maxTemperature; 19 | } 20 | 21 | public int getMinTemperature() { 22 | return minTemperature; 23 | } 24 | 25 | public int getMaxTemperature() { 26 | return maxTemperature; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientInfo.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | 5 | public class IngredientInfo { 6 | private final String displayName; 7 | private final Object value; 8 | private final ResourceLocation resourceLocation; 9 | 10 | public IngredientInfo(String displayName, Object value, ResourceLocation resourceLocation) { 11 | this.displayName = displayName; 12 | this.value = value; 13 | this.resourceLocation = resourceLocation; 14 | } 15 | 16 | public String getDisplayName() { 17 | return this.displayName; 18 | } 19 | 20 | public ResourceLocation getResource() { 21 | return this.resourceLocation; 22 | } 23 | 24 | public Object getValue() { 25 | return this.value; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientMana.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | 5 | public class IngredientMana extends IngredientInfo { 6 | public int getTicks() { 7 | return ticks; 8 | } 9 | 10 | private final int ticks; 11 | 12 | public IngredientMana(String displayName, int value, ResourceLocation resourceLocation) { 13 | super(displayName, value, resourceLocation); 14 | this.ticks = -1; 15 | } 16 | public IngredientMana(String displayName, int value, ResourceLocation resourceLocation, int ticks) { 17 | super(displayName, value, resourceLocation); 18 | this.ticks = ticks; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/ingedients/IngredientStarlight.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.ingedients; 2 | 3 | import hellfirepvp.astralsorcery.common.constellation.IConstellation; 4 | import net.minecraft.util.ResourceLocation; 5 | 6 | public class IngredientStarlight extends IngredientInfo{ 7 | public IConstellation getConstellation() { 8 | return constellation; 9 | } 10 | 11 | private final IConstellation constellation; 12 | 13 | public IngredientStarlight(String displayName, Object value, ResourceLocation resourceLocation, IConstellation constellation) { 14 | super(displayName, value, resourceLocation); 15 | this.constellation = constellation; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/jei/renders/RendererAspect.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.jei.renders; 2 | 3 | import com.warmthdawn.mod.gugu_utils.jei.ingedients.IngredientAspect; 4 | import mezz.jei.api.ingredients.IIngredientRenderer; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.Gui; 7 | import net.minecraft.client.renderer.GlStateManager; 8 | import net.minecraft.client.util.ITooltipFlag; 9 | import net.minecraft.util.text.TextFormatting; 10 | 11 | import javax.annotation.Nullable; 12 | import java.awt.*; 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | public class RendererAspect implements IIngredientRenderer { 17 | public static final RendererAspect INSTANCE = new RendererAspect(); 18 | 19 | private RendererAspect() { 20 | } 21 | 22 | 23 | @Override 24 | public void render(Minecraft minecraft, int xPosition, int yPosition, @Nullable IngredientAspect ingredient) { 25 | if (ingredient != null) { 26 | GlStateManager.pushMatrix(); 27 | minecraft.renderEngine.bindTexture(ingredient.getAspect().getImage()); 28 | GlStateManager.enableBlend(); 29 | Color c = new Color(ingredient.getAspect().getColor()); 30 | GlStateManager.color((float) c.getRed() / 255.0F, (float) c.getGreen() / 255.0F, (float) c.getBlue() / 255.0F, 1.0F); 31 | Gui.drawModalRectWithCustomSizedTexture(xPosition, yPosition, 0, 0, 16, 16, 16, 16); 32 | GlStateManager.color(1F, 1F, 1F, 1F); 33 | GlStateManager.scale(0.5, 0.5, 0.5); 34 | if ((int) ingredient.getValue() > 1) 35 | minecraft.currentScreen.drawCenteredString(minecraft.fontRenderer, TextFormatting.WHITE + "" + ingredient.getValue(), (xPosition + 16) * 2, (yPosition + 12) * 2, 0); 36 | GlStateManager.popMatrix(); 37 | } 38 | } 39 | 40 | @Override 41 | public List getTooltip(Minecraft minecraft, IngredientAspect ingredient, ITooltipFlag tooltipFlag) { 42 | return Arrays.asList(TextFormatting.AQUA + ingredient.getAspect().getName(), TextFormatting.GRAY + ingredient.getAspect().getLocalizedDescription()); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/IColorableTileEntity.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary; 2 | 3 | public interface IColorableTileEntity { 4 | int getMachineColor(); 5 | 6 | void setMachineColor(int newColor); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/ModularMachenaryCompact.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | import hellfirepvp.modularmachinery.common.crafting.requirement.type.RequirementType; 5 | import net.minecraftforge.event.RegistryEvent; 6 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 7 | 8 | 9 | public class ModularMachenaryCompact { 10 | public static void preInit() { 11 | MMCompoments.preInit(); 12 | MMRequirements.preInit(); 13 | } 14 | 15 | @SubscribeEvent 16 | public void onComponentTypeRegister(RegistryEvent.Register event) { 17 | MMCompoments.initComponents(event.getRegistry()); 18 | } 19 | 20 | @SubscribeEvent 21 | public void onRequirementTypeRegister(RegistryEvent.Register event) { 22 | if (event.getGenericType() != RequirementType.class) 23 | return; 24 | MMRequirements.initRequirements(event.getRegistry()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/aura/BlockAuraInputHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.aura; 2 | 3 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 4 | import com.warmthdawn.mod.gugu_utils.common.GenericBlock; 5 | import net.minecraft.block.SoundType; 6 | import net.minecraft.block.material.Material; 7 | import net.minecraft.block.state.IBlockState; 8 | import net.minecraft.tileentity.TileEntity; 9 | import net.minecraft.util.BlockRenderLayer; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.world.World; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | import net.minecraftforge.fml.relauncher.SideOnly; 14 | import org.jetbrains.annotations.Nullable; 15 | 16 | import javax.annotation.Nonnull; 17 | 18 | import static com.warmthdawn.mod.gugu_utils.common.Constants.NAME_AURAHATCH_INPUT; 19 | import static com.warmthdawn.mod.gugu_utils.common.Constants.RESOURCE_AURAHATCH_INPUT; 20 | import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; 21 | 22 | public class BlockAuraInputHatch extends GenericBlock { 23 | public BlockAuraInputHatch() { 24 | super(Material.ROCK); 25 | setHardness(4.0F); 26 | setResistance(10.0F); 27 | setSoundType(SoundType.STONE); 28 | setHarvestLevel("pickaxe", 1); 29 | setRegistryName(RESOURCE_AURAHATCH_INPUT); 30 | setTranslationKey(j(GuGuUtils.MODID, NAME_AURAHATCH_INPUT)); 31 | } 32 | 33 | @Override 34 | public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param) { 35 | worldIn.markBlockRangeForRenderUpdate(pos, pos); 36 | return true; 37 | } 38 | 39 | @Override 40 | @Nonnull 41 | @SideOnly(Side.CLIENT) 42 | public BlockRenderLayer getRenderLayer() { 43 | return BlockRenderLayer.TRANSLUCENT; 44 | } 45 | 46 | 47 | @Nullable 48 | @Override 49 | public TileEntity createTileEntity(World world, IBlockState state) { 50 | return new TileAuraInputHatch(); 51 | } 52 | 53 | @Override 54 | public boolean hasTileEntity(IBlockState state) { 55 | return true; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/aura/TileAuraHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.aura; 2 | 3 | import com.warmthdawn.mod.gugu_utils.modularmachenary.CommonMMTile; 4 | import de.ellpeck.naturesaura.api.NaturesAuraAPI; 5 | import de.ellpeck.naturesaura.api.aura.container.BasicAuraContainer; 6 | import net.minecraft.nbt.NBTTagCompound; 7 | import net.minecraft.util.EnumFacing; 8 | import net.minecraftforge.common.capabilities.Capability; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | public class TileAuraHatch extends CommonMMTile { 13 | public static final int MAX_AURA = 500000; 14 | 15 | protected BasicAuraContainer container = new BasicAuraContainer(null, MAX_AURA); 16 | 17 | @Override 18 | public boolean hasCapability(Capability capability, @Nullable EnumFacing facing) { 19 | return capability == NaturesAuraAPI.capAuraContainer || super.hasCapability(capability, facing); 20 | } 21 | 22 | @SuppressWarnings("unchecked") 23 | @Nullable 24 | @Override 25 | public T getCapability(Capability capability, @Nullable EnumFacing facing) { 26 | if (capability == NaturesAuraAPI.capAuraContainer) { 27 | return (T) this.container; 28 | } else { 29 | return super.getCapability(capability, facing); 30 | } 31 | } 32 | 33 | 34 | @Override 35 | public void writeNBT(NBTTagCompound compound) { 36 | super.writeNBT(compound); 37 | container.writeNBT(compound); 38 | } 39 | 40 | @Override 41 | public void readNBT(NBTTagCompound compound) { 42 | super.readNBT(compound); 43 | container.readNBT(compound); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/common/IOHatchVariant.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.common; 2 | 3 | import net.minecraft.util.IStringSerializable; 4 | 5 | import java.util.Locale; 6 | 7 | public enum IOHatchVariant implements IStringSerializable { 8 | INPUT, 9 | OUTPUT, 10 | ; 11 | @Override 12 | public String getName() { 13 | return name().toLowerCase(Locale.ROOT); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentAspect.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public class ComponentAspect extends ComponentType { 7 | @Nullable 8 | @Override 9 | public String requiresModid() { 10 | return "thaumcraft"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentAura.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public class ComponentAura extends ComponentType { 7 | @Nullable 8 | @Override 9 | public String requiresModid() { 10 | return "naturesaura"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentCompressedAir.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | public class ComponentCompressedAir extends ComponentType { 8 | 9 | @Nullable 10 | @Override 11 | public String requiresModid() { 12 | return "pneumaticcraft"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentEmber.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public class ComponentEmber extends ComponentType { 7 | @Nullable 8 | @Override 9 | public String requiresModid() { 10 | return "embers"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentEnvironment.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public class ComponentEnvironment extends ComponentType { 7 | @Nullable 8 | @Override 9 | public String requiresModid() { 10 | return null; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentHotAir.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | public class ComponentHotAir extends ComponentType { 8 | 9 | @Nullable 10 | @Override 11 | public String requiresModid() { 12 | return "prodigytech"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentMana.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | public class ComponentMana extends ComponentType { 8 | 9 | @Nullable 10 | @Override 11 | public String requiresModid() { 12 | return "botania"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/ComponentStarlight.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | public class ComponentStarlight extends ComponentType { 8 | 9 | @Nullable 10 | @Override 11 | public String requiresModid() { 12 | return "astralsorcery"; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/components/GenericMachineCompoment.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.components; 2 | 3 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.*; 4 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 5 | import hellfirepvp.modularmachinery.common.machine.IOType; 6 | import hellfirepvp.modularmachinery.common.machine.MachineComponent; 7 | 8 | public class GenericMachineCompoment extends MachineComponent> { 9 | 10 | private final IConsumable consumable; 11 | private final ICraftNotifier notifier; 12 | private final IGeneratable generatable; 13 | private final ComponentType componentType; 14 | 15 | public GenericMachineCompoment(IConsumable consumable, ComponentType componentType) { 16 | super(IOType.INPUT); 17 | this.consumable = consumable; 18 | this.componentType = componentType; 19 | this.generatable = null; 20 | this.notifier = null; 21 | } 22 | 23 | public GenericMachineCompoment(IGeneratable generatable, ComponentType componentType) { 24 | super(IOType.OUTPUT); 25 | this.generatable = generatable; 26 | this.componentType = componentType; 27 | this.consumable = null; 28 | this.notifier = null; 29 | } 30 | 31 | public GenericMachineCompoment(IConsumable consumable, ICraftNotifier notifier, ComponentType componentType) { 32 | super(IOType.INPUT); 33 | this.consumable = consumable; 34 | this.componentType = componentType; 35 | this.generatable = null; 36 | this.notifier = notifier; 37 | } 38 | 39 | public GenericMachineCompoment(IGeneratable generatable, ICraftNotifier notifier, ComponentType componentType) { 40 | super(IOType.OUTPUT); 41 | this.generatable = generatable; 42 | this.componentType = componentType; 43 | this.consumable = null; 44 | this.notifier = notifier; 45 | } 46 | 47 | 48 | @Override 49 | public ComponentType getComponentType() { 50 | return componentType; 51 | } 52 | 53 | @Override 54 | public ICraftingResourceHolder getContainerProvider() { 55 | if (this.notifier != null) { 56 | return new CraftingResourceHolder<>(consumable, generatable).setNotify(notifier); 57 | } else { 58 | return new CraftingResourceHolder<>(consumable, generatable); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/embers/EmbersHatchVariant.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.embers; 2 | 3 | import net.minecraft.util.IStringSerializable; 4 | 5 | import java.util.Locale; 6 | 7 | public enum EmbersHatchVariant implements IStringSerializable { 8 | TINY, 9 | SMALL, 10 | MEDIUM, 11 | REINFORCED, 12 | BIG, 13 | HUGE, 14 | LUDICROUS, 15 | EXTREME; 16 | 17 | public static final EmbersHatchVariant[] VAULES = EmbersHatchVariant.values(); 18 | 19 | @Override 20 | public String getName() { 21 | return name().toLowerCase(Locale.ROOT); 22 | } 23 | 24 | public int getEmberMaxStorage() { 25 | switch (this) { 26 | case TINY: 27 | default: 28 | return 400; 29 | case SMALL: 30 | return 800; 31 | case MEDIUM: 32 | return 1600; 33 | case REINFORCED: 34 | return 3200; 35 | case BIG: 36 | return 6400; 37 | case HUGE: 38 | return 9600; 39 | case LUDICROUS: 40 | return 12800; 41 | case EXTREME: 42 | return 16000; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/BlockEnvironmentHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment; 2 | 3 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 4 | import com.warmthdawn.mod.gugu_utils.common.GenericBlock; 5 | import net.minecraft.block.ITileEntityProvider; 6 | import net.minecraft.block.SoundType; 7 | import net.minecraft.block.material.Material; 8 | import net.minecraft.block.state.IBlockState; 9 | import net.minecraft.client.util.ITooltipFlag; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.tileentity.TileEntity; 12 | import net.minecraft.util.BlockRenderLayer; 13 | import net.minecraft.util.math.BlockPos; 14 | import net.minecraft.world.World; 15 | import net.minecraftforge.fml.relauncher.Side; 16 | import net.minecraftforge.fml.relauncher.SideOnly; 17 | 18 | import javax.annotation.Nonnull; 19 | import javax.annotation.Nullable; 20 | import java.util.List; 21 | 22 | import static com.warmthdawn.mod.gugu_utils.common.Constants.NAME_ENVIRONMENTHATCH; 23 | import static com.warmthdawn.mod.gugu_utils.common.Constants.RESOURCE_ENVIRONMENTHATCH; 24 | import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; 25 | 26 | public class BlockEnvironmentHatch extends GenericBlock implements ITileEntityProvider { 27 | 28 | public BlockEnvironmentHatch() { 29 | super(Material.ROCK); 30 | setHardness(2.0F); 31 | setResistance(10.0F); 32 | setSoundType(SoundType.STONE); 33 | setHarvestLevel("pickaxe", 0); 34 | setRegistryName(RESOURCE_ENVIRONMENTHATCH); 35 | setTranslationKey(j(GuGuUtils.MODID, NAME_ENVIRONMENTHATCH)); 36 | } 37 | 38 | 39 | @Override 40 | public boolean eventReceived(IBlockState state, World worldIn, BlockPos pos, int id, int param) { 41 | worldIn.markBlockRangeForRenderUpdate(pos, pos); 42 | return true; 43 | } 44 | 45 | @Override 46 | @Nonnull 47 | @SideOnly(Side.CLIENT) 48 | public BlockRenderLayer getRenderLayer() { 49 | return BlockRenderLayer.CUTOUT; 50 | } 51 | 52 | @Nullable 53 | @Override 54 | public TileEntity createNewTileEntity(World world, int meta) { 55 | return new TileEnvironmentHatch(); 56 | } 57 | 58 | 59 | @Override 60 | public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag advanced) { 61 | 62 | } 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/TileEnvironmentHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment; 2 | 3 | import com.warmthdawn.mod.gugu_utils.modularmachenary.CommonMMTile; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.MMCompoments; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementEnvironment; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.CraftingResourceHolder; 7 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.IConsumable; 8 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 9 | import hellfirepvp.modularmachinery.common.machine.IOType; 10 | import hellfirepvp.modularmachinery.common.machine.MachineComponent; 11 | import hellfirepvp.modularmachinery.common.tiles.base.MachineComponentTile; 12 | 13 | import javax.annotation.Nullable; 14 | 15 | import static com.warmthdawn.mod.gugu_utils.common.Constants.STRING_RESOURCE_ENVIRONMENT; 16 | 17 | public class TileEnvironmentHatch extends CommonMMTile implements IConsumable, MachineComponentTile { 18 | 19 | @Nullable 20 | @Override 21 | public MachineComponent provideComponent() { 22 | return new MachineComponent(IOType.INPUT) { 23 | @Override 24 | public ComponentType getComponentType() { 25 | return (ComponentType) MMCompoments.COMPONENT_ENVIRONMENT; 26 | } 27 | 28 | @Override 29 | public Object getContainerProvider() { 30 | return new CraftingResourceHolder<>(TileEnvironmentHatch.this); 31 | } 32 | }; 33 | } 34 | 35 | @Override 36 | public boolean consume(RequirementEnvironment.RT outputToken, boolean doOperation) { 37 | if (outputToken.getType().isMeet(getWorld(), getPos())) { 38 | return true; 39 | } 40 | outputToken.setError("craftcheck.failure." + STRING_RESOURCE_ENVIRONMENT + "." + outputToken.getType().getName()); 41 | return false; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/envtypes/EnvAltitude.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes; 2 | 3 | import net.minecraft.client.resources.I18n; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraft.world.World; 6 | 7 | import java.util.Collections; 8 | import java.util.List; 9 | 10 | public class EnvAltitude implements EnvironmentType { 11 | public final String KEY_TOOLTIP_ALTITUDE = "tooltips.gugu-utils.environment.altitude"; 12 | private final int begin; 13 | private final int end; 14 | 15 | public EnvAltitude(int begin, int end) { 16 | this.begin = begin; 17 | this.end = end; 18 | } 19 | 20 | @Override 21 | public boolean isMeet(World world, BlockPos pos) { 22 | return pos.getY() >= begin && pos.getY() <= end; 23 | } 24 | 25 | @Override 26 | public List getTooltip() { 27 | return Collections.singletonList(I18n.format(KEY_TOOLTIP_ALTITUDE, begin, end)); 28 | } 29 | 30 | @Override 31 | public String getName() { 32 | return "altitude"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/envtypes/EnvBoime.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes; 2 | 3 | import com.google.common.collect.ImmutableList; 4 | import com.google.common.collect.Lists; 5 | import net.minecraft.client.resources.I18n; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.world.World; 8 | import net.minecraft.world.biome.Biome; 9 | import net.minecraftforge.common.BiomeManager; 10 | 11 | import java.util.List; 12 | 13 | public class EnvBoime implements EnvironmentType { 14 | private final Biome[] biomes; 15 | private String biomeType; 16 | 17 | public EnvBoime(Biome[] biomes) { 18 | this.biomes = biomes; 19 | } 20 | 21 | public EnvBoime(BiomeManager.BiomeType type) { 22 | ImmutableList entries = BiomeManager.getBiomes(type); 23 | biomeType = type.name(); 24 | if (entries != null) 25 | this.biomes = entries.stream().map(e -> e.biome).toArray(Biome[]::new); 26 | else this.biomes = new Biome[0]; 27 | } 28 | 29 | @Override 30 | public boolean isMeet(World world, BlockPos pos) { 31 | Biome currentBiome = world.provider.getBiomeForCoords(pos); 32 | for (Biome biome : biomes) { 33 | if (biome.equals(currentBiome)) { 34 | return true; 35 | } 36 | } 37 | return false; 38 | } 39 | 40 | @Override 41 | public List getTooltip() { 42 | List result = Lists.newArrayList(I18n.format("tooltips.gugu-utils.environment.biome")); 43 | if (biomeType != null) { 44 | result.add(I18n.format("tooltips.gugu-utils.environment.biome.type", biomeType)); 45 | } 46 | for (Biome biome : biomes) { 47 | result.add(biome.getBiomeName()); 48 | } 49 | return result; 50 | } 51 | @Override 52 | public String getName() { 53 | return "biomes"; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/envtypes/EnvDimension.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes; 2 | 3 | import com.google.common.collect.Lists; 4 | import net.minecraft.client.resources.I18n; 5 | import net.minecraft.util.math.BlockPos; 6 | import net.minecraft.world.DimensionType; 7 | import net.minecraft.world.World; 8 | 9 | import java.util.List; 10 | 11 | public class EnvDimension implements EnvironmentType { 12 | private final int[] dimensions; 13 | 14 | public EnvDimension(int[] dimension) { 15 | this.dimensions = dimension; 16 | } 17 | 18 | @Override 19 | public boolean isMeet(World world, BlockPos pos) { 20 | int currentDim = world.provider.getDimension(); 21 | for (int dim : dimensions) { 22 | if (dim == currentDim) { 23 | return true; 24 | } 25 | } 26 | return false; 27 | } 28 | 29 | @Override 30 | public List getTooltip() { 31 | List result = Lists.newArrayList(I18n.format("tooltips.gugu-utils.environment.dimension")); 32 | for (int dim : dimensions) { 33 | result.add(DimensionType.getById(dim).getName()); 34 | } 35 | return result; 36 | } 37 | 38 | @Override 39 | public String getName() { 40 | return "dimensions"; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/envtypes/EnvMoonPhase.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes; 2 | 3 | import com.google.common.collect.Lists; 4 | import net.minecraft.client.resources.I18n; 5 | import net.minecraft.util.math.BlockPos; 6 | import net.minecraft.world.World; 7 | 8 | import java.util.List; 9 | 10 | public class EnvMoonPhase implements EnvironmentType { 11 | private final int[] phases; 12 | 13 | public EnvMoonPhase(int[] phases) { 14 | this.phases = phases; 15 | } 16 | 17 | public int[] getPhases() { 18 | return phases; 19 | } 20 | 21 | @Override 22 | public boolean isMeet(World world, BlockPos pos) { 23 | int currentPhase = world.provider.getMoonPhase(world.getWorldTime()); 24 | if (!world.isDaytime()) 25 | for (int phase : phases) { 26 | if (currentPhase == phase) { 27 | return true; 28 | } 29 | } 30 | return false; 31 | } 32 | 33 | @Override 34 | public List getTooltip() { 35 | List result = Lists.newArrayList(I18n.format("tooltips.gugu-utils.environment.moonphase.desc")); 36 | for (int phase : phases) { 37 | result.add(I18n.format("tooltips.gugu-utils.environment.moonphase." + phase)); 38 | } 39 | return result; 40 | } 41 | 42 | @Override 43 | public String getName() { 44 | return "moonphase"; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/envtypes/EnvTime.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes; 2 | 3 | import net.minecraft.client.resources.I18n; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraft.world.World; 6 | 7 | import java.util.Collections; 8 | import java.util.List; 9 | 10 | public class EnvTime implements EnvironmentType { 11 | private final int begin; 12 | private final int end; 13 | 14 | public EnvTime(int begin, int end) { 15 | this.begin = begin; 16 | this.end = end; 17 | 18 | } 19 | 20 | public static String translateTime(int time) { 21 | int hour = (time / 1000 + 6) % 24; 22 | int minute = (int) (((double) (time % 1000)) * 60 / 1000); 23 | return String.format("%d:%02d", hour, minute); 24 | } 25 | 26 | @Override 27 | public boolean isMeet(World world, BlockPos pos) { 28 | int time = (int) (world.getWorldTime() % 24000); 29 | if (begin <= end) { 30 | return time >= begin && time <= end; 31 | } else { 32 | return time >= begin || time <= end; 33 | } 34 | } 35 | 36 | @Override 37 | public List getTooltip() { 38 | return Collections.singletonList(I18n.format("tooltips.gugu-utils.environment.time", translateTime(begin), translateTime(end))); 39 | } 40 | 41 | @Override 42 | public String getName() { 43 | return "time"; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/envtypes/EnvWeather.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes; 2 | 3 | import net.minecraft.client.resources.I18n; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraft.world.World; 6 | import net.minecraft.world.storage.WorldInfo; 7 | import stanhebben.zenscript.annotations.ZenClass; 8 | 9 | import java.util.Collections; 10 | import java.util.List; 11 | import java.util.Locale; 12 | 13 | public class EnvWeather implements EnvironmentType { 14 | public Weathers getWeather() { 15 | return weather; 16 | } 17 | 18 | private final Weathers weather; 19 | 20 | public EnvWeather(Weathers weather) { 21 | this.weather = weather; 22 | } 23 | 24 | @Override 25 | public boolean isMeet(World world, BlockPos pos) { 26 | WorldInfo info = world.getWorldInfo(); 27 | switch (weather) { 28 | case SUNNY: 29 | return !info.isRaining() && !info.isThundering(); 30 | case RAINING: 31 | return info.isRaining(); 32 | case SNOWING: 33 | return (info.isRaining() || info.isThundering()) && world.canSnowAt(pos, false); 34 | case THUNDERING: 35 | return info.isThundering(); 36 | } 37 | return false; 38 | } 39 | 40 | @Override 41 | public List getTooltip() { 42 | return Collections.singletonList(I18n.format("tooltips.gugu-utils.environment.weather." + weather.name().toLowerCase(Locale.ROOT))); 43 | } 44 | 45 | @Override 46 | public String getName() { 47 | return "weather"; 48 | } 49 | 50 | @ZenClass 51 | public enum Weathers { 52 | SUNNY, 53 | RAINING, 54 | SNOWING, 55 | THUNDERING 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/environment/envtypes/EnvironmentType.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.environment.envtypes; 2 | 3 | import net.minecraft.util.math.BlockPos; 4 | import net.minecraft.world.World; 5 | 6 | import java.util.List; 7 | 8 | public interface EnvironmentType { 9 | boolean isMeet(World world, BlockPos pos); 10 | List getTooltip(); 11 | 12 | String getName(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/hotair/HotAirHatchState.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.hotair; 2 | 3 | import net.minecraft.util.IStringSerializable; 4 | 5 | public enum HotAirHatchState implements IStringSerializable { 6 | OFF("off"), 7 | ON("on"); 8 | 9 | // Optimization 10 | public static final HotAirHatchState[] VALUES = HotAirHatchState.values(); 11 | 12 | private final String name; 13 | 14 | HotAirHatchState(String name) { 15 | this.name = name; 16 | } 17 | 18 | @Override 19 | public String getName() { 20 | return name; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/mana/ItemManaBlock.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.mana; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.VariantItem; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.common.IOHatchVariant; 5 | import com.warmthdawn.mod.gugu_utils.tools.ItemNBTUtils; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraft.tileentity.TileEntity; 8 | import vazkii.botania.api.mana.IManaItem; 9 | import vazkii.botania.api.mana.IManaTooltipDisplay; 10 | import vazkii.botania.common.core.helper.ItemNBTHelper; 11 | 12 | import static com.warmthdawn.mod.gugu_utils.common.Constants.NAME_MANA; 13 | 14 | public class ItemManaBlock extends VariantItem implements IManaItem, IManaTooltipDisplay { 15 | private final int maxMana; 16 | 17 | public ItemManaBlock(BlockSparkManaHatch block, int maxMana) { 18 | super(block); 19 | this.maxMana = maxMana; 20 | } 21 | 22 | private static void setMana(ItemStack stack, int mana) { 23 | ItemNBTHelper.setInt(stack, NAME_MANA, mana); 24 | } 25 | 26 | 27 | 28 | @Override 29 | public int getMana(ItemStack stack) { 30 | return ItemNBTUtils.getInt(stack, NAME_MANA, 0); 31 | } 32 | 33 | @Override 34 | public int getMaxMana(ItemStack stack) { 35 | return maxMana; 36 | } 37 | 38 | @Override 39 | public void addMana(ItemStack stack, int mana) { 40 | setMana(stack, Math.min(getMana(stack) + mana, maxMana)); 41 | } 42 | 43 | 44 | @Override 45 | public boolean canReceiveManaFromPool(ItemStack stack, TileEntity pool) { 46 | return this.getMetadata(stack) == IOHatchVariant.INPUT.ordinal(); 47 | } 48 | 49 | @Override 50 | public boolean canReceiveManaFromItem(ItemStack stack, ItemStack otherStack) { 51 | return false; 52 | } 53 | 54 | @Override 55 | public boolean canExportManaToPool(ItemStack stack, TileEntity pool) { 56 | return this.getMetadata(stack) == IOHatchVariant.OUTPUT.ordinal(); 57 | } 58 | 59 | @Override 60 | public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack) { 61 | return false; 62 | } 63 | 64 | @Override 65 | public boolean isNoExport(ItemStack stack) { 66 | return true; 67 | } 68 | 69 | @Override 70 | public float getManaFractionForDisplay(ItemStack stack) { 71 | return 1.0F * this.getMana(stack) / this.maxMana; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/mana/TileSparkManaInputHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.mana; 2 | 3 | import com.warmthdawn.mod.gugu_utils.modularmachenary.MMCompoments; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.components.GenericMachineCompoment; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementMana; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.IConsumable; 7 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 8 | import hellfirepvp.modularmachinery.common.machine.MachineComponent; 9 | import hellfirepvp.modularmachinery.common.tiles.base.MachineComponentTile; 10 | 11 | import javax.annotation.Nullable; 12 | 13 | public class TileSparkManaInputHatch extends TileSparkManaHatch 14 | implements MachineComponentTile, IConsumable { 15 | 16 | 17 | @Override 18 | public boolean canRecieveManaFromBursts() { 19 | return true; 20 | } 21 | 22 | @Nullable 23 | @Override 24 | public MachineComponent provideComponent() { 25 | return new GenericMachineCompoment<>(this, (ComponentType) MMCompoments.COMPONENT_MANA); 26 | } 27 | 28 | @Override 29 | public boolean consume(RequirementMana.RT outputToken, boolean doOperation) { 30 | int consume = Math.min(outputToken.getMana(), this.mana); 31 | outputToken.setMana(outputToken.getMana() - consume); 32 | 33 | if(doOperation) 34 | this.mana -= consume; 35 | return consume > 0; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/mek/laser/BlockMekLaserHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.mek.laser; 2 | 3 | public class BlockMekLaserHatch { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/mek/laser/TileEntityMekLaser.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.mek.laser; 2 | 3 | import mekanism.api.lasers.ILaserReceptor; 4 | 5 | public class TileEntityMekLaser { 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/pressure/ContainerPressureHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.pressure; 2 | 3 | import me.desht.pneumaticcraft.common.inventory.ContainerPneumaticBase; 4 | import net.minecraft.entity.player.InventoryPlayer; 5 | 6 | public class ContainerPressureHatch extends ContainerPneumaticBase { 7 | public ContainerPressureHatch(InventoryPlayer inventoryPlayer, TilePressureHatch te) { 8 | super(te); 9 | addUpgradeSlots(48, 29); 10 | addPlayerSlots(inventoryPlayer, 84); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/pressure/GuiPressureHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.pressure; 2 | 3 | import me.desht.pneumaticcraft.client.gui.GuiPneumaticContainerBase; 4 | import net.minecraft.client.resources.I18n; 5 | import net.minecraft.entity.player.InventoryPlayer; 6 | 7 | import java.awt.*; 8 | 9 | import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; 10 | 11 | public class GuiPressureHatch extends GuiPneumaticContainerBase { 12 | public GuiPressureHatch(InventoryPlayer player, TilePressureHatch te) { 13 | super(new ContainerPressureHatch(player, te), te, me.desht.pneumaticcraft.lib.Textures.GUI_4UPGRADE_SLOTS); 14 | } 15 | 16 | 17 | @Override 18 | protected void drawGuiContainerForegroundLayer(int x, int y) { 19 | super.drawGuiContainerForegroundLayer(x, y); 20 | String containerName = I18n.format(j(te.getName(), "name")); 21 | fontRenderer.drawString(containerName, xSize / 2 - fontRenderer.getStringWidth(containerName) / 2, 6, 4210752); 22 | fontRenderer.drawString("Upgr.", 53, 19, 4210752); 23 | } 24 | 25 | @Override 26 | protected Point getInvNameOffset() { 27 | return null; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/pressure/IUpgradeAcceptorWrapper.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.pressure; 2 | 3 | import me.desht.pneumaticcraft.api.item.IUpgradeAcceptor; 4 | import net.minecraft.item.Item; 5 | 6 | import java.util.Set; 7 | 8 | import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; 9 | 10 | public class IUpgradeAcceptorWrapper implements IUpgradeAcceptor { 11 | private final TilePressureHatch hatch; 12 | 13 | public IUpgradeAcceptorWrapper(TilePressureHatch hatch) { 14 | this.hatch = hatch; 15 | } 16 | 17 | @Override 18 | public Set getApplicableUpgrades() { 19 | return hatch.getApplicableUpgrades(); 20 | } 21 | 22 | @Override 23 | public String getName() { 24 | return j(hatch.getName(), "name"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/pressure/PressureHatchVariant.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.pressure; 2 | 3 | import net.minecraft.util.IStringSerializable; 4 | 5 | import java.util.Locale; 6 | 7 | public enum PressureHatchVariant implements IStringSerializable { 8 | INPUT, 9 | OUTPUT, 10 | ; 11 | @Override 12 | public String getName() { 13 | return name().toLowerCase(Locale.ROOT); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/pressure/TilePressureHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.pressure; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.IGuiProvider; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.IColorableTileEntity; 5 | import me.desht.pneumaticcraft.common.network.DescSynced; 6 | import me.desht.pneumaticcraft.common.tileentity.TileEntityPneumaticBase; 7 | import me.desht.pneumaticcraft.lib.PneumaticValues; 8 | import net.minecraft.client.gui.GuiScreen; 9 | import net.minecraft.entity.player.EntityPlayer; 10 | import net.minecraft.inventory.Container; 11 | import net.minecraft.nbt.NBTTagCompound; 12 | import net.minecraftforge.fml.relauncher.Side; 13 | import net.minecraftforge.fml.relauncher.SideOnly; 14 | 15 | public class TilePressureHatch extends TileEntityPneumaticBase implements IGuiProvider, IColorableTileEntity { 16 | public static final String KEY_MACHINE_COLOR = "machine_color"; 17 | 18 | @DescSynced 19 | protected int machineColor = hellfirepvp.modularmachinery.common.data.Config.machineColor; 20 | 21 | public TilePressureHatch() { 22 | super(PneumaticValues.DANGER_PRESSURE_TIER_TWO, PneumaticValues.MAX_PRESSURE_TIER_TWO, 16000, 4); 23 | } 24 | 25 | @Override 26 | public Container createContainer(EntityPlayer player) { 27 | return new ContainerPressureHatch(player.inventory, this); 28 | } 29 | 30 | @Override 31 | @SideOnly(Side.CLIENT) 32 | public GuiScreen createGui(EntityPlayer player) { 33 | return new GuiPressureHatch(player.inventory, this); 34 | } 35 | 36 | @Override 37 | public int getMachineColor() { 38 | return this.machineColor; 39 | } 40 | 41 | @Override 42 | public void setMachineColor(int newColor) { 43 | this.machineColor = newColor; 44 | } 45 | 46 | @Override 47 | public void readFromNBT(NBTTagCompound tag) { 48 | super.readFromNBT(tag); 49 | if (tag.hasKey(KEY_MACHINE_COLOR)) 50 | this.machineColor = tag.getInteger(KEY_MACHINE_COLOR); 51 | } 52 | 53 | @Override 54 | public NBTTagCompound writeToNBT(NBTTagCompound tag) { 55 | super.writeToNBT(tag); 56 | tag.setInteger(KEY_MACHINE_COLOR, this.getMachineColor()); 57 | return tag; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/pressure/TilePressureOutputHatch.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.pressure; 2 | 3 | 4 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.MMCompoments; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.components.GenericMachineCompoment; 7 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementCompressedAir; 8 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.IGeneratable; 9 | import hellfirepvp.modularmachinery.common.crafting.ComponentType; 10 | import hellfirepvp.modularmachinery.common.machine.MachineComponent; 11 | import hellfirepvp.modularmachinery.common.tiles.base.MachineComponentTile; 12 | import me.desht.pneumaticcraft.api.tileentity.IAirHandler; 13 | import net.minecraft.util.EnumFacing; 14 | import org.apache.commons.lang3.tuple.Pair; 15 | import org.jetbrains.annotations.Nullable; 16 | 17 | import java.util.List; 18 | 19 | import static com.warmthdawn.mod.gugu_utils.common.Constants.NAME_PRESSUREHATCH; 20 | import static com.warmthdawn.mod.gugu_utils.tools.ResourceUtils.j; 21 | 22 | public class TilePressureOutputHatch extends TilePressureHatch implements 23 | MachineComponentTile, IGeneratable { 24 | public TilePressureOutputHatch() { 25 | addApplicableUpgrade(); 26 | } 27 | @Override 28 | public String getName() { 29 | return j("tile", GuGuUtils.MODID, NAME_PRESSUREHATCH, "output"); 30 | } 31 | 32 | @Nullable 33 | @Override 34 | public MachineComponent provideComponent() { 35 | return new GenericMachineCompoment<>(this, (ComponentType) MMCompoments.COMPONENT_COMPRESSED_AIR); 36 | } 37 | 38 | @Override 39 | public boolean generate(RequirementCompressedAir.RT outputToken, boolean doOperation) { 40 | int air = outputToken.getAir(); 41 | outputToken.setAir(0); 42 | if (doOperation) 43 | addAir(air); 44 | return air > 0; 45 | } 46 | 47 | @Override 48 | public void update() { 49 | super.update(); 50 | //漏气 51 | if (!getWorld().isRemote) { 52 | List> teList = getAirHandler(null).getConnectedPneumatics(); 53 | IAirHandler airHandler = getAirHandler(null); 54 | if (teList.size() == 0){ 55 | airHandler.airLeak(EnumFacing.UP); 56 | } 57 | } 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/RequirementManaPerTick.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements; 2 | 3 | import com.warmthdawn.mod.gugu_utils.jei.components.JEIComponentMana; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.MMCompoments; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.MMRequirements; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 7 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementConsumePerTick; 8 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types.RequirementTypeAdapter; 9 | import hellfirepvp.modularmachinery.common.crafting.helper.RecipeCraftingContext; 10 | import hellfirepvp.modularmachinery.common.machine.IOType; 11 | import hellfirepvp.modularmachinery.common.machine.MachineComponent; 12 | import hellfirepvp.modularmachinery.common.modifier.RecipeModifier; 13 | 14 | import java.util.List; 15 | 16 | import static hellfirepvp.modularmachinery.common.modifier.RecipeModifier.applyModifiers; 17 | 18 | public class RequirementManaPerTick extends RequirementConsumePerTick { 19 | 20 | int _mana; 21 | 22 | public RequirementManaPerTick(int mana, int totalTick, IOType actionType) { 23 | super((RequirementTypeAdapter) MMRequirements.REQUIREMENT_TYPE_MANA_PER_TICK, actionType); 24 | this.setTotalTick(totalTick); 25 | _mana = mana; 26 | } 27 | 28 | public int getMana() { 29 | return _mana; 30 | } 31 | 32 | @Override 33 | protected boolean isCorrectHatch(MachineComponent component) { 34 | return component.getComponentType().equals(MMCompoments.COMPONENT_MANA); 35 | } 36 | 37 | @Override 38 | protected RequirementMana.RT emitConsumptionToken(RecipeCraftingContext context) { 39 | return new RequirementMana.RT(_mana); 40 | } 41 | 42 | 43 | @Override 44 | public ComponentRequirementAdapter.PerTick deepClone() { 45 | return new RequirementManaPerTick(_mana, getTotalTick(), getActionType()); 46 | } 47 | 48 | @Override 49 | public ComponentRequirementAdapter.PerTick deepCloneModified(List list) { 50 | return new RequirementManaPerTick((int) applyModifiers(list, this, _mana, false), getTotalTick(), getActionType()); 51 | } 52 | 53 | @Override 54 | public JEIComponent provideJEIComponent() { 55 | return new JEIComponentMana(this.getMana(), true, this.getTotalTick()); 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/basic/IComponentRequirement.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.helper.*; 4 | import hellfirepvp.modularmachinery.common.machine.IOType; 5 | import hellfirepvp.modularmachinery.common.modifier.RecipeModifier; 6 | import hellfirepvp.modularmachinery.common.util.ResultChance; 7 | 8 | import javax.annotation.Nonnull; 9 | import java.util.List; 10 | 11 | public interface IComponentRequirement { 12 | V getRequirementType(); 13 | 14 | IOType getActionType(); 15 | 16 | void setTag(ComponentSelectorTag tag); 17 | 18 | ComponentSelectorTag getTag(); 19 | 20 | int getSortingWeight(); 21 | 22 | boolean isValidComponent(ProcessingComponent var1, RecipeCraftingContext var2); 23 | 24 | boolean startCrafting(ProcessingComponent var1, RecipeCraftingContext var2, ResultChance var3); 25 | 26 | @Nonnull 27 | CraftCheck finishCrafting(ProcessingComponent var1, RecipeCraftingContext var2, ResultChance var3); 28 | 29 | @Nonnull 30 | CraftCheck canStartCrafting(ProcessingComponent var1, RecipeCraftingContext var2, List var3); 31 | 32 | ComponentRequirement deepCopy(); 33 | 34 | ComponentRequirement deepCopyModified(List var1); 35 | 36 | void startRequirementCheck(ResultChance var1, RecipeCraftingContext var2); 37 | 38 | void endRequirementCheck(); 39 | 40 | @Nonnull 41 | String getMissingComponentErrorMessage(IOType var1); 42 | 43 | hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement.JEIComponent provideJEIComponent(); 44 | 45 | } -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/basic/IConsumable.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic; 2 | 3 | public interface IConsumable { 4 | boolean consume(T outputToken, boolean doOperation); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/basic/ICraftNotifier.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic; 2 | 3 | public interface ICraftNotifier { 4 | default void startCrafting(T outputToken) { 5 | 6 | } 7 | default void finishCrafting(T outputToken) { 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/basic/ICraftingResourceHolder.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic; 2 | 3 | public interface ICraftingResourceHolder { 4 | boolean consume(V outputToken, boolean doOperation); 5 | boolean canConsume(); 6 | 7 | boolean generate(V outputToken, boolean doOperation); 8 | boolean canGenerate(); 9 | 10 | String getInputProblem(V checkToken); 11 | 12 | String getOutputProblem(V checkToken); 13 | 14 | void startCrafting(V outputToken); 15 | void finishCrafting(V outputToken); 16 | 17 | boolean isFulfilled(); 18 | void setFulfilled(boolean value); 19 | 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/basic/IGeneratable.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic; 2 | 3 | public interface IGeneratable { 4 | boolean generate(T outputToken, boolean doOperation); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/basic/IResourceToken.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic; 2 | 3 | import hellfirepvp.modularmachinery.common.crafting.requirement.type.RequirementType; 4 | import hellfirepvp.modularmachinery.common.machine.IOType; 5 | import hellfirepvp.modularmachinery.common.modifier.RecipeModifier; 6 | 7 | import java.util.Collection; 8 | 9 | public interface IResourceToken { 10 | void applyModifiers(Collection modifiers, RequirementType type, IOType ioType, float durationMultiplier); 11 | 12 | default void applyModifiers(Collection modifiers, RequirementType type, IOType ioType) { 13 | applyModifiers(modifiers, type, ioType, 1.0f); 14 | } 15 | 16 | String getKey(); 17 | 18 | default String getError() { 19 | return null; 20 | } 21 | 22 | 23 | boolean isEmpty(); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeAdapter.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 5 | import hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement; 6 | import hellfirepvp.modularmachinery.common.crafting.requirement.type.RequirementType; 7 | import hellfirepvp.modularmachinery.common.machine.IOType; 8 | 9 | public abstract class RequirementTypeAdapter extends RequirementType>> { 10 | 11 | public abstract ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject); 12 | 13 | @Override 14 | public ComponentRequirement createRequirement(IOType ioType, JsonObject jsonObject) { 15 | if (this instanceof PerTick) { 16 | return ((PerTick) this).gererateRequirementPerTick(ioType, jsonObject); 17 | } 18 | return gererateRequirement(ioType, jsonObject); 19 | } 20 | 21 | 22 | public interface PerTick { 23 | ComponentRequirementAdapter.PerTick gererateRequirementPerTick(IOType ioType, JsonObject jsonObject); 24 | 25 | default ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject) { 26 | throw new UnsupportedOperationException("Pertick opeartion not support this!"); 27 | } 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeAspect.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonParseException; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementAspect; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementAspectOutput; 7 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 8 | import hellfirepvp.modularmachinery.common.crafting.helper.ComponentRequirement; 9 | import hellfirepvp.modularmachinery.common.machine.IOType; 10 | import thaumcraft.api.aspects.Aspect; 11 | 12 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 13 | 14 | public class RequirementTypeAspect extends RequirementTypeAdapter implements RequirementTypeAdapter.PerTick { 15 | @Override 16 | public ComponentRequirementAdapter.PerTick gererateRequirementPerTick(IOType type, JsonObject obj) { 17 | throw new UnsupportedOperationException("Not support this!"); 18 | } 19 | 20 | @Override 21 | public ComponentRequirementAdapter gererateRequirement(IOType type, JsonObject obj) { 22 | throw new UnsupportedOperationException("Not support this!"); 23 | } 24 | 25 | @Override 26 | public ComponentRequirement createRequirement(IOType type, JsonObject obj) { 27 | String aspectType = tryGet(obj, "aspect", true).getAsString(); 28 | int aspectAmount = tryGet(obj, "amount", true).getAsInt(); 29 | Aspect aspect = Aspect.getAspect(aspectType); 30 | if (aspect == null) { 31 | throw new JsonParseException("Aspcet Invaild"); 32 | } 33 | if (type == IOType.INPUT) { 34 | return RequirementAspect.createInput(aspectAmount, aspect); 35 | } 36 | return new RequirementAspectOutput(aspectAmount, aspect); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeAura.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonPrimitive; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementAura; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 7 | import hellfirepvp.modularmachinery.common.machine.IOType; 8 | 9 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 10 | 11 | public class RequirementTypeAura extends RequirementTypeAdapter implements RequirementTypeAdapter.PerTick { 12 | @Override 13 | public ComponentRequirementAdapter.PerTick gererateRequirementPerTick(IOType ioType, JsonObject obj) { 14 | JsonPrimitive time = tryGet(obj, "time", true); 15 | JsonPrimitive isForce = tryGet(obj, "force", false); 16 | return new RequirementAura(tryGet(obj, "aura", true).getAsInt(), time.getAsInt(), isForce != null && isForce.getAsBoolean(), ioType); 17 | } 18 | 19 | @Override 20 | public ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject) { 21 | throw new UnsupportedOperationException("Pertick opeartion not support this!"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeCompressedAir.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonPrimitive; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementCompressedAir; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 7 | import hellfirepvp.modularmachinery.common.machine.IOType; 8 | 9 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 10 | 11 | public class RequirementTypeCompressedAir extends RequirementTypeAdapter { 12 | @Override 13 | public ComponentRequirementAdapter gererateRequirement(IOType type, JsonObject obj) { 14 | int air = 0; 15 | float pressure = 0f; 16 | if (type == IOType.INPUT) { 17 | JsonPrimitive airInput = tryGet(obj, "air", false); 18 | if (airInput != null) { 19 | air = airInput.getAsInt(); 20 | } 21 | pressure = tryGet(obj, "pressure", true).getAsFloat(); 22 | } else { 23 | air = tryGet(obj, "air", true).getAsInt(); 24 | } 25 | return new RequirementCompressedAir(pressure, air, type); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeCompressedAirPerTick.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonPrimitive; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementCompressedAirPerTick; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 7 | import hellfirepvp.modularmachinery.common.machine.IOType; 8 | 9 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 10 | 11 | public class RequirementTypeCompressedAirPerTick extends RequirementTypeAdapter implements RequirementTypeAdapter.PerTick { 12 | @Override 13 | public ComponentRequirementAdapter.PerTick gererateRequirementPerTick(IOType type, JsonObject obj) { 14 | 15 | float pressure = 0f; 16 | int air = 0; 17 | if (type == IOType.INPUT) { 18 | JsonPrimitive airInput = tryGet(obj, "air", false); 19 | pressure = tryGet(obj, "pressure", true).getAsFloat(); 20 | if (airInput != null) { 21 | air = airInput.getAsInt(); 22 | } 23 | } else { 24 | air = tryGet(obj, "air", true).getAsInt(); 25 | } 26 | int time = tryGet(obj, "time", true).getAsInt(); 27 | return new RequirementCompressedAirPerTick(pressure, time, air, type); 28 | } 29 | 30 | @Override 31 | public ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject) { 32 | throw new UnsupportedOperationException("Pertick opeartion not support this!"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeEmber.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementEmber; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 6 | import hellfirepvp.modularmachinery.common.machine.IOType; 7 | 8 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 9 | 10 | public class RequirementTypeEmber extends RequirementTypeAdapter{ 11 | @Override 12 | public ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject) { 13 | return new RequirementEmber(tryGet(jsonObject, "ember", true).getAsDouble(), ioType); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeHotAir.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementHotAir; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 6 | import hellfirepvp.modularmachinery.common.machine.IOType; 7 | 8 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 9 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGetInt; 10 | 11 | public class RequirementTypeHotAir extends RequirementTypeAdapter implements RequirementTypeAdapter.PerTick { 12 | 13 | @Override 14 | public ComponentRequirementAdapter.PerTick gererateRequirementPerTick(IOType ioType, JsonObject jsonObject) { 15 | if (ioType == IOType.OUTPUT) { 16 | return new RequirementHotAir(0, tryGetInt(jsonObject, "maxTemperature", null), 0, ioType); 17 | } 18 | return new RequirementHotAir(tryGetInt(jsonObject, "minTemperature", 0), tryGetInt(jsonObject, "maxTemperature", 0), tryGetInt(jsonObject, "consume", null), ioType); 19 | } 20 | 21 | @Override 22 | public ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject) { 23 | throw new UnsupportedOperationException("Pertick opeartion not support this!"); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeMana.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementMana; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 6 | import hellfirepvp.modularmachinery.common.machine.IOType; 7 | 8 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 9 | 10 | public class RequirementTypeMana extends RequirementTypeAdapter { 11 | @Override 12 | public ComponentRequirementAdapter gererateRequirement(IOType type, JsonObject obj) { 13 | 14 | return new RequirementMana(tryGet(obj, "mana", true).getAsInt(), type); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeManaPerTick.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonPrimitive; 5 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementManaPerTick; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 7 | import hellfirepvp.modularmachinery.common.machine.IOType; 8 | 9 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 10 | 11 | public class RequirementTypeManaPerTick extends RequirementTypeAdapter implements RequirementTypeAdapter.PerTick { 12 | @Override 13 | public ComponentRequirementAdapter.PerTick gererateRequirementPerTick(IOType type, JsonObject obj) { 14 | JsonPrimitive time = tryGet(obj, "time", true); 15 | return new RequirementManaPerTick(tryGet(obj, "mana", true).getAsInt(), time == null ? 1 : time.getAsInt(), type); 16 | 17 | } 18 | 19 | @Override 20 | public ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject) { 21 | throw new UnsupportedOperationException("Pertick opeartion not support this!"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/requirements/types/RequirementTypeStarlight.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.types; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.google.gson.JsonPrimitive; 5 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 6 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementStarlight; 7 | import com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.ComponentRequirementAdapter; 8 | import hellfirepvp.astralsorcery.common.constellation.ConstellationRegistry; 9 | import hellfirepvp.astralsorcery.common.constellation.IConstellation; 10 | import hellfirepvp.modularmachinery.common.machine.IOType; 11 | 12 | import static com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.basic.RequirementUtils.tryGet; 13 | 14 | public class RequirementTypeStarlight extends RequirementTypeAdapter implements RequirementTypeAdapter.PerTick{ 15 | @Override 16 | public ComponentRequirementAdapter.PerTick gererateRequirementPerTick(IOType type, JsonObject obj) { 17 | JsonPrimitive constellationStr = tryGet(obj, "constellation", false); 18 | IConstellation constellation = null; 19 | if(constellationStr != null && constellationStr.isString()){ 20 | constellation = ConstellationRegistry.getConstellationByName(constellationStr.getAsString()); 21 | if(constellation == null){ 22 | GuGuUtils.logger.warn("Couldn't find constellation " + constellationStr.getAsString()); 23 | } 24 | } 25 | return new RequirementStarlight(tryGet(obj, "starlight", true).getAsInt(), constellation, type); 26 | } 27 | 28 | @Override 29 | public ComponentRequirementAdapter gererateRequirement(IOType ioType, JsonObject jsonObject) { 30 | throw new UnsupportedOperationException("Pertick opeartion not support this!"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/starlight/StarlightHatchVariant.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.starlight; 2 | 3 | import net.minecraft.util.IStringSerializable; 4 | 5 | import java.util.Locale; 6 | 7 | public enum StarlightHatchVariant implements IStringSerializable { 8 | BASIC, 9 | TRAIT, 10 | BRILLIANT 11 | ; 12 | 13 | @Override 14 | public String getName() { 15 | return name().toLowerCase(Locale.ROOT); 16 | } 17 | 18 | public int getStarlightMaxStorage() { 19 | return 1000 * (2 << (this.ordinal() * 2)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/tweak/MMRecipeFailureActions.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.tweak; 2 | 3 | import com.warmthdawn.mod.gugu_utils.config.GuGuUtilsConfig; 4 | import net.minecraft.util.ResourceLocation; 5 | 6 | import java.util.HashMap; 7 | import java.util.Map; 8 | 9 | public class MMRecipeFailureActions { 10 | public enum Type { 11 | RESET("reset"), 12 | STILL("still"), 13 | DECREASE("decrease"); 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | private final String name; 20 | 21 | Type(String name) { 22 | this.name = name; 23 | } 24 | 25 | public static final Type[] VALUES = Type.values(); 26 | public static final HashMap NAME_MAP; 27 | 28 | static { 29 | NAME_MAP = new HashMap<>(VALUES.length); 30 | for (Type value : VALUES) { 31 | NAME_MAP.put(value.name, value); 32 | } 33 | } 34 | } 35 | 36 | private static final Map REGISTRY_FAILURE_ACTIONS = new HashMap<>(); 37 | private static Type _default; 38 | 39 | public static Type getDefault() { 40 | if (_default == null) { 41 | _default = Type.NAME_MAP.get(GuGuUtilsConfig.Core.DEFAULT_RECIPE_FAILURE_ACTION); 42 | if (_default == null) { 43 | _default = Type.RESET; 44 | } 45 | } 46 | return _default; 47 | } 48 | 49 | public static Type getFailureAction(ResourceLocation key) { 50 | Type type = REGISTRY_FAILURE_ACTIONS.get(key); 51 | if (type == null) { 52 | return getDefault(); 53 | } 54 | return type; 55 | } 56 | 57 | public static void addFailureAction(ResourceLocation key, Type action) { 58 | REGISTRY_FAILURE_ACTIONS.put(key, action); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/modularmachenary/vanilla/OutputPortState.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.modularmachenary.vanilla; 2 | 3 | import net.minecraft.util.IStringSerializable; 4 | 5 | public enum OutputPortState implements IStringSerializable { 6 | OFF("off"), 7 | OUTPUTING("outputing"), 8 | CONNECTED("connected"); 9 | 10 | // Optimization 11 | public static final OutputPortState[] VALUES = OutputPortState.values(); 12 | 13 | private final String name; 14 | 15 | OutputPortState(String name) { 16 | this.name = name; 17 | } 18 | 19 | @Override 20 | public String getName() { 21 | return name; 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/network/Messages.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.network; 2 | 3 | import com.warmthdawn.mod.gugu_utils.common.Enables; 4 | import net.minecraftforge.fml.common.network.NetworkRegistry; 5 | import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; 6 | import net.minecraftforge.fml.relauncher.Side; 7 | 8 | public class Messages { 9 | public static SimpleNetworkWrapper INSTANCE; 10 | 11 | private static int ID = 0; 12 | 13 | private static int nextID() { 14 | return ID++; 15 | } 16 | 17 | public static void registerMessages(String channelName) { 18 | INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel(channelName); 19 | 20 | // Server side 21 | INSTANCE.registerMessage(PacketSetContainerSlot.Handler.class, PacketSetContainerSlot.class, nextID(), Side.SERVER); 22 | 23 | 24 | // Client side 25 | if (Enables.ASTRAL_SORCERY) 26 | INSTANCE.registerMessage(PacketStarlight.Handler.class, PacketStarlight.class, nextID(), Side.CLIENT); 27 | if (Enables.BOTANIA) { 28 | INSTANCE.registerMessage(PacketCollectorPostion.Handler.class, PacketCollectorPostion.class, nextID(), Side.CLIENT); 29 | INSTANCE.registerMessage(PacketMana.Handler.class, PacketMana.class, nextID(), Side.CLIENT); 30 | } 31 | INSTANCE.registerMessage(PacketParticles.Handler.class, PacketParticles.class, nextID(), Side.CLIENT); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/network/PacketMana.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.network; 2 | 3 | import com.warmthdawn.mod.gugu_utils.GuGuUtils; 4 | import com.warmthdawn.mod.gugu_utils.modularmachenary.mana.TileSparkManaHatch; 5 | import io.netty.buffer.ByteBuf; 6 | import net.minecraft.entity.player.EntityPlayer; 7 | import net.minecraft.tileentity.TileEntity; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 10 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 11 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 12 | 13 | public class PacketMana implements IMessage { 14 | private int mana; 15 | 16 | 17 | private int bx; 18 | private int by; 19 | private int bz; 20 | 21 | public PacketMana() { 22 | 23 | } 24 | 25 | public PacketMana(BlockPos pos, int data) { 26 | this.mana = data; 27 | this.bx = pos.getX(); 28 | this.by = pos.getY(); 29 | this.bz = pos.getZ(); 30 | } 31 | 32 | @Override 33 | public void fromBytes(ByteBuf buf) { 34 | mana = buf.readInt(); 35 | 36 | bx = buf.readInt(); 37 | by = buf.readInt(); 38 | bz = buf.readInt(); 39 | } 40 | 41 | @Override 42 | public void toBytes(ByteBuf buf) { 43 | buf.writeInt(mana); 44 | 45 | buf.writeInt(bx); 46 | buf.writeInt(by); 47 | buf.writeInt(bz); 48 | } 49 | 50 | public int getMana() { 51 | return mana; 52 | } 53 | 54 | public BlockPos getPos() { 55 | return new BlockPos(bx, by, bz); 56 | } 57 | 58 | public static class Handler implements IMessageHandler { 59 | 60 | @Override 61 | public IMessage onMessage(PacketMana message, MessageContext ctx) { 62 | GuGuUtils.proxy.addScheduledTaskClient(() -> handle(message, ctx)); 63 | return null; 64 | } 65 | 66 | private void handle(PacketMana message, MessageContext ctx) { 67 | EntityPlayer player = GuGuUtils.proxy.getClientPlayer(); 68 | TileEntity te = player.world.getTileEntity(message.getPos()); 69 | if (te instanceof TileSparkManaHatch) { 70 | ((TileSparkManaHatch) te).sync(message.getMana()); 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/network/PacketSetContainerSlot.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.network; 2 | 3 | import io.netty.buffer.ByteBuf; 4 | import net.minecraft.entity.player.EntityPlayerMP; 5 | import net.minecraft.inventory.Slot; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraftforge.fml.common.network.ByteBufUtils; 8 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 9 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 10 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 11 | 12 | public class PacketSetContainerSlot implements IMessage { 13 | public PacketSetContainerSlot() { 14 | } 15 | 16 | public PacketSetContainerSlot(int containerSlot, ItemStack stack) { 17 | this.containerSlot = containerSlot; 18 | this.stack = stack; 19 | } 20 | 21 | private int containerSlot; 22 | private ItemStack stack; 23 | 24 | @Override 25 | public void fromBytes(ByteBuf buf) { 26 | containerSlot = buf.readInt(); 27 | stack = ByteBufUtils.readItemStack(buf); 28 | } 29 | 30 | @Override 31 | public void toBytes(ByteBuf buf) { 32 | buf.writeInt(containerSlot); 33 | ByteBufUtils.writeItemStack(buf, stack); 34 | } 35 | 36 | public static class Handler implements IMessageHandler { 37 | 38 | @Override 39 | public IMessage onMessage(PacketSetContainerSlot message, MessageContext ctx) { 40 | final EntityPlayerMP player = ctx.getServerHandler().player; 41 | player.getServerWorld().addScheduledTask(() -> { 42 | if (message.stack.isEmpty() || message.stack.getCount() > message.stack.getMaxStackSize()) { 43 | return; 44 | } 45 | if (player.openContainer != null) { 46 | if (message.containerSlot >= 0 && message.containerSlot < player.openContainer.inventorySlots.size()) { 47 | Slot slot = player.openContainer.getSlot(message.containerSlot); 48 | slot.putStack(message.stack); 49 | slot.onSlotChanged(); 50 | } 51 | } 52 | }); 53 | 54 | return null; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/proxy/ClientProxy.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.proxy; 2 | 3 | import com.google.common.util.concurrent.ListenableFuture; 4 | import com.warmthdawn.mod.gugu_utils.ModBlocks; 5 | import com.warmthdawn.mod.gugu_utils.ModItems; 6 | import com.warmthdawn.mod.gugu_utils.client.particle.ParticleEnergyBall; 7 | import com.warmthdawn.mod.gugu_utils.common.Enables; 8 | import com.warmthdawn.mod.gugu_utils.modularmachenary.vanilla.TESREnergyOutputPort; 9 | import com.warmthdawn.mod.gugu_utils.modularmachenary.vanilla.TileEnergyOutputPort; 10 | import net.minecraft.client.Minecraft; 11 | import net.minecraft.entity.player.EntityPlayer; 12 | import net.minecraftforge.client.event.ModelRegistryEvent; 13 | import net.minecraftforge.client.event.TextureStitchEvent; 14 | import net.minecraftforge.fml.client.registry.ClientRegistry; 15 | import net.minecraftforge.fml.common.Mod; 16 | import net.minecraftforge.fml.common.event.FMLInitializationEvent; 17 | import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; 18 | import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; 19 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 20 | import net.minecraftforge.fml.relauncher.Side; 21 | 22 | @Mod.EventBusSubscriber(Side.CLIENT) 23 | public class ClientProxy extends CommonProxy { 24 | 25 | @SubscribeEvent 26 | public static void registerModels(ModelRegistryEvent event) { 27 | ModBlocks.initModels(); 28 | ModItems.initModels(); 29 | } 30 | 31 | @SubscribeEvent 32 | public static void stitcherEventPre(TextureStitchEvent.Pre event) { 33 | event.getMap().registerSprite(ParticleEnergyBall.TEXTURE); 34 | } 35 | 36 | @Override 37 | public void preInit(FMLPreInitializationEvent event) { 38 | super.preInit(event); 39 | } 40 | 41 | @Override 42 | public void init(FMLInitializationEvent event) { 43 | super.init(event); 44 | 45 | if (Enables.MODULAR_MACHIENARY) { 46 | ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyOutputPort.class, new TESREnergyOutputPort()); 47 | ModBlocks.registerDynamicColor(); 48 | } 49 | 50 | } 51 | 52 | @Override 53 | public void postInit(FMLPostInitializationEvent event) { 54 | super.postInit(event); 55 | } 56 | 57 | @Override 58 | public ListenableFuture addScheduledTaskClient(Runnable runnableToSchedule) { 59 | return Minecraft.getMinecraft().addScheduledTask(runnableToSchedule); 60 | } 61 | 62 | @Override 63 | public EntityPlayer getClientPlayer() { 64 | return Minecraft.getMinecraft().player; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/proxy/ServerProxy.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.proxy; 2 | 3 | public class ServerProxy extends CommonProxy { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/psi/PsiCompact.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.psi; 2 | 3 | import com.warmthdawn.mod.gugu_utils.config.GuGuUtilsConfig; 4 | import vazkii.psi.api.PsiAPI; 5 | import vazkii.psi.api.spell.Spell; 6 | import vazkii.psi.api.spell.SpellPiece; 7 | import vazkii.psi.common.lib.LibPieceGroups; 8 | import vazkii.psi.common.spell.base.ModSpellPieces; 9 | 10 | public class PsiCompact { 11 | private static final String TRICK_ACCELERATE = "trickAccelerate"; 12 | private static ModSpellPieces.PieceContainer trickAccelerate; 13 | 14 | 15 | public static void initSpell() { 16 | if (GuGuUtilsConfig.Tweaks.ENABLE_ACCELATE_TRICK) 17 | trickAccelerate = register(PieceTrickAccelerate.class, TRICK_ACCELERATE, LibPieceGroups.EIDOS_REVERSAL); 18 | } 19 | 20 | public static ModSpellPieces.PieceContainer register(Class clazz, String name, String group) { 21 | return register(clazz, name, group, false); 22 | } 23 | 24 | public static ModSpellPieces.PieceContainer register(Class clazz, String name, String group, boolean main) { 25 | PsiAPI.registerSpellPieceAndTexture(name, clazz); 26 | PsiAPI.addPieceToGroup(clazz, group, main); 27 | return (Spell s) -> SpellPiece.create(clazz, s); 28 | } 29 | 30 | public interface PieceContainer { 31 | SpellPiece get(Spell s); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/tools/ResourceUtils.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.tools; 2 | 3 | public final class ResourceUtils { 4 | 5 | public static final String TOOLTIP_PREFIX = "message"; 6 | 7 | public static String j(String... args) { 8 | return String.join(".", args); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/warmthdawn/mod/gugu_utils/tools/StackUtils.java: -------------------------------------------------------------------------------- 1 | package com.warmthdawn.mod.gugu_utils.tools; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fluids.Fluid; 5 | import net.minecraftforge.fluids.FluidStack; 6 | import net.minecraftforge.fluids.capability.CapabilityFluidHandler; 7 | import net.minecraftforge.fluids.capability.IFluidHandlerItem; 8 | import net.minecraftforge.items.ItemHandlerHelper; 9 | 10 | public final class StackUtils { 11 | public static FluidResult getFluid(ItemStack stack, boolean simulate) { 12 | // We won't have the capability on stacks with size bigger than 1. 13 | if (stack.getCount() > 1) { 14 | stack = ItemHandlerHelper.copyStackWithSize(stack, 1); 15 | } 16 | 17 | if (stack.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null)) { 18 | IFluidHandlerItem fluidHandler = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY, null); 19 | 20 | FluidStack result = fluidHandler.drain(Fluid.BUCKET_VOLUME, !simulate); 21 | 22 | return new FluidResult(fluidHandler.getContainer(), result); 23 | } 24 | 25 | return new FluidResult(ItemStack.EMPTY, null); 26 | } 27 | 28 | 29 | public static class FluidResult { 30 | public ItemStack getContainer() { 31 | return container; 32 | } 33 | 34 | public void setContainer(ItemStack container) { 35 | this.container = container; 36 | } 37 | 38 | public FluidStack getFluidStack() { 39 | return fluidStack; 40 | } 41 | 42 | public void setFluidStack(FluidStack fluidStack) { 43 | this.fluidStack = fluidStack; 44 | } 45 | 46 | private ItemStack container; 47 | private FluidStack fluidStack; 48 | public FluidResult(ItemStack container, FluidStack fluidStack) { 49 | this.container = container; 50 | this.fluidStack = fluidStack; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/gugu_at.cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/META-INF/gugu_at.cfg -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/aspecthatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "variant=input": { 4 | "model": "gugu-utils:aspectinputhatch" 5 | }, 6 | "variant=output": { 7 | "model": "gugu-utils:aspectoutputhatch" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/aspectinputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "modularmachinery:blockmodel_overlay_all", 5 | "textures": { 6 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 7 | "ov_all": "gugu-utils:blocks/overlay_aspectinputhatch" 8 | } 9 | }, 10 | "variants": { 11 | "normal": [ 12 | {} 13 | ], 14 | "inventory": [ 15 | {} 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/aurainputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "modularmachinery:blockmodel_overlay_all", 5 | "textures": { 6 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 7 | "ov_all": "gugu-utils:blocks/overlay_aurainputhatch" 8 | } 9 | }, 10 | "variants": { 11 | "normal": [ 12 | {} 13 | ], 14 | "inventory": [ 15 | {} 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/emberinputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "variant=tiny": { 4 | "model": "gugu-utils:emberinputhatch_tiny" 5 | }, 6 | "variant=small": { 7 | "model": "gugu-utils:emberinputhatch_small" 8 | }, 9 | "variant=medium": { 10 | "model": "gugu-utils:emberinputhatch_medium" 11 | }, 12 | "variant=reinforced": { 13 | "model": "gugu-utils:emberinputhatch_reinforced" 14 | }, 15 | "variant=big": { 16 | "model": "gugu-utils:emberinputhatch_big" 17 | }, 18 | "variant=huge": { 19 | "model": "gugu-utils:emberinputhatch_huge" 20 | }, 21 | "variant=ludicrous": { 22 | "model": "gugu-utils:emberinputhatch_ludicrous" 23 | }, 24 | "variant=extreme": { 25 | "model": "gugu-utils:emberinputhatch_extreme" 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/energyoutputport.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "modularmachinery:blockmodel_overlay_orientable_all", 5 | "textures": { 6 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 7 | "ov_top": "gugu-utils:blocks/overlay_energyoutputport", 8 | "ov_front": "gugu-utils:blocks/front_energyoutputport", 9 | "ov_side": "gugu-utils:blocks/overlay_energyoutputport" 10 | } 11 | }, 12 | "variants": { 13 | "normal": [{}], 14 | "inventory": [{}], 15 | "facing": { 16 | "north": {}, 17 | "south": {"y": 180}, 18 | "west": {"y": 270}, 19 | "east": {"y": 90}, 20 | "up": {"x": -90}, 21 | "down": {"x": 90} 22 | }, 23 | "state": { 24 | "off": { 25 | "textures": { 26 | "ov_top": "gugu-utils:blocks/overlay_energyoutputport_off", 27 | "ov_front": "gugu-utils:blocks/front_energyoutputport_off", 28 | "ov_side": "gugu-utils:blocks/overlay_energyoutputport_off" 29 | } 30 | }, 31 | "outputing": {}, 32 | "connected": {} 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/environmenthatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "modularmachinery:blockmodel_overlay_all", 5 | "textures": { 6 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 7 | "ov_all": "gugu-utils:blocks/overlay_environmenthatch" 8 | } 9 | }, 10 | "variants": { 11 | "normal": [ 12 | {} 13 | ], 14 | "inventory": [ 15 | {} 16 | ] 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/hotairinputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "forge_marker": 1, 3 | "defaults": { 4 | "model": "gugu-utils:blockmodel_overlay_column", 5 | "textures": { 6 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 7 | "ov_end": "gugu-utils:blocks/overlay_airinputhatch_end", 8 | "ov_side": "gugu-utils:blocks/overlay_airinputhatch_on" 9 | } 10 | }, 11 | "variants": { 12 | "normal": [{}], 13 | "inventory": [{}], 14 | "state": { 15 | "off": { 16 | "textures": { 17 | "ov_side": "gugu-utils:blocks/overlay_airinputhatch_off" 18 | } 19 | }, 20 | "on": {} 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/overclocking_spreader.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "normal": { 4 | "model": "gugu-utils:spreader_overclocking" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/pressurehatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "variant=input": { 4 | "model": "gugu-utils:pressureinputhatch" 5 | }, 6 | "variant=output": { 7 | "model": "gugu-utils:pressureoutputhatch" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/psiinputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "variant=normal": { 4 | "model": "gugu-utils:psiinputhatch" 5 | }, 6 | "variant=invaild": { 7 | "model": "gugu-utils:psiinputhatch_invaild" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/sparkmanahatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "variant=input": { 4 | "model": "gugu-utils:sparkmanainputhatch" 5 | }, 6 | "variant=output": { 7 | "model": "gugu-utils:sparkmanaoutputhatch" 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/blockstates/starlightinputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "variant=basic": { 4 | "model": "gugu-utils:starlightinputhatch_basic" 5 | }, 6 | "variant=trait": { 7 | "model": "gugu-utils:starlightinputhatch_trait" 8 | }, 9 | "variant=brilliant": { 10 | "model": "gugu-utils:starlightinputhatch_brilliant" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/aspectinputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_aspectinputhatch" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/aspectoutputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_aspectoutputhatch" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/blockmodel_overlay_column.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay", 3 | "textures": { 4 | "particle": "#bg_all", 5 | "bg_down": "#bg_all", 6 | "bg_up": "#bg_all", 7 | "bg_north": "#bg_all", 8 | "bg_east": "#bg_all", 9 | "bg_south": "#bg_all", 10 | "bg_west": "#bg_all", 11 | 12 | "ov_down": "#ov_end", 13 | "ov_up": "#ov_end", 14 | "ov_north": "#ov_side", 15 | "ov_east": "#ov_side", 16 | "ov_south": "#ov_side", 17 | "ov_west": "#ov_side" 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_big.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_big" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_extreme.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_extreme" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_huge.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_huge" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_ludicrous.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_ludicrous" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_medium.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_medium" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_reinforced.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_reinforced" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_small.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_small" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/emberinputhatch_tiny.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_emberinputhatch_tiny" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/pressureinputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_pressureinputhatch" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/pressureoutputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_pressureoutputhatch" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/sparkmanainputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_sparkmanainputhatch" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/sparkmanaoutputhatch.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_sparkmanaoutputhatch" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/spreader_overclocking.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "botania:block/shapes/spreader", 3 | "textures": { 4 | "inside": "gugu-utils:model/spreader_item/overclocking_inside", 5 | "side": "gugu-utils:model/spreader_item/overclocking_side", 6 | "material": "gugu-utils:model/spreader_item/overclocking_material" 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/starlightinputhatch_basic.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_starlightinputhatch_basic" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/starlightinputhatch_brilliant.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_starlightinputhatch_brilliant" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/block/starlightinputhatch_trait.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "modularmachinery:block/blockmodel_overlay_all", 3 | "textures": { 4 | "bg_all": "modularmachinery:blocks/blockcasing_plain", 5 | "ov_all": "gugu-utils:blocks/overlay_starlightinputhatch_trait" 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/item/constructionranged.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "gugu-utils:items/rangedwrench" 5 | } 6 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/item/lensoverclocking.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "botania:items/lens", 5 | "layer1": "gugu-utils:items/lens_overclocking" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/models/item/lenstransform.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "botania:items/lens", 5 | "layer1": "gugu-utils:items/lens_transform" 6 | } 7 | } -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/front_energyoutputport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/front_energyoutputport.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/front_energyoutputport_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/front_energyoutputport_off.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_airinputhatch_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_airinputhatch_end.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_airinputhatch_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_airinputhatch_off.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_airinputhatch_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_airinputhatch_on.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_aspectinputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_aspectinputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_aspectoutputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_aspectoutputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_aurainputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_aurainputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_big.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_extreme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_extreme.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_huge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_huge.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_ludicrous.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_ludicrous.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_medium.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_reinforced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_reinforced.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_small.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_emberinputhatch_tiny.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_energyoutputport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_energyoutputport.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_energyoutputport_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_energyoutputport_off.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_environmenthatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_environmenthatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_pressureinputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_pressureinputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_pressureoutputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_pressureoutputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_psiinputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_psiinputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_psiinputhatch_invaild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_psiinputhatch_invaild.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_sparkmanainputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_sparkmanainputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_sparkmanaoutputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_sparkmanaoutputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_basic.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_brilliant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_brilliant.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_brilliant_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_brilliant_2.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_trait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/blocks/overlay_starlightinputhatch_trait.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/gui/gui_additional.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/gui/gui_additional.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/gui/gui_amount_specifying.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/gui/gui_amount_specifying.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/gui/gui_gugucrt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/gui/gui_gugucrt.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/gui/gui_gugucrt.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/gui/gui_gugucrt.psd -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/gui/gui_starlightinputhatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/gui/gui_starlightinputhatch.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/gui/recipes_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/gui/recipes_ui.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/items/lens_overclocking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/items/lens_overclocking.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/items/lens_transform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/items/lens_transform.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/items/rangedwrench.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/items/rangedwrench.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/model/spreader_item/overclocking_inside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/model/spreader_item/overclocking_inside.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/model/spreader_item/overclocking_material.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/model/spreader_item/overclocking_material.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/model/spreader_item/overclocking_side.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/model/spreader_item/overclocking_side.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/particles/laser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/particles/laser.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/particles/laser_still.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/particles/laser_still.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/particles/round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/particles/round.png -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/particles/round.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/main/resources/assets/gugu-utils/textures/spell/trick_accelerate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ParaParty/gugu-utils/a0724e43d3f73f3de5a5ce1691820741aaa8ea18/src/main/resources/assets/gugu-utils/textures/spell/trick_accelerate.png -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "gugu-utils", 4 | "name": "GuGu Utils", 5 | "description": "A Util Mod for Mod pack of Dove's Home", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "", 9 | "updateUrl": "", 10 | "authorList": [ 11 | "WarmthDawn", 12 | "yuedu233_", 13 | "Month_Hare" 14 | ], 15 | "credits": "The Forge and FML guys", 16 | "logoFile": "", 17 | "screenshots": [], 18 | "dependencies": [ 19 | ] 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "GuGu Utils' Resource", 4 | "pack_format": 3, 5 | "_comment": "GuGu Utils' Resource" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /version.properties: -------------------------------------------------------------------------------- 1 | #Sat Jul 29 17:54:12 CST 2023 2 | SAVED_VERSION=0.8.4 3 | BUILD_NUMBER=1 4 | --------------------------------------------------------------------------------