├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── 000-submit-a-machine-or-recipe.yml │ └── 001-report-bug.yml └── workflows │ ├── build-and-test.yml │ └── release-tags.yml ├── .gitignore ├── LICENSE ├── README.md ├── README_CN.md ├── build.gradle ├── dependencies.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jitpack.yml ├── repositories.gradle ├── settings.gradle └── src └── main ├── java └── com │ └── github │ └── wohaopa │ └── GTNHModify │ ├── ClientProxy.java │ ├── CommonProxy.java │ ├── EventHandler.java │ ├── GTNHModifyMod.java │ ├── LateMixinLoader.java │ ├── MixinPlugin.java │ ├── Mods.java │ ├── client │ ├── command │ │ └── GTNHModifyCommand.java │ └── gui │ │ ├── GTNHModifyGuiConfig.java │ │ └── GuiFactory.java │ ├── config │ └── Config.java │ ├── mixins │ ├── TileEntityFurnaceMixin.java │ └── late │ │ ├── botania │ │ └── TileSpreaderMixin.java │ │ ├── gregtech │ │ ├── GT_MetaTileEntity_DrillerBaseMixin.java │ │ ├── GT_MetaTileEntity_MinerMixin.java │ │ ├── GT_MetaTileEntity_MultiFurnaceMixin.java │ │ └── GT_MetaTileEntity_ScannerMixin.java │ │ ├── gtnhintergalactic │ │ └── TileEntityModuleMinerMixin.java │ │ └── thaumcraft │ │ ├── TileAlchemyFurnaceMixin.java │ │ └── TileNodeMixin.java │ └── tweakers │ ├── EyeOfHarmonyRecipeTweaker.java │ ├── FusionTweaker.java │ ├── GGNaquadahReactorTweaker.java │ ├── ITweaker.java │ ├── Tweakers.java │ ├── gt │ ├── DynamicDuration.java │ ├── EnergyLessTweaker.java │ ├── GT_RecipeTweaker.java │ ├── InputOne.java │ ├── OneTickTweaker.java │ ├── Output64.java │ └── TenthsTweaker.java │ └── handler │ ├── BotaniaHandler.java │ ├── GregTechHandler.java │ ├── Handler.java │ ├── MinecraftHandler.java │ └── ThaumcraftHandler.java └── resources ├── LICENSE ├── assets └── GTNHModify │ └── lang │ └── en_US.lang ├── mcmod.info ├── mixins.GTNHModify.json └── mixins.GTNHModify.late.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # This is the universal Text Editor Configuration 2 | # for all GTNewHorizons projects 3 | # See: https://editorconfig.org/ 4 | 5 | root = true 6 | 7 | [*] 8 | charset = utf-8 9 | end_of_line = lf 10 | indent_size = 4 11 | indent_style = space 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | 15 | [*.{bat,ini}] 16 | end_of_line = crlf 17 | 18 | [*.{dtd,json,info,mcmeta,md,sh,svg,xml,xsd,xsl,yaml,yml}] 19 | indent_size = 2 20 | 21 | [*.lang] 22 | trim_trailing_whitespace = false 23 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text eol=lf 2 | 3 | *.[jJ][aA][rR] binary 4 | 5 | *.[pP][nN][gG] binary 6 | *.[jJ][pP][gG] binary 7 | *.[jJ][pP][eE][gG] binary 8 | *.[gG][iI][fF] binary 9 | *.[tT][iI][fF] binary 10 | *.[tT][iI][fF][fF] binary 11 | *.[iI][cC][oO] binary 12 | *.[sS][vV][gG] text 13 | *.[eE][pP][sS] binary 14 | *.[xX][cC][fF] binary 15 | 16 | *.[kK][aA][rR] binary 17 | *.[mM]4[aA] binary 18 | *.[mM][iI][dD] binary 19 | *.[mM][iI][dD][iI] binary 20 | *.[mM][pP]3 binary 21 | *.[oO][gG][gG] binary 22 | *.[rR][aA] binary 23 | 24 | *.7[zZ] binary 25 | *.[gG][zZ] binary 26 | *.[tT][aA][rR] binary 27 | *.[tT][gG][zZ] binary 28 | *.[zZ][iI][pP] binary 29 | 30 | *.[tT][cC][nN] binary 31 | *.[sS][oO] binary 32 | *.[dD][lL][lL] binary 33 | *.[dD][yY][lL][iI][bB] binary 34 | *.[pP][sS][dD] binary 35 | *.[tT][tT][fF] binary 36 | *.[oO][tT][fF] binary 37 | 38 | *.[pP][aA][tT][cC][hH] -text 39 | 40 | *.[bB][aA][tT] text eol=crlf 41 | *.[cC][mM][dD] text eol=crlf 42 | *.[pP][sS]1 text eol=crlf 43 | 44 | *[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/000-submit-a-machine-or-recipe.yml: -------------------------------------------------------------------------------- 1 | name: 提交新机器/配方 2 | description: "提交一个新的机器或配方修改的申请" 3 | labels: "enhancement" 4 | body: 5 | - type: input 6 | id: version 7 | attributes: 8 | label: 你的整合包版本 9 | description: 不同版本的整合包或许一点差异 10 | placeholder: "例如: 2.5.1" 11 | validations: 12 | required: true 13 | - type: input 14 | id: modid 15 | attributes: 16 | label: 机器/配方所属的Mod 17 | description: 请尽量具体到具体Mod,比如TecTech等,而不是GregTech 18 | placeholder: "例子: TecTech" 19 | validations: 20 | required: true 21 | 22 | - type: textarea 23 | id: report 24 | attributes: 25 | label: 需要添加的机器、配方的具体细节 26 | description: "请具体指出需要的内容" 27 | placeholder: "例子: 为神秘的注魔添加配方处理,改成1tick,不消耗源质等。" 28 | validations: 29 | required: true 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/001-report-bug.yml: -------------------------------------------------------------------------------- 1 | name: 汇报一个Bug 2 | description: "汇报一个Bug" 3 | labels: "bug" 4 | body: 5 | - type: input 6 | id: version 7 | attributes: 8 | label: 你的整合包版本 9 | description: 不同版本的整合包或许一点差异 10 | placeholder: "例如: 2.5.1" 11 | validations: 12 | required: true 13 | 14 | - type: textarea 15 | id: report 16 | attributes: 17 | label: Bug的具体细节 18 | description: "请具体描述BUg的具体细节" 19 | validations: 20 | required: true 21 | -------------------------------------------------------------------------------- /.github/workflows/build-and-test.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Build and test 3 | 4 | on: 5 | pull_request: 6 | branches: [ master, main ] 7 | push: 8 | branches: [ master, main ] 9 | 10 | jobs: 11 | build-and-test: 12 | uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master 13 | secrets: inherit 14 | -------------------------------------------------------------------------------- /.github/workflows/release-tags.yml: -------------------------------------------------------------------------------- 1 | 2 | name: Release tagged build 3 | 4 | on: 5 | push: 6 | tags: [ '*' ] 7 | 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | release-tags: 13 | uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master 14 | secrets: inherit 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .settings 3 | /.idea/ 4 | /.vscode/ 5 | /run/ 6 | /build/ 7 | /eclipse/ 8 | .classpath 9 | .project 10 | /bin/ 11 | /config/ 12 | /crash-reports/ 13 | /logs/ 14 | options.txt 15 | /saves/ 16 | usernamecache.json 17 | banned-ips.json 18 | banned-players.json 19 | eula.txt 20 | ops.json 21 | server.properties 22 | servers.dat 23 | usercache.json 24 | whitelist.json 25 | /out/ 26 | *.iml 27 | *.ipr 28 | *.iws 29 | src/main/resources/mixins.*([!.]).json 30 | *.bat 31 | *.DS_Store 32 | !gradlew.bat 33 | .factorypath 34 | addon.local.gradle 35 | addon.local.gradle.kts 36 | addon.late.local.gradle 37 | addon.late.local.gradle.kts 38 | layout.json 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 初夏同学 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 | # GTNH Modify 2 | GTNH modpack modification mod, dedicated to the modification of the recipe. 3 | 4 | English 5 | [中文](./README_CN.md) 6 | 7 | ## Config 8 | Do so in the `GTNHmodify.cfg` file. There are several modes: 9 | 1. `None`: do nothing 10 | 2. `OneTick`: all recipes are 1 tick _[Recommended]_ 11 | 3. `Tenths`: all recipes took a tenth of the time _[Recommended]_ 12 | 4. `Output64`: all inputs are 1 (if less than 1, nothing is done); All outputs are 64 (if greater than 64, nothing is done). 1 tick; 1 EU (if the EU is needed) 13 | 5. `Energyless`: The energy of all recipes is 0 14 | 15 | Some modes are **not covered** to the full recipes, please stay tuned! 16 | 17 | ## TODO List 18 | 19 | - [x] GT Recipes 20 | - [x] Furnace Recipes 21 | - [x] Miner & Pumper 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # GTNH Modify (万宁GTNH) 2 | GTNH整合包的修改Mod,致力于修改合成表。 3 | 4 | [English](./README.md) 5 | 中文 6 | 7 | ## 配置 8 | 在`GTNHmodify.cfg`文件中配置此Mod。这是已有的几种模式: 9 | 1. `None`: 什么都不做 10 | 2. `OneTick`: 所有的配方都是 1 Tick _[推荐]_ 11 | 3. `Tenths`: 所有的配方时间都是原来的十分之一 _[Recommended]_ 12 | 4. `Output64`: 所有配方的输入都是1 (如果少于1则什么都不做); 所有的输出都是64 (如果多于64则什么都不做); 1 tick; 1 EU (如果需要EU) 13 | 5. `Energyless`: 所有配方的能量都是 0 EU 14 | 15 | 有些模式**没有涵盖**完整的配方,请继续关注! 16 | 17 | **因为本人学业原因,无法继续开发此Mod,欢迎各位有兴趣的开发者贡献代码!** 18 | 19 | ## 计划表 20 | 1. Minecraft 21 | - [x] 熔炉时间 22 | 2. GregTech 23 | - [x] GT 配方 24 | - [x] 单方块泵 25 | - [x] 工业熔炉 26 | - [x] 各种钻井 27 | - [ ] 原木拟生 28 | - [ ] 温室 29 | - [ ] 屠宰场 30 | 3. Thaumcraft 31 | - [x] 炼金炉(只是烧物品的时间,蒸馏未做) 32 | - [ ] 蒸馏器蒸馏时间 33 | - [ ] 注魔 34 | - [ ] 充能节点速度 35 | 4. Ender IO 36 | - [ ] 灵魂绑定器 37 | 38 | ## 贡献方法 39 | ### Mod修改配方的流程 40 | 1. 使用Mixin/asm对各模组进行修改,放入处理钩子。(主要是只对各种固定的时间) 41 | 2. 使用Handler在服务端(或内置服务端)启动阶段对配方就行修改。 42 | ### Mod结构 43 | 1. `strategies`包存放各种策略。所有策略均继承抽象类`Strategy`并在其中进行注册。 44 | 2. `handler`包存放用于修改各Mod的类。需要加有@IHandler注解,注解中传入执行handler的方法的名称。handler中全部为静态方法,用于向策略转发来着Mixin传来的回调和启动服务器时需要修改的配方。handler在Handlers类中注册,通过反射的形式执行。 45 | 3. `mixins`包存放各种mixin,其中late下以Mod名区分子包。late下的mixin需要在LateMixinLoader中注册。其余修改原版类的Mixin需在MixinPlugin中注册。 46 | 4. `ModHelper`类用于存放各种Mod存在的信息,如果Mod不存在时不应注册相关的Mixin以及Handler 47 | ### Mod开发计划 48 | 1. 组合式策略(各种配方细节修改的自由组合) 49 | 2. 指令重载客户端配方(目前只需要服务端安装本Mod,但NEI显示不正确,客户端安装后也需要进入单机才能正确显示配方) 50 | 2. 支持脚本语言修改配方(CraftTweaker!但是可以拿到已知配方) 51 | 3. 导出配方表(dumper分支完成部分功能) 52 | 4. 导出图标(dumper已经完成此功能) 53 | 54 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | //version: 1707058017 2 | 3 | plugins { 4 | id 'com.gtnewhorizons.gtnhconvention' 5 | } 6 | -------------------------------------------------------------------------------- /dependencies.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Add your dependencies here. Supported configurations: 3 | * - api("group:name:version:classifier"): if you use the types from this dependency in the public API of this mod 4 | * Available at runtime and compiletime for mods depending on this mod 5 | * - implementation("g:n:v:c"): if you need this for internal implementation details of the mod, but none of it is visible via the public API 6 | * Available at runtime but not compiletime for mods depending on this mod 7 | * - compileOnly("g:n:v:c"): if the mod you're building doesn't need this dependency during runtime at all, e.g. for optional mods 8 | * Not available at all for mods depending on this mod, only visible at compiletime for this mod 9 | * - compileOnlyApi("g:n:v:c"): like compileOnly, but also visible at compiletime for mods depending on this mod 10 | * Available at compiletime but not runtime for mods depending on this mod 11 | * - runtimeOnlyNonPublishable("g:n:v:c"): if you want to include a mod in this mod's runClient/runServer runs, but not publish it as a dependency 12 | * Not available at all for mods depending on this mod, only visible at runtime for this mod 13 | * - devOnlyNonPublishable("g:n:v:c"): a combination of runtimeOnlyNonPublishable and compileOnly for dependencies present at both compiletime and runtime, 14 | * but not published as Maven dependencies - useful for RFG-deobfuscated dependencies or local testing 15 | * - runtimeOnly("g:n:v:c"): if you don't need this at compile time, but want it to be present at runtime 16 | * Available at runtime for mods depending on this mod 17 | * - annotationProcessor("g:n:v:c"): mostly for java compiler plugins, if you know you need this, use it, otherwise don't worry 18 | * - testCONFIG("g:n:v:c") - replace CONFIG by one of the above (except api), same as above but for the test sources instead of main 19 | * 20 | * - shadowImplementation("g:n:v:c"): effectively the same as API, but the dependency is included in your jar under a renamed package name 21 | * Requires you to enable usesShadowedDependencies in gradle.properties 22 | * 23 | * - compile("g:n:v:c"): deprecated, replace with "api" (works like the old "compile") or "implementation" (can be more efficient) 24 | * 25 | * You can exclude transitive dependencies (dependencies of the chosen dependency) by appending { transitive = false } if needed, 26 | * but use this sparingly as it can break using your mod as another mod's dependency if you're not careful. 27 | * 28 | * To depend on obfuscated jars you can use `devOnlyNonPublishable(rfg.deobf("dep:spec:1.2.3"))` to fetch an obfuscated jar from maven, 29 | * or `devOnlyNonPublishable(rfg.deobf(project.files("libs/my-mod-jar.jar")))` to use a file. 30 | * 31 | * Gradle names for some of the configuration can be misleading, compileOnlyApi and runtimeOnly both get published as dependencies in Maven, but compileOnly does not. 32 | * The buildscript adds runtimeOnlyNonPublishable to also have a runtime dependency that's not published. 33 | * 34 | * For more details, see https://docs.gradle.org/8.0.1/userguide/java_library_plugin.html#sec:java_library_configurations_graph 35 | */ 36 | dependencies { 37 | runtimeOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.6.19-GTNH:dev") 38 | 39 | implementation("com.github.GTNewHorizons:GT5-Unofficial:5.09.48.128:dev") 40 | 41 | implementation("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") 42 | implementation("com.github.GTNewHorizons:Botania:1.11.3-GTNH:dev") 43 | implementation("com.github.GTNewHorizons:GTNEIOrePlugin:1.3.2:dev") 44 | 45 | implementation("com.github.GTNewHorizons:GTNH-Intergalactic:1.4.6:dev") 46 | implementation("com.github.GTNewHorizons:Galaxy-Space-GTNH:1.1.90-GTNH:dev") 47 | 48 | // runtimeOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-423-GTNH:dev") 49 | // runtimeOnly("com.github.GTNewHorizons:AE2FluidCraft-Rework:1.3.21-gtnh:dev") 50 | runtimeOnly("com.github.GTNewHorizons:Baubles:1.0.4:dev") 51 | runtimeOnly("com.github.GTNewHorizons:waila:1.8.1:dev") 52 | } 53 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # ExampleMod tag to use as Blowdryer (Spotless, etc.) settings version, leave empty to disable. 2 | # LOCAL to test local config updates. 3 | gtnh.settings.blowdryerTag = 0.2.2 4 | 5 | # Human-readable mod name, available for mcmod.info population. 6 | modName = GTNHModify 7 | 8 | # Case-sensitive identifier string, available for mcmod.info population and used for automatic mixin JSON generation. 9 | # Conventionally lowercase. 10 | modId = GTNHModify 11 | 12 | # Root package of the mod, used to find various classes in other properties, 13 | # mcmod.info substitution, enabling assertions in run tasks, etc. 14 | modGroup = com.github.wohaopa.GTNHModify 15 | 16 | # Whether to use modGroup as the maven publishing group. 17 | # Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. 18 | useModGroupForPublishing = false 19 | 20 | # Updates your build.gradle and settings.gradle automatically whenever an update is available. 21 | autoUpdateBuildScript = false 22 | 23 | # Version of Minecraft to target 24 | minecraftVersion = 1.7.10 25 | 26 | # Version of Minecraft Forge to target 27 | forgeVersion = 10.13.4.1614 28 | 29 | # Specify an MCP channel for dependency deobfuscation and the deobfParams task. 30 | channel = stable 31 | 32 | # Specify an MCP mappings version for dependency deobfuscation and the deobfParams task. 33 | mappingsVersion = 12 34 | 35 | # Defines other MCP mappings for dependency deobfuscation. 36 | remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ 37 | 38 | # Select a default username for testing your mod. You can always override this per-run by running 39 | # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. 40 | developmentEnvironmentUserName = Developer 41 | 42 | # Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8. 43 | # See https://github.com/bsideup/jabel for details on how this works. 44 | enableModernJavaSyntax = true 45 | 46 | # Enables injecting missing generics into the decompiled source code for a better coding experience. 47 | # Turns most publicly visible List, Map, etc. into proper List, Map types. 48 | enableGenericInjection = true 49 | 50 | # Generate a class with a String field for the mod version named as defined below. 51 | # If generateGradleTokenClass is empty or not missing, no such class will be generated. 52 | # If gradleTokenVersion is empty or missing, the field will not be present in the class. 53 | generateGradleTokenClass = com.github.wohaopa.GTNHModify.Tags 54 | 55 | # Name of the token containing the project's current version to generate/replace. 56 | gradleTokenVersion = VERSION 57 | 58 | # [DEPRECATED] 59 | # Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java 60 | # public static final String VERSION = "GRADLETOKEN_VERSION"; 61 | # The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's 62 | # version in @Mod([...], version = VERSION, [...]). 63 | # Leave these properties empty to skip individual token replacements. 64 | replaceGradleTokenInFile = 65 | 66 | # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can 67 | # leave this property empty. 68 | # Example value: (apiPackage = api) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.api 69 | apiPackage = 70 | 71 | # Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/ 72 | # There can be multiple files in a space-separated list. 73 | # Example value: mymodid_at.cfg nei_at.cfg 74 | accessTransformersFile = 75 | 76 | # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! 77 | usesMixins = true 78 | 79 | # Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main. 80 | # This can speed up compile times thanks to not running the mixin annotation processor on all input sources. 81 | # Mixin classes will have access to "main" classes, but not the other way around. 82 | separateMixinSourceSet = 83 | 84 | # Adds some debug arguments like verbose output and class export. 85 | usesMixinDebug = false 86 | 87 | # Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise. 88 | mixinPlugin = MixinPlugin 89 | 90 | # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! 91 | mixinsPackage = mixins 92 | 93 | # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! 94 | # This parameter is for legacy compatibility only 95 | # Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin 96 | coreModClass = 97 | 98 | # If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class 99 | # that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! 100 | containsMixinsAndOrCoreModOnly = false 101 | 102 | # Enables Mixins even if this mod doesn't use them, useful if one of the dependencies uses mixins. 103 | forceEnableMixins = false 104 | 105 | # If enabled, you may use 'shadowCompile' for dependencies. They will be integrated into your jar. It is your 106 | # responsibility to check the license and request permission for distribution if required. 107 | usesShadowedDependencies = false 108 | 109 | # If disabled, won't remove unused classes from shadowed dependencies. Some libraries use reflection to access 110 | # their own classes, making the minimization unreliable. 111 | minimizeShadowedDependencies = true 112 | 113 | # If disabled, won't rename the shadowed classes. 114 | relocateShadowedDependencies = true 115 | 116 | # Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories. 117 | includeWellKnownRepositories = true 118 | 119 | # A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated 120 | # list of strings, with the acceptable keys being(case does not matter): 121 | # cursemaven 122 | # modrinth 123 | excludeWellKnownRepositories = 124 | 125 | # Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven. 126 | # Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables. 127 | # If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle. 128 | usesMavenPublishing = true 129 | 130 | # Maven repository to publish the mod to. 131 | # mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/ 132 | 133 | # Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token. 134 | # 135 | # The project's ID on Modrinth. Can be either the slug or the ID. 136 | # Leave this empty if you don't want to publish to Modrinth. 137 | modrinthProjectId = 138 | 139 | # The project's relations on Modrinth. You can use this to refer to other projects on Modrinth. 140 | # Syntax: scope1-type1:name1;scope2-type2:name2;... 141 | # Where scope can be one of [required, optional, incompatible, embedded], 142 | # type can be one of [project, version], 143 | # and the name is the Modrinth project or version slug/id of the other mod. 144 | # Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech 145 | # Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true 146 | modrinthRelations = 147 | 148 | # Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens. 149 | # 150 | # The project's numeric ID on CurseForge. You can find this in the About Project box. 151 | # Leave this empty if you don't want to publish on CurseForge. 152 | curseForgeProjectId = 153 | 154 | # The project's relations on CurseForge. You can use this to refer to other projects on CurseForge. 155 | # Syntax: type1:name1;type2:name2;... 156 | # Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible], 157 | # and the name is the CurseForge project slug of the other mod. 158 | # Example: requiredDependency:railcraft;embeddedLibrary:cofhlib;incompatible:buildcraft 159 | # Note: UniMixins is automatically set as a required dependency if usesMixins = true. 160 | curseForgeRelations = 161 | 162 | # Optional parameter to customize the produced artifacts. Use this to preserve artifact naming when migrating older 163 | # projects. New projects should not use this parameter. 164 | customArchiveBaseName = GTNH-WanNing 165 | 166 | # Optional parameter to have the build automatically fail if an illegal version is used. 167 | # This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'. 168 | # The check is ONLY performed if the version is a git tag. 169 | # Note: the specified string must be escaped, so e.g. 1\\.1\\.\\d+ instead of 1\.1\.\d+ 170 | # versionPattern = 171 | 172 | # Uncomment to prevent the source code from being published. 173 | # noPublishedSources = true 174 | 175 | # Uncomment this to disable Spotless checks. 176 | # This should only be uncommented to keep it easier to sync with upstream/other forks. 177 | # That is, if there is no other active fork/upstream, NEVER change this. 178 | # disableSpotless = true 179 | 180 | # Uncomment this to disable Checkstyle checks (currently wildcard import check). 181 | # disableCheckstyle = true 182 | 183 | # Override the IDEA build type. Valid values are: "" (leave blank, do not override), "idea" (force use native IDEA build), "gradle" 184 | # (force use delegated build). 185 | # This is meant to be set in $HOME/.gradle/gradle.properties. 186 | # e.g. add "systemProp.org.gradle.project.ideaOverrideBuildType=idea" will override the build type to be native build. 187 | # WARNING: If you do use this option, it will overwrite whatever you have in your existing projects. This might not be what you want! 188 | # Usually there is no need to uncomment this here as other developers do not necessarily use the same build type as you. 189 | # ideaOverrideBuildType = idea 190 | 191 | # Whether IDEA should run spotless checks when pressing the Build button. 192 | # This is meant to be set in $HOME/.gradle/gradle.properties. 193 | # ideaCheckSpotlessOnBuild = true 194 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wohaopa/GTNHModify/a0b4ac14ad8c9f84b370ea4295545d096b78cf85/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-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /jitpack.yml: -------------------------------------------------------------------------------- 1 | before_install: 2 | - ./gradlew setupCIWorkspace -------------------------------------------------------------------------------- /repositories.gradle: -------------------------------------------------------------------------------- 1 | // Add any additional repositories for your dependencies here. 2 | 3 | repositories { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | 2 | pluginManagement { 3 | repositories { 4 | maven { 5 | // RetroFuturaGradle 6 | name "GTNH Maven" 7 | url "https://nexus.gtnewhorizons.com/repository/public/" 8 | mavenContent { 9 | includeGroup("com.gtnewhorizons") 10 | includeGroupByRegex("com\\.gtnewhorizons\\..+") 11 | } 12 | } 13 | gradlePluginPortal() 14 | mavenCentral() 15 | mavenLocal() 16 | } 17 | } 18 | 19 | plugins { 20 | id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.26' 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/ClientProxy.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify; 2 | 3 | import net.minecraftforge.client.ClientCommandHandler; 4 | 5 | import com.github.wohaopa.GTNHModify.client.command.GTNHModifyCommand; 6 | 7 | import cpw.mods.fml.common.event.FMLInitializationEvent; 8 | 9 | public class ClientProxy extends CommonProxy { 10 | 11 | // Override CommonProxy methods here, if you want a different behaviour on the client (e.g. registering renders). 12 | // Don't forget to call the super methods as well. 13 | 14 | @Override 15 | public void init(FMLInitializationEvent event) { 16 | super.init(event); 17 | 18 | ClientCommandHandler.instance.registerCommand(new GTNHModifyCommand()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/CommonProxy.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify; 2 | 3 | import com.github.wohaopa.GTNHModify.config.Config; 4 | import com.github.wohaopa.GTNHModify.tweakers.Tweakers; 5 | 6 | import cpw.mods.fml.common.FMLCommonHandler; 7 | import cpw.mods.fml.common.event.FMLInitializationEvent; 8 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 9 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 10 | import cpw.mods.fml.common.event.FMLServerStartingEvent; 11 | 12 | public class CommonProxy { 13 | 14 | // preInit "Run before anything else. Read your config, create blocks, items, etc, and register them with the 15 | // GameRegistry." (Remove if not needed) 16 | public void preInit(FMLPreInitializationEvent event) { 17 | Config.init(event.getSuggestedConfigurationFile()); 18 | FMLCommonHandler.instance() 19 | .bus() 20 | .register(new EventHandler()); 21 | } 22 | 23 | // load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed) 24 | public void init(FMLInitializationEvent event) {} 25 | 26 | // postInit "Handle interaction with other mods, complete your setup based on this." (Remove if not needed) 27 | public void postInit(FMLPostInitializationEvent event) {} 28 | 29 | // register server commands in this event handler (Remove if not needed) 30 | public void serverStarting(FMLServerStartingEvent event) { 31 | Tweakers.initialize(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/EventHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify; 2 | 3 | import com.github.wohaopa.GTNHModify.tweakers.Tweakers; 4 | import com.github.wohaopa.GTNHModify.tweakers.gt.DynamicDuration; 5 | 6 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 7 | import cpw.mods.fml.common.gameevent.TickEvent; 8 | 9 | public class EventHandler { 10 | 11 | long lastUpdateTime = 0; 12 | long ticks = 0; 13 | 14 | @SubscribeEvent 15 | public void onTickPost(TickEvent.ServerTickEvent event) { 16 | if (Tweakers.Dynamic_Duration.enabled) if (event.phase == TickEvent.Phase.END) { 17 | ticks++; 18 | long now = System.currentTimeMillis(); 19 | if (now - lastUpdateTime > 10000) { // 10秒 20 | if (lastUpdateTime != 0) { 21 | if (ticks < 195) { 22 | DynamicDuration.instance.setF((float) (ticks * 50.0) / (now - lastUpdateTime)); 23 | DynamicDuration.update(); 24 | } 25 | ticks = 0; 26 | } 27 | lastUpdateTime = now; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/GTNHModifyMod.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify; 2 | 3 | import org.apache.logging.log4j.LogManager; 4 | import org.apache.logging.log4j.Logger; 5 | 6 | import cpw.mods.fml.common.Mod; 7 | import cpw.mods.fml.common.SidedProxy; 8 | import cpw.mods.fml.common.event.FMLInitializationEvent; 9 | import cpw.mods.fml.common.event.FMLPostInitializationEvent; 10 | import cpw.mods.fml.common.event.FMLPreInitializationEvent; 11 | import cpw.mods.fml.common.event.FMLServerStartingEvent; 12 | 13 | @Mod( 14 | modid = GTNHModifyMod.MODID, 15 | version = Tags.VERSION, 16 | guiFactory = "com.github.wohaopa.GTNHModify.client.gui.GuiFactory", 17 | name = "GTNHModify", 18 | acceptedMinecraftVersions = "[1.7.10]", 19 | acceptableRemoteVersions = "*", 20 | dependencies = "after:gregtech;after:Thaumcraft") 21 | public class GTNHModifyMod { 22 | 23 | public static final String MODID = "GTNHModify"; 24 | 25 | public static final Logger LOG = LogManager.getLogger(MODID); 26 | 27 | @SidedProxy( 28 | clientSide = "com.github.wohaopa.GTNHModify.ClientProxy", 29 | serverSide = "com.github.wohaopa.GTNHModify.CommonProxy") 30 | public static CommonProxy proxy; 31 | 32 | @Mod.EventHandler 33 | // preInit "Run before anything else. Read your config, create blocks, items, etc, and register them with the 34 | // GameRegistry." (Remove if not needed) 35 | public void preInit(FMLPreInitializationEvent event) { 36 | proxy.preInit(event); 37 | } 38 | 39 | @Mod.EventHandler 40 | // load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed) 41 | public void init(FMLInitializationEvent event) { 42 | proxy.init(event); 43 | } 44 | 45 | @Mod.EventHandler 46 | // postInit "Handle interaction with other mods, complete your setup based on this." (Remove if not needed) 47 | public void postInit(FMLPostInitializationEvent event) { 48 | proxy.postInit(event); 49 | } 50 | 51 | @Mod.EventHandler 52 | // register server commands in this event handler (Remove if not needed) 53 | public void serverStarting(FMLServerStartingEvent event) { 54 | proxy.serverStarting(event); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/LateMixinLoader.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Set; 6 | 7 | import com.gtnewhorizon.gtnhmixins.ILateMixinLoader; 8 | import com.gtnewhorizon.gtnhmixins.LateMixin; 9 | 10 | @LateMixin 11 | public class LateMixinLoader implements ILateMixinLoader { 12 | 13 | @Override 14 | public String getMixinConfig() { 15 | return "mixins.GTNHModify.late.json"; 16 | } 17 | 18 | @Override 19 | public List getMixins(Set loadedMods) { 20 | 21 | for (Mods mod : Mods.values()) { 22 | if (loadedMods.contains(mod.modid)) mod.setLoaded(); 23 | } 24 | 25 | List mixins = new ArrayList<>(); 26 | 27 | if (Mods.GregTech.isLoaded()) { 28 | // GregTech 29 | mixins.add("gregtech.GT_MetaTileEntity_ScannerMixin"); 30 | mixins.add("gregtech.GT_MetaTileEntity_MinerMixin"); 31 | mixins.add("gregtech.GT_MetaTileEntity_MultiFurnaceMixin"); 32 | mixins.add("gregtech.GT_MetaTileEntity_DrillerBaseMixin"); 33 | } 34 | if (Mods.Thaumcraft.isLoaded()) { 35 | mixins.add("thaumcraft.TileAlchemyFurnaceMixin"); 36 | mixins.add("thaumcraft.TileNodeMixin"); 37 | } 38 | if (Mods.GtnhIntergalactic.isLoaded()) { 39 | mixins.add("gtnhintergalactic.TileEntityModuleMinerMixin"); 40 | } 41 | if (Mods.Botania.isLoaded()) { 42 | mixins.add("botania.TileSpreaderMixin"); 43 | } 44 | 45 | return mixins; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/MixinPlugin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Set; 6 | 7 | import org.spongepowered.asm.lib.tree.ClassNode; 8 | import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; 9 | import org.spongepowered.asm.mixin.extensibility.IMixinInfo; 10 | 11 | public class MixinPlugin implements IMixinConfigPlugin { 12 | 13 | @Override 14 | public void onLoad(String mixinPackage) { 15 | 16 | } 17 | 18 | @Override 19 | public String getRefMapperConfig() { 20 | return null; 21 | } 22 | 23 | @Override 24 | public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { 25 | return false; 26 | } 27 | 28 | @Override 29 | public void acceptTargets(Set myTargets, Set otherTargets) { 30 | 31 | } 32 | 33 | @Override 34 | public List getMixins() { 35 | List mixins = new ArrayList<>(); 36 | // Minecraft 37 | mixins.add("TileEntityFurnaceMixin"); 38 | 39 | return mixins; 40 | } 41 | 42 | @Override 43 | public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { 44 | 45 | } 46 | 47 | @Override 48 | public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) { 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/Mods.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify; 2 | 3 | public enum Mods { 4 | 5 | GregTech("gregtech"), 6 | Thaumcraft("Thaumcraft"), 7 | GtnhIntergalactic("gtnhintergalactic", false), 8 | Botania("Botania"),; 9 | 10 | public final String modid; 11 | private boolean isLoaded = false; 12 | private final boolean hasHandler; 13 | 14 | Mods(String modid) { 15 | this(modid, true); 16 | 17 | } 18 | 19 | Mods(String modid, boolean hasHandler) { 20 | this.modid = modid; 21 | this.hasHandler = hasHandler; 22 | } 23 | 24 | public String getHandler() { 25 | if (!hasHandler) return null; 26 | return name(); 27 | } 28 | 29 | public void setLoaded() { 30 | this.isLoaded = true; 31 | } 32 | 33 | public boolean isLoaded() { 34 | return isLoaded; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/client/command/GTNHModifyCommand.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.client.command; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.stream.Collectors; 6 | import java.util.stream.Stream; 7 | 8 | import net.minecraft.client.entity.EntityClientPlayerMP; 9 | import net.minecraft.command.CommandBase; 10 | import net.minecraft.command.ICommandSender; 11 | import net.minecraft.util.ChatComponentText; 12 | import net.minecraft.util.ChatComponentTranslation; 13 | 14 | import com.github.wohaopa.GTNHModify.tweakers.Tweakers; 15 | 16 | public class GTNHModifyCommand extends CommandBase { 17 | 18 | @Override 19 | public String getCommandName() { 20 | return "gtnh-modify"; 21 | } 22 | 23 | @Override 24 | public boolean canCommandSenderUseCommand(ICommandSender sender) { 25 | return sender instanceof EntityClientPlayerMP; 26 | } 27 | 28 | @Override 29 | public int getRequiredPermissionLevel() { 30 | return 0; 31 | } 32 | 33 | @Override 34 | public List getCommandAliases() { 35 | return Arrays.asList("gtnh-m", "gtm"); 36 | } 37 | 38 | @Override 39 | public String getCommandUsage(ICommandSender sender) { 40 | return "commands.gtnh-modify.usage"; 41 | } 42 | 43 | private static final List subCmds = Stream.of("hello", "export", "help", "load") 44 | .sorted() 45 | .collect(Collectors.toList()); 46 | 47 | @Override 48 | public List addTabCompletionOptions(ICommandSender sender, String[] args) { 49 | 50 | if (args.length < 1) return subCmds; 51 | if (args.length == 1) { 52 | String test = args[0]; 53 | return subCmds.stream() 54 | .filter(s -> test.isEmpty() || s.startsWith(test)) 55 | .collect(Collectors.toList()); 56 | } 57 | if (args.length == 2) { 58 | String subCmd = args[0]; 59 | String test = args[1]; 60 | if (subCmd.equals("help")) { 61 | return subCmds.stream() 62 | .filter(s -> test.isEmpty() || s.startsWith(test)) 63 | .collect(Collectors.toList()); 64 | } 65 | } 66 | return null; 67 | } 68 | 69 | private void printHelps(ICommandSender sender) { 70 | for (String str : subCmds) { 71 | printHelp(sender, str); 72 | } 73 | } 74 | 75 | private void printHelp(ICommandSender sender, String subCmd) { 76 | sender.addChatMessage(new ChatComponentTranslation("commands.gtnh-modify." + subCmd + ".usage")); 77 | } 78 | 79 | @Override 80 | public void processCommand(ICommandSender sender, String[] args) { 81 | if (sender instanceof EntityClientPlayerMP) { 82 | if (args.length < 1) { 83 | printHelps(sender); 84 | return; 85 | } 86 | if (args.length == 1) { 87 | String test = args[0]; 88 | switch (test) { 89 | case "help" -> printHelps(sender); 90 | case "hello" -> sender.addChatMessage(new ChatComponentText("你好")); 91 | case "load" -> { 92 | Tweakers.initialize(); 93 | sender.addChatMessage(new ChatComponentTranslation("commands.gtnh-modify.load.success")); 94 | 95 | } 96 | default -> { 97 | if (subCmds.contains(test)) { 98 | printHelp(sender, test); 99 | } else { 100 | StringBuilder stringBuilder = new StringBuilder("Not Found Subject Command! \n"); 101 | boolean flag = true; 102 | for (String s : subCmds) { 103 | if (s.startsWith(test)) { 104 | if (flag) { 105 | stringBuilder.append("Maybe: "); 106 | flag = false; 107 | } 108 | stringBuilder.append(s) 109 | .append(", "); 110 | } 111 | } 112 | sender.addChatMessage(new ChatComponentText(stringBuilder.toString())); 113 | } 114 | } 115 | } 116 | return; 117 | } 118 | 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/client/gui/GTNHModifyGuiConfig.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.client.gui; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import net.minecraftforge.common.config.ConfigElement; 5 | import net.minecraftforge.common.config.Configuration; 6 | 7 | import com.github.wohaopa.GTNHModify.GTNHModifyMod; 8 | import com.github.wohaopa.GTNHModify.config.Config; 9 | 10 | import cpw.mods.fml.client.config.GuiConfig; 11 | 12 | public class GTNHModifyGuiConfig extends GuiConfig { 13 | 14 | @SuppressWarnings({ "unchecked", "rawtypes" }) 15 | public GTNHModifyGuiConfig(GuiScreen guiScreen) { 16 | super( 17 | guiScreen, 18 | new ConfigElement(Config.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), 19 | GTNHModifyMod.MODID, 20 | true, 21 | false, 22 | GuiConfig.getAbridgedConfigPath(Config.config.toString())); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/client/gui/GuiFactory.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.client.gui; 2 | 3 | import java.util.Set; 4 | 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.client.gui.GuiScreen; 7 | 8 | import cpw.mods.fml.client.IModGuiFactory; 9 | 10 | public class GuiFactory implements IModGuiFactory { 11 | 12 | @Override 13 | public void initialize(Minecraft minecraftInstance) { 14 | 15 | } 16 | 17 | @Override 18 | public Class mainConfigGuiClass() { 19 | return GTNHModifyGuiConfig.class; 20 | } 21 | 22 | @Override 23 | public Set runtimeGuiCategories() { 24 | return null; 25 | } 26 | 27 | @Override 28 | public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) { 29 | return null; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/config/Config.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.config; 2 | 3 | import java.io.File; 4 | 5 | import net.minecraftforge.common.config.Configuration; 6 | 7 | import com.github.wohaopa.GTNHModify.GTNHModifyMod; 8 | import com.github.wohaopa.GTNHModify.tweakers.Tweakers; 9 | 10 | import cpw.mods.fml.client.event.ConfigChangedEvent; 11 | import cpw.mods.fml.common.FMLCommonHandler; 12 | import cpw.mods.fml.common.eventhandler.SubscribeEvent; 13 | 14 | public class Config { 15 | 16 | public static Configuration config; 17 | 18 | private static boolean doSave; 19 | 20 | public static void init(File configFile) { 21 | if (config == null) { 22 | config = new Configuration(configFile); 23 | } 24 | doSave = false; 25 | loadConfig(); 26 | FMLCommonHandler.instance() 27 | .bus() 28 | .register(new Config()); 29 | } 30 | 31 | @SubscribeEvent 32 | public void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) { 33 | if (event.modID.equalsIgnoreCase(GTNHModifyMod.MODID)) { 34 | loadConfig(); 35 | } 36 | } 37 | 38 | private static void loadConfig() { 39 | 40 | for (Tweakers tweaker : Tweakers.values()) { 41 | tweaker.enabled = config 42 | .getBoolean(tweaker.name, Configuration.CATEGORY_GENERAL, false, tweaker.description); 43 | Object setting = tweaker.tweaker.getSettings(); 44 | if (setting != null) { 45 | if (setting instanceof String) { 46 | tweaker.tweaker.setSetting( 47 | config.getString( 48 | tweaker.name + "_setting", 49 | Configuration.CATEGORY_GENERAL, 50 | (String) setting, 51 | tweaker.description)); 52 | } else if (setting instanceof Boolean) { 53 | tweaker.tweaker.setSetting( 54 | config.getBoolean( 55 | tweaker.name + "_setting", 56 | Configuration.CATEGORY_GENERAL, 57 | (Boolean) setting, 58 | tweaker.description)); 59 | } else if (setting instanceof Integer) { 60 | tweaker.tweaker.setSetting( 61 | config.getInt( 62 | tweaker.name + "_setting", 63 | Configuration.CATEGORY_GENERAL, 64 | (int) setting, 65 | Integer.MIN_VALUE, 66 | Integer.MAX_VALUE, 67 | tweaker.description)); 68 | } else if (setting instanceof String[]) { 69 | tweaker.tweaker.setSetting( 70 | config.getStringList( 71 | tweaker.name + "_setting", 72 | Configuration.CATEGORY_GENERAL, 73 | (String[]) setting, 74 | tweaker.description)); 75 | } else if (setting instanceof Float) { 76 | tweaker.tweaker.setSetting( 77 | config.getFloat( 78 | tweaker.name + "_setting", 79 | Configuration.CATEGORY_GENERAL, 80 | (Float) setting, 81 | Float.MIN_VALUE, 82 | Float.MAX_VALUE, 83 | tweaker.description)); 84 | } 85 | 86 | } 87 | } 88 | 89 | if (config.hasChanged() || doSave) { 90 | config.save(); 91 | doSave = false; 92 | } 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/TileEntityFurnaceMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins; 2 | 3 | import net.minecraft.tileentity.TileEntityFurnace; 4 | 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.Constant; 7 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 8 | 9 | import com.github.wohaopa.GTNHModify.tweakers.handler.MinecraftHandler; 10 | 11 | @Mixin(TileEntityFurnace.class) 12 | public abstract class TileEntityFurnaceMixin { 13 | 14 | @ModifyConstant(method = "updateEntity", constant = @Constant(intValue = 200)) 15 | private int injected(int value) { 16 | return MinecraftHandler.instance.handle(this, value); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/botania/TileSpreaderMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.botania; 2 | 3 | import org.objectweb.asm.Opcodes; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Redirect; 7 | 8 | import com.github.wohaopa.GTNHModify.tweakers.handler.BotaniaHandler; 9 | 10 | import vazkii.botania.common.block.tile.mana.TileSpreader; 11 | 12 | @Mixin(value = TileSpreader.class, remap = false) 13 | public abstract class TileSpreaderMixin { 14 | 15 | @Redirect( 16 | method = "pingback", 17 | at = @At( 18 | value = "FIELD", 19 | target = "Lvazkii/botania/common/block/tile/mana/TileSpreader;pingbackTicks:I", 20 | opcode = Opcodes.PUTFIELD)) 21 | private void injectedPingback(TileSpreader tileSpreader, int pingbackTicks) { 22 | tileSpreader.pingbackTicks = BotaniaHandler.instance.handle(tileSpreader, pingbackTicks); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gregtech/GT_MetaTileEntity_DrillerBaseMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.gregtech; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 7 | 8 | import com.github.wohaopa.GTNHModify.tweakers.handler.GregTechHandler; 9 | 10 | import gregtech.api.recipe.check.CheckRecipeResult; 11 | import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_DrillerBase; 12 | 13 | @Mixin(value = GT_MetaTileEntity_DrillerBase.class, remap = false) 14 | public abstract class GT_MetaTileEntity_DrillerBaseMixin { 15 | 16 | @Inject( 17 | method = "checkProcessing", 18 | at = @At( 19 | value = "INVOKE", 20 | target = "Lgregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DrillerBase;setElectricityStats()V", 21 | shift = At.Shift.AFTER)) 22 | private void injected(CallbackInfoReturnable cir) { 23 | 24 | ((GT_MetaTileEntity_DrillerBase) ((Object) this)).mMaxProgresstime = GregTechHandler.instance 25 | .handle(this, ((GT_MetaTileEntity_DrillerBase) ((Object) this)).mMaxProgresstime); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gregtech/GT_MetaTileEntity_MinerMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.gregtech; 2 | 3 | import org.objectweb.asm.Opcodes; 4 | import org.spongepowered.asm.mixin.Final; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Mutable; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Redirect; 10 | 11 | import com.github.wohaopa.GTNHModify.tweakers.handler.GregTechHandler; 12 | 13 | import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Miner; 14 | 15 | @Mixin(value = GT_MetaTileEntity_Miner.class, remap = false) 16 | public class GT_MetaTileEntity_MinerMixin { 17 | 18 | @Mutable 19 | @Final 20 | @Shadow(remap = false) 21 | private int mSpeed; 22 | 23 | @Redirect( 24 | method = "onPostTick", 25 | at = @At( 26 | value = "FIELD", 27 | target = "Lgregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Miner;mSpeed:I", 28 | opcode = Opcodes.GETFIELD)) 29 | private int injected(GT_MetaTileEntity_Miner miner) { 30 | return GregTechHandler.instance.handle(miner, mSpeed); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gregtech/GT_MetaTileEntity_MultiFurnaceMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.gregtech; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.Constant; 5 | import org.spongepowered.asm.mixin.injection.ModifyConstant; 6 | 7 | import com.github.wohaopa.GTNHModify.tweakers.handler.GregTechHandler; 8 | 9 | import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_MultiFurnace; 10 | 11 | @Mixin(value = GT_MetaTileEntity_MultiFurnace.class, remap = false) 12 | public class GT_MetaTileEntity_MultiFurnaceMixin { 13 | 14 | @ModifyConstant(method = "checkProcessing", constant = @Constant(intValue = 512)) 15 | private int injected(int value) { 16 | return GregTechHandler.instance.handle(this, value); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gregtech/GT_MetaTileEntity_ScannerMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.gregtech; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.ModifyArg; 6 | 7 | import com.github.wohaopa.GTNHModify.tweakers.handler.GregTechHandler; 8 | 9 | import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Scanner; 10 | 11 | @Mixin(value = GT_MetaTileEntity_Scanner.class, remap = false) 12 | public abstract class GT_MetaTileEntity_ScannerMixin { 13 | 14 | @ModifyArg(method = "checkRecipe", at = @At(value = "INVOKE", target = "calculateOverclockedNess"), index = 1) 15 | private int injected(int x) { 16 | return GregTechHandler.instance.handle(this, x); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gtnhintergalactic/TileEntityModuleMinerMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.gtnhintergalactic; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | 6 | import com.gtnewhorizons.gtnhintergalactic.tile.multi.elevatormodules.TileEntityModuleMiner; 7 | import com.llamalad7.mixinextras.injector.ModifyReturnValue; 8 | 9 | @Mixin(value = TileEntityModuleMiner.class, remap = false) 10 | public abstract class TileEntityModuleMinerMixin { 11 | 12 | @ModifyReturnValue(method = "getRecipeTime", at = @At("RETURN")) 13 | private int fixZeroRecipeTimeBug(int original) { 14 | return Math.max(original, 1); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/thaumcraft/TileAlchemyFurnaceMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.thaumcraft; 2 | 3 | import org.objectweb.asm.Opcodes; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Redirect; 7 | 8 | import com.github.wohaopa.GTNHModify.tweakers.handler.ThaumcraftHandler; 9 | 10 | import thaumcraft.common.tiles.TileAlchemyFurnace; 11 | 12 | @Mixin(value = TileAlchemyFurnace.class, remap = false) 13 | public abstract class TileAlchemyFurnaceMixin { 14 | 15 | @Redirect( 16 | method = "canSmelt", 17 | at = @At( 18 | value = "FIELD", 19 | target = "Lthaumcraft/common/tiles/TileAlchemyFurnace;smeltTime:I", 20 | opcode = Opcodes.PUTFIELD)) 21 | private void injectedSmeltTime(TileAlchemyFurnace furnace, int smeltTime) { 22 | furnace.smeltTime = ThaumcraftHandler.instance.handle(furnace, smeltTime); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/mixins/late/thaumcraft/TileNodeMixin.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.mixins.late.thaumcraft; 2 | 3 | import org.objectweb.asm.Opcodes; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Shadow; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Redirect; 8 | 9 | import com.github.wohaopa.GTNHModify.tweakers.handler.ThaumcraftHandler; 10 | 11 | import thaumcraft.common.tiles.TileNode; 12 | 13 | @Mixin(value = TileNode.class, remap = false) 14 | public abstract class TileNodeMixin { 15 | 16 | @Shadow(remap = false) 17 | int regeneration; 18 | 19 | @Redirect( 20 | method = "handleRecharge", 21 | at = @At( 22 | value = "FIELD", 23 | target = "Lthaumcraft/common/tiles/TileNode;regeneration:I", 24 | opcode = Opcodes.PUTFIELD)) 25 | private void injectedHandleRecharge(TileNode tileNode, int regeneration) { 26 | this.regeneration = ThaumcraftHandler.instance.handle(tileNode, regeneration); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/EyeOfHarmonyRecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers; 2 | 3 | import java.lang.reflect.Field; 4 | import java.util.HashMap; 5 | 6 | import com.github.technus.tectech.TecTech; 7 | import com.github.technus.tectech.recipe.EyeOfHarmonyRecipe; 8 | import com.github.technus.tectech.recipe.EyeOfHarmonyRecipeStorage; 9 | 10 | public class EyeOfHarmonyRecipeTweaker extends ITweaker { 11 | 12 | @Override 13 | protected void apply() { 14 | try { 15 | Class clazz = EyeOfHarmonyRecipeStorage.class; 16 | Field field = clazz.getDeclaredField("recipeHashMap"); 17 | field.setAccessible(true); 18 | HashMap recipeHashMap = (HashMap) field 19 | .get(TecTech.eyeOfHarmonyRecipeStorage); 20 | recipeHashMap.forEach((s, eyeOfHarmonyRecipe) -> handler_EyeOfHarmonyRecipe(eyeOfHarmonyRecipe)); 21 | } catch (NoSuchFieldException | IllegalAccessException e) {} 22 | } 23 | 24 | private Field miningTimeSecondsField; 25 | private Field hydrogenRequirementField; 26 | private Field heliumRequirementField; 27 | private Field baseSuccessChanceField; 28 | private Field euOutputField; 29 | private Field euStartCostField; 30 | 31 | private void handler_EyeOfHarmonyRecipe(EyeOfHarmonyRecipe eyeOfHarmonyRecipe) { 32 | Class clazz = EyeOfHarmonyRecipe.class; 33 | 34 | // miningTimeSeconds 35 | { 36 | if (miningTimeSecondsField == null) { 37 | try { 38 | miningTimeSecondsField = clazz.getDeclaredField("miningTimeSeconds"); 39 | miningTimeSecondsField.setAccessible(true); 40 | } catch (NoSuchFieldException ignored) {} 41 | } 42 | if (miningTimeSecondsField != null) { 43 | try { 44 | miningTimeSecondsField.setLong(eyeOfHarmonyRecipe, 1); 45 | } catch (IllegalAccessException ignored) {} 46 | } 47 | } 48 | 49 | // hydrogenRequirement 50 | { 51 | if (hydrogenRequirementField == null) { 52 | try { 53 | hydrogenRequirementField = clazz.getDeclaredField("hydrogenRequirement"); 54 | hydrogenRequirementField.setAccessible(true); 55 | 56 | } catch (NoSuchFieldException ignored) {} 57 | } 58 | if (hydrogenRequirementField != null) { 59 | try { 60 | hydrogenRequirementField.setLong(eyeOfHarmonyRecipe, 1); 61 | } catch (IllegalAccessException ignored) {} 62 | } 63 | } 64 | 65 | // heliumRequirement 66 | { 67 | if (heliumRequirementField == null) { 68 | try { 69 | heliumRequirementField = clazz.getDeclaredField("heliumRequirement"); 70 | heliumRequirementField.setAccessible(true); 71 | 72 | } catch (NoSuchFieldException ignored) {} 73 | } 74 | if (heliumRequirementField != null) { 75 | try { 76 | heliumRequirementField.setLong(eyeOfHarmonyRecipe, 1); 77 | } catch (IllegalAccessException ignored) {} 78 | } 79 | } 80 | 81 | // baseSuccessChance 82 | { 83 | if (baseSuccessChanceField == null) { 84 | try { 85 | baseSuccessChanceField = clazz.getDeclaredField("baseSuccessChance"); 86 | baseSuccessChanceField.setAccessible(true); 87 | 88 | } catch (NoSuchFieldException ignored) {} 89 | } 90 | if (baseSuccessChanceField != null) { 91 | try { 92 | baseSuccessChanceField.setDouble(eyeOfHarmonyRecipe, 5); 93 | } catch (IllegalAccessException ignored) {} 94 | } 95 | } 96 | 97 | // euOutput 98 | { 99 | if (euOutputField == null) { 100 | try { 101 | euOutputField = clazz.getDeclaredField("euOutput"); 102 | euOutputField.setAccessible(true); 103 | } catch (NoSuchFieldException ignored) {} 104 | } 105 | if (euOutputField != null) { 106 | try { 107 | euOutputField.setLong(eyeOfHarmonyRecipe, 999999999); 108 | } catch (IllegalAccessException ignored) {} 109 | } 110 | } 111 | 112 | // euStartCost 113 | { 114 | if (euStartCostField == null) { 115 | try { 116 | euStartCostField = clazz.getDeclaredField("euStartCost"); 117 | euStartCostField.setAccessible(true); 118 | } catch (NoSuchFieldException ignored) {} 119 | } 120 | if (euStartCostField != null) { 121 | try { 122 | euStartCostField.setLong(eyeOfHarmonyRecipe, 114); 123 | } catch (IllegalAccessException ignored) {} 124 | } 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/FusionTweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers; 2 | 3 | import gregtech.api.recipe.RecipeMaps; 4 | 5 | public class FusionTweaker extends ITweaker { 6 | 7 | int value = 1; 8 | 9 | @Override 10 | protected void apply() { 11 | RecipeMaps.fusionRecipes.getAllRecipes() 12 | .forEach(gtRecipe -> gtRecipe.mSpecialValue = value); 13 | } 14 | 15 | @Override 16 | public Object getSettings() { 17 | return value; 18 | } 19 | 20 | @Override 21 | public void setSetting(Object setting) { 22 | value = (int) setting; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/GGNaquadahReactorTweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers; 2 | 3 | import goodgenerator.api.recipe.GoodGeneratorRecipeMaps; 4 | 5 | public class GGNaquadahReactorTweaker extends ITweaker { 6 | 7 | int integer = 10; 8 | 9 | @Override 10 | public void apply() { 11 | GoodGeneratorRecipeMaps.naquadahReactorFuels.getAllRecipes() 12 | .forEach(gtRecipe -> gtRecipe.mDuration *= integer); 13 | } 14 | 15 | @Override 16 | public Object getSettings() { 17 | return integer; 18 | } 19 | 20 | @Override 21 | public void setSetting(Object s) { 22 | integer = (int) s; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/ITweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers; 2 | 3 | public abstract class ITweaker { 4 | 5 | private boolean done = false; 6 | 7 | public void apply0() { 8 | if (done) return; 9 | done = true; 10 | apply(); 11 | } 12 | 13 | protected abstract void apply(); 14 | 15 | void exportRecipe() {} 16 | 17 | public Object getSettings() { 18 | return null; 19 | } 20 | 21 | public void setSetting(Object setting) {} 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/Tweakers.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers; 2 | 3 | import com.github.wohaopa.GTNHModify.tweakers.gt.DynamicDuration; 4 | import com.github.wohaopa.GTNHModify.tweakers.gt.EnergyLessTweaker; 5 | import com.github.wohaopa.GTNHModify.tweakers.gt.InputOne; 6 | import com.github.wohaopa.GTNHModify.tweakers.gt.OneTickTweaker; 7 | import com.github.wohaopa.GTNHModify.tweakers.gt.Output64; 8 | import com.github.wohaopa.GTNHModify.tweakers.gt.TenthsTweaker; 9 | import com.github.wohaopa.GTNHModify.tweakers.handler.BotaniaHandler; 10 | import com.github.wohaopa.GTNHModify.tweakers.handler.GregTechHandler; 11 | import com.github.wohaopa.GTNHModify.tweakers.handler.MinecraftHandler; 12 | import com.github.wohaopa.GTNHModify.tweakers.handler.ThaumcraftHandler; 13 | 14 | public enum Tweakers { 15 | 16 | // GregTech common 17 | OneTick("GT_Recipe OneTick", "GT_Recipe duration is 1 tick.", new OneTickTweaker()), 18 | Tenths("GT_Recipe Tenths", "GT_Recipe duration is one-tenth of the previous.", new TenthsTweaker()), 19 | EnergyLess("GT_Recipe EnergyLess", "GT_Recipe requires no energy.", new EnergyLessTweaker()), 20 | Input_1("GT_Recipe Input_1", "The input of GT_Recipe is 1.", new InputOne()), 21 | Output("GT_Recipe Input_64", "The output of GT_Recipe is 64.", new Output64()), 22 | Dynamic_Duration("GT_Recipe DynamicDuration", "The duration will calculate the multiplier based on real time", 23 | DynamicDuration.instance), 24 | Fusion("Fusion’s power on energy", "The power on energy is all set to 1", new FusionTweaker()), 25 | 26 | // GG Naquadah reactor 27 | GGNaquadahReactor("Other GGNaquadahReactor", "Ten times the burn time.", new GGNaquadahReactorTweaker()), 28 | // Homo 29 | EyeOfHarmonyRecipe("Other EyeOfHarmonyRecipeTweaker", "Some enhancement.", new EyeOfHarmonyRecipeTweaker()), 30 | 31 | // Handler 32 | 33 | Botania("Handle Botania", "The time of some devices was changed to 1 tick.", BotaniaHandler.instance), 34 | GregTech("Handle GregTech", "The time of some devices was changed to 1 tick", GregTechHandler.instance), 35 | Minecraft("Handle Minecraft", "The time of some devices was changed to 1 tick", MinecraftHandler.instance), 36 | Thaumcraft("Handle Thaumcraft", "The time of some devices was changed to 1 tick", ThaumcraftHandler.instance), 37 | // :( 38 | ; 39 | 40 | public static void initialize() { 41 | for (Tweakers tweaker : Tweakers.values()) { 42 | if (tweaker.enabled) { 43 | tweaker.tweaker.apply0(); 44 | } 45 | } 46 | } 47 | 48 | public final String name; 49 | public final String description; 50 | public final ITweaker tweaker; 51 | public boolean enabled; 52 | 53 | Tweakers(String name, String description, ITweaker tweaker) { 54 | this.name = name; 55 | this.description = description; 56 | this.tweaker = tweaker; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/gt/DynamicDuration.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.gt; 2 | 3 | import com.github.wohaopa.GTNHModify.GTNHModifyMod; 4 | 5 | import gregtech.api.util.GT_Recipe; 6 | 7 | public class DynamicDuration extends GT_RecipeTweaker { 8 | 9 | public static DynamicDuration instance = new DynamicDuration(); 10 | private static final Thread updateThread = new Thread(() -> { 11 | while (true) { 12 | if (DynamicDuration.needsUpdate) { 13 | GTNHModifyMod.LOG.info("Updating DynamicDuration: f = {}", instance.aFloat); 14 | long a = System.currentTimeMillis(); 15 | instance.apply(); 16 | DynamicDuration.needsUpdate = false; 17 | GTNHModifyMod.LOG.info("Updating DynamicDuration: use time {}ms", System.currentTimeMillis() - a); 18 | } 19 | Thread.yield(); 20 | try { 21 | Thread.sleep(100); 22 | } catch (InterruptedException e) { 23 | e.printStackTrace(); 24 | } 25 | } 26 | }); 27 | private static boolean running = false; 28 | private static boolean needsUpdate = false; 29 | 30 | static { 31 | updateThread.setDaemon(true); 32 | updateThread.setName("GTNHModify DynamicDuration UpdateThread"); 33 | } 34 | 35 | public static void update() { 36 | needsUpdate = true; 37 | if (!running) { 38 | running = true; 39 | updateThread.start(); 40 | } 41 | } 42 | 43 | public void setF(float f) { 44 | f0 = f / f0 * aFloat; 45 | } 46 | 47 | private float aFloat = 0.9f; 48 | private float f0 = 1f; 49 | 50 | @Override 51 | protected void modifyGT_Recipe(GT_Recipe aRecipe) { 52 | aRecipe.mDuration *= (int) f0; 53 | if (aRecipe.mDuration < 1) aRecipe.mDuration = 1; 54 | } 55 | 56 | @Override 57 | protected void modifyGT_Recipe_AssemblyLine(GT_Recipe.GT_Recipe_AssemblyLine aRecipe) { 58 | aRecipe.mDuration *= (int) f0; 59 | if (aRecipe.mDuration < 1) aRecipe.mDuration = 1; 60 | } 61 | 62 | @Override 63 | public Object getSettings() { 64 | return aFloat; 65 | } 66 | 67 | @Override 68 | public void setSetting(Object s) { 69 | aFloat = (float) s; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/gt/EnergyLessTweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.gt; 2 | 3 | import gregtech.api.util.GT_Recipe; 4 | 5 | public class EnergyLessTweaker extends GT_RecipeTweaker { 6 | 7 | int integer = 0; 8 | 9 | @Override 10 | protected void modifyGT_Recipe(GT_Recipe aRecipe) { 11 | aRecipe.mEUt = integer; 12 | } 13 | 14 | @Override 15 | protected void modifyGT_Recipe_AssemblyLine(GT_Recipe.GT_Recipe_AssemblyLine aRecipe) { 16 | aRecipe.mEUt = integer; 17 | } 18 | 19 | @Override 20 | public Object getSettings() { 21 | return integer; 22 | } 23 | 24 | @Override 25 | public void setSetting(Object s) { 26 | integer = (int) s; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/gt/GT_RecipeTweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.gt; 2 | 3 | import com.github.wohaopa.GTNHModify.tweakers.ITweaker; 4 | 5 | import gregtech.api.recipe.RecipeMap; 6 | import gregtech.api.util.GT_Recipe; 7 | 8 | public abstract class GT_RecipeTweaker extends ITweaker { 9 | 10 | @Override 11 | public void apply() { 12 | RecipeMap.ALL_RECIPE_MAPS.forEach((s, recipeMap) -> { 13 | if (!recipeMap.unlocalizedName.equals("gg.recipe.naquadah_reactor")) recipeMap.getAllRecipes() 14 | .forEach(this::modifyGT_Recipe); 15 | }); 16 | GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes.forEach(this::modifyGT_Recipe_AssemblyLine); 17 | } 18 | 19 | protected abstract void modifyGT_Recipe(GT_Recipe aRecipe); 20 | 21 | protected abstract void modifyGT_Recipe_AssemblyLine(GT_Recipe.GT_Recipe_AssemblyLine aRecipe); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/gt/InputOne.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.gt; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fluids.FluidStack; 5 | 6 | import gregtech.api.util.GT_Recipe; 7 | 8 | public class InputOne extends GT_RecipeTweaker { 9 | 10 | int integer = 1; 11 | 12 | @Override 13 | protected void modifyGT_Recipe(GT_Recipe aRecipe) { 14 | if (aRecipe.mInputs != null) { 15 | for (ItemStack itemStack : aRecipe.mInputs) { 16 | if (itemStack != null) { 17 | if (itemStack.stackSize > integer) itemStack.stackSize = integer; 18 | } 19 | } 20 | } 21 | if (aRecipe.mFluidInputs != null) { 22 | for (FluidStack fluidStack : aRecipe.mFluidInputs) { 23 | if (fluidStack != null) { 24 | if (fluidStack.amount > integer) fluidStack.amount = integer; 25 | } 26 | } 27 | } 28 | } 29 | 30 | @Override 31 | protected void modifyGT_Recipe_AssemblyLine(GT_Recipe.GT_Recipe_AssemblyLine aRecipe) { 32 | if (aRecipe.mInputs != null) { 33 | for (ItemStack itemStack : aRecipe.mInputs) { 34 | if (itemStack != null) { 35 | if (itemStack.stackSize > integer) itemStack.stackSize = integer; 36 | } 37 | } 38 | } 39 | if (aRecipe.mFluidInputs != null) { 40 | for (FluidStack fluidStack : aRecipe.mFluidInputs) { 41 | if (fluidStack != null) { 42 | if (fluidStack.amount > integer) fluidStack.amount = integer; 43 | } 44 | } 45 | } 46 | } 47 | 48 | @Override 49 | public Object getSettings() { 50 | return integer; 51 | } 52 | 53 | @Override 54 | public void setSetting(Object s) { 55 | integer = (int) s; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/gt/OneTickTweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.gt; 2 | 3 | import gregtech.api.util.GT_Recipe; 4 | 5 | public class OneTickTweaker extends GT_RecipeTweaker { 6 | 7 | int integer = 0; 8 | 9 | @Override 10 | protected void modifyGT_Recipe(GT_Recipe aRecipe) { 11 | if (aRecipe.mDuration > integer) aRecipe.mDuration = integer; 12 | } 13 | 14 | @Override 15 | protected void modifyGT_Recipe_AssemblyLine(GT_Recipe.GT_Recipe_AssemblyLine aRecipe) { 16 | if (aRecipe.mDuration > integer) aRecipe.mDuration = integer; 17 | } 18 | 19 | @Override 20 | public Object getSettings() { 21 | return integer; 22 | } 23 | 24 | @Override 25 | public void setSetting(Object s) { 26 | integer = (int) s; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/gt/Output64.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.gt; 2 | 3 | import net.minecraft.item.ItemStack; 4 | import net.minecraftforge.fluids.FluidStack; 5 | 6 | import gregtech.api.util.GT_Recipe; 7 | 8 | public class Output64 extends GT_RecipeTweaker { 9 | 10 | int integer = 64; 11 | 12 | @Override 13 | protected void modifyGT_Recipe(GT_Recipe aRecipe) { 14 | if (aRecipe.mOutputs != null) { 15 | for (ItemStack itemStack : aRecipe.mOutputs) { 16 | if (itemStack != null) { 17 | if (itemStack.stackSize > 0 && itemStack.stackSize < integer) itemStack.stackSize = integer; 18 | } 19 | } 20 | } 21 | 22 | if (aRecipe.mFluidOutputs != null) { 23 | for (FluidStack fluidStack : aRecipe.mFluidOutputs) { 24 | if (fluidStack != null) { 25 | if (fluidStack.amount > 0 && fluidStack.amount < integer * 250) 26 | fluidStack.amount = fluidStack.amount % 36 == 0 ? 144 * integer : integer * 250; 27 | } 28 | } 29 | } 30 | } 31 | 32 | @Override 33 | protected void modifyGT_Recipe_AssemblyLine(GT_Recipe.GT_Recipe_AssemblyLine aRecipe) { 34 | if (aRecipe.mOutput != null) { 35 | if (aRecipe.mOutput.stackSize > 0 && aRecipe.mOutput.stackSize < integer) 36 | aRecipe.mOutput.stackSize = integer; 37 | } 38 | } 39 | 40 | @Override 41 | public Object getSettings() { 42 | return integer; 43 | } 44 | 45 | @Override 46 | public void setSetting(Object s) { 47 | integer = (int) s; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/gt/TenthsTweaker.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.gt; 2 | 3 | import gregtech.api.util.GT_Recipe; 4 | 5 | public class TenthsTweaker extends GT_RecipeTweaker { 6 | 7 | int integer = 10; 8 | 9 | @Override 10 | protected void modifyGT_Recipe(GT_Recipe aRecipe) { 11 | aRecipe.mDuration /= integer; 12 | } 13 | 14 | @Override 15 | protected void modifyGT_Recipe_AssemblyLine(GT_Recipe.GT_Recipe_AssemblyLine aRecipe) { 16 | aRecipe.mDuration /= integer; 17 | } 18 | 19 | @Override 20 | public Object getSettings() { 21 | return integer; 22 | } 23 | 24 | @Override 25 | public void setSetting(Object s) { 26 | integer = (int) s; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/handler/BotaniaHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.handler; 2 | 3 | public class BotaniaHandler extends Handler { 4 | 5 | public static final BotaniaHandler instance = new BotaniaHandler(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/handler/GregTechHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.handler; 2 | 3 | public class GregTechHandler extends Handler { 4 | 5 | public static final GregTechHandler instance = new GregTechHandler(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/handler/Handler.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.handler; 2 | 3 | import com.github.wohaopa.GTNHModify.tweakers.ITweaker; 4 | 5 | public abstract class Handler extends ITweaker { 6 | 7 | private boolean enable = false; 8 | 9 | int integer = 1; 10 | 11 | public int handle(Object owner, int number) { 12 | if (enable) return integer; 13 | else return number; 14 | } 15 | 16 | @Override 17 | protected void apply() { 18 | enable = true; 19 | } 20 | 21 | @Override 22 | public Object getSettings() { 23 | return integer; 24 | } 25 | 26 | @Override 27 | public void setSetting(Object s) { 28 | integer = (int) s; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/handler/MinecraftHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.handler; 2 | 3 | public class MinecraftHandler extends Handler { 4 | 5 | public static final MinecraftHandler instance = new MinecraftHandler(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/github/wohaopa/GTNHModify/tweakers/handler/ThaumcraftHandler.java: -------------------------------------------------------------------------------- 1 | package com.github.wohaopa.GTNHModify.tweakers.handler; 2 | 3 | public class ThaumcraftHandler extends Handler { 4 | 5 | public static final ThaumcraftHandler instance = new ThaumcraftHandler(); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/resources/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 初夏同学 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 | -------------------------------------------------------------------------------- /src/main/resources/assets/GTNHModify/lang/en_US.lang: -------------------------------------------------------------------------------- 1 | commands.gtnh-modify.usage=Used to export some game content. 2 | commands.gtnh-modify.help.usage=/gtnh-modify help: Get help 3 | commands.gtnh-modify.export.usage=/gtnh-modify export: Export 4 | commands.gtnh-modify.load.usage=/gtnh-modify load: Load modify if nei does not display correctly 5 | commands.gtnh-modify.hello.usage=/gtnh-modify hello: HelloWorld 6 | 7 | commands.gtnh-modify.load.success=Load Modify Success! 8 | commands.gtnh-modify.load.failure=Load Modify Failure! Probably need a restart, or it's already loaded! 9 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | { 2 | "modListVersion": 2, 3 | "modList": [{ 4 | "modid": "${modId}", 5 | "name": "${modName}", 6 | "description": "GTNH modify", 7 | "version": "${modVersion}", 8 | "mcversion": "${minecraftVersion}", 9 | "url": "https://github.com/wohaopa/GTNHModify", 10 | "updateUrl": "", 11 | "authorList": ["wohaopa"], 12 | "credits": "", 13 | "logoFile": "", 14 | "screenshots": [], 15 | "parent": "", 16 | "requiredMods": [], 17 | "dependencies": [], 18 | "dependants": [], 19 | "useDependencyInformation": false 20 | }] 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/mixins.GTNHModify.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8.5-GTNH", 4 | "package": "com.github.wohaopa.GTNHModify.mixins", 5 | "plugin": "com.github.wohaopa.GTNHModify.MixinPlugin", 6 | "refmap": "mixins.GTNHModify.refmap.json", 7 | "target": "@env(DEFAULT)", 8 | "compatibilityLevel": "JAVA_8", 9 | "mixins": [], 10 | "client": [], 11 | "server": [] 12 | } 13 | -------------------------------------------------------------------------------- /src/main/resources/mixins.GTNHModify.late.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8.5-GTNH", 4 | "package": "com.github.wohaopa.GTNHModify.mixins.late", 5 | "refmap": "mixins.GTNHModify.refmap.json", 6 | "target": "@env(DEFAULT)", 7 | "compatibilityLevel": "JAVA_8", 8 | "mixins": [], 9 | "client": [], 10 | "server": [] 11 | } 12 | --------------------------------------------------------------------------------