From 33d8556a273bc9161381d3bca94e850fe1cfe510 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 29 Dec 2021 16:15:23 +0700 Subject: [PATCH] Add devenv dependencies --- .gitignore | 1 + build.gradle | 49 ++++++++++++++----- gradle.properties | 13 ++++- .../entity/BlockEntityChemicalGenerator.kt | 3 +- .../mc/otm/client/screen/BatteryBankScreen.kt | 2 +- 5 files changed, 53 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index bf66e883a..f8677d309 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ eclipse run design/ +libs/ # Files from Forge MDK forge*changelog.txt diff --git a/build.gradle b/build.gradle index 8f61425f1..6df1f65dc 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.0" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}" } } @@ -21,7 +21,7 @@ apply plugin: 'kotlin' apply from: 'https://raw.githubusercontent.com/thedarkcolour/KotlinForForge/site/thedarkcolour/kotlinforforge/gradle/kff-3.0.0.gradle' -version = '1.0' +version = mod_version group = 'ru.dbotthepony.mc' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'overdrive_that_matters' @@ -51,7 +51,7 @@ minecraft { // // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'official', version: '1.18' + mappings channel: 'official', version: mc_version accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') @@ -137,20 +137,37 @@ sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { // Put repositories for dependencies here // ForgeGradle automatically adds the Forge maven and Maven Central for you + maven { + // location of the maven that hosts JEI files + name = "Progwml6 maven" + url = "https://dvs1.progwml6.com/files/maven/" + } + + maven { + // location of a maven mirror for JEI files, as a fallback + name = "ModMaven" + url = "https://modmaven.dev" + } + + maven { + name 'tterrag maven' + url "https://maven.tterrag.com/" + } + + maven { + url "https://maven.k-4u.nl" + } // If you have mod jar dependencies in ./libs, you can declare them as a repository like so: - // flatDir { - // dir 'libs' - // } + //flatDir { + // dir 'libs' + //} } dependencies { - // Specify the version of Minecraft to use. If this is any group other than 'net.minecraft', it is assumed - // that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied. - // The userdev artifact is a special name and will get all sorts of transformations applied to it. - minecraft 'net.minecraftforge:forge:1.18.1-39.0.7' + minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}" - testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' + testImplementation "org.junit.jupiter:junit-jupiter:${jupiter_version}" // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency @@ -158,7 +175,15 @@ dependencies { // implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency // Examples using mod jars from ./libs - // implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}") + // implementation fg.deobf("blank:EnderRift-1.18.1:2.4.1") + + // compile against the JEI API but do not include it at runtime + //compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") + // at runtime, use the full JEI jar + //runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") + + implementation "mezz.jei:jei-${mc_version}:${jei_version}:deobf" + implementation fg.deobf(create("mcjty.theoneprobe:theoneprobe:${mc_version_weak}-${the_one_probe_version}") { transitive = false }) // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html diff --git a/gradle.properties b/gradle.properties index 878bf1f7e..2b757bba2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,15 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx3G -org.gradle.daemon=false \ No newline at end of file +org.gradle.daemon=false + +mc_version=1.18.1 +mc_version_weak=1.18 + +jei_version=9.1.1.48 +forge_version=39.0.7 +jupiter_version=5.8.2 +the_one_probe_version=5.0.1-5 + +kotlin_version=1.6.0 +mod_version=1.0 \ No newline at end of file diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt index faab45d21..57d69ca6f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt @@ -77,6 +77,7 @@ class BlockEntityChemicalGenerator(pos: BlockPos, state: BlockState) : BlockEnti companion object { private val THROUGHPUT = Fraction(160) + private val THROUGHPUT_INT = 160 private val GENERATION_SPEED = Fraction(40) private val MAX_ENERGY = Fraction(24_000) private val NAME = TranslatableComponent("block.overdrive_that_matters.chemical_generator") @@ -225,7 +226,7 @@ class BlockEntityChemicalGenerator(pos: BlockPos, state: BlockState) : BlockEnti energy.extractEnergyInner(received, false) } } else { - val demand = it.receiveEnergy(Int.MAX_VALUE, true) + val demand = it.receiveEnergy(THROUGHPUT_INT, true) val extracted = energy.extractEnergyInner(demand, true) val received = it.receiveEnergy(extracted, false) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/BatteryBankScreen.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/BatteryBankScreen.kt index 70d59b772..57230f777 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/BatteryBankScreen.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/BatteryBankScreen.kt @@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.client.screen.panels.FramePanel import ru.dbotthepony.mc.otm.client.screen.panels.SlotPanel import ru.dbotthepony.mc.otm.client.screen.widget.PowerGaugePanel -class BatteryBankScreen(menu: BatteryBankMenu, p_97742_: Inventory?, p_97743_: Component?) : +class BatteryBankScreen(menu: BatteryBankMenu, p_97742_: Inventory, p_97743_: Component) : MatteryScreen(menu, p_97742_, p_97743_) { override fun makeMainFrame(): FramePanel{