mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 05:54:27 +00:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1e8e27a3e | ||
|
|
1a84a1cb26 | ||
|
|
1207133f98 | ||
|
|
480feef6f7 | ||
|
|
450f31bd73 | ||
|
|
09661218a3 | ||
|
|
e9f9412cab |
No files matched your search
+100
-21
@@ -1,4 +1,4 @@
|
||||
//version: 1674943145
|
||||
//version: 1675110695
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -55,9 +55,9 @@ plugins {
|
||||
id 'eclipse'
|
||||
id 'scala'
|
||||
id 'maven-publish'
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.5.30' apply false
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.5.30' apply false
|
||||
id 'com.google.devtools.ksp' version '1.5.30-1.0.0' apply false
|
||||
id 'org.jetbrains.kotlin.jvm' version '1.8.0' apply false
|
||||
id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false
|
||||
id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false
|
||||
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version ,unused, available for addon.gradle
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
|
||||
id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version
|
||||
@@ -66,7 +66,7 @@ plugins {
|
||||
id 'com.diffplug.spotless' version '6.7.2' apply false
|
||||
id 'com.modrinth.minotaur' version '2.+' apply false
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.0.16'
|
||||
id 'com.gtnewhorizons.retrofuturagradle' version '1.1.2'
|
||||
}
|
||||
boolean settingsupdated = verifySettingsGradle()
|
||||
settingsupdated = verifyGitAttributes() || settingsupdated
|
||||
@@ -113,6 +113,7 @@ propertyDefaultIfUnset("modrinthRelations", "")
|
||||
propertyDefaultIfUnset("curseForgeProjectId", "")
|
||||
propertyDefaultIfUnset("curseForgeRelations", "")
|
||||
propertyDefaultIfUnset("minimizeShadowedDependencies", true)
|
||||
propertyDefaultIfUnset("relocateShadowedDependencies", true)
|
||||
// Deprecated properties (kept for backwards compat)
|
||||
propertyDefaultIfUnset("gradleTokenModId", "")
|
||||
propertyDefaultIfUnset("gradleTokenModName", "")
|
||||
@@ -149,6 +150,33 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
|
||||
// If Kotlin is enabled in the project
|
||||
kotlin {
|
||||
jvmToolchain(8)
|
||||
}
|
||||
// Kotlin hacks our source sets, so we hack Kotlin's tasks
|
||||
def disabledKotlinTaskList = [
|
||||
"kaptGenerateStubsMcLauncherKotlin",
|
||||
"kaptGenerateStubsPatchedMcKotlin",
|
||||
"kaptGenerateStubsInjectedTagsKotlin",
|
||||
"compileMcLauncherKotlin",
|
||||
"compilePatchedMcKotlin",
|
||||
"compileInjectedTagsKotlin",
|
||||
"kaptMcLauncherKotlin",
|
||||
"kaptPatchedMcKotlin",
|
||||
"kaptInjectedTagsKotlin",
|
||||
"kspMcLauncherKotlin",
|
||||
"kspPatchedMcKotlin",
|
||||
"kspInjectedTagsKotlin",
|
||||
]
|
||||
tasks.configureEach { task ->
|
||||
if (task.name in disabledKotlinTaskList) {
|
||||
task.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
create("runtimeOnlyNonPublishable") {
|
||||
description = "Runtime only dependencies that are not published alongside the jar"
|
||||
@@ -212,6 +240,25 @@ if (accessTransformersFile) {
|
||||
}
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
|
||||
} else {
|
||||
boolean atsFound = false
|
||||
for (File at : sourceSets.getByName("main").resources.files) {
|
||||
if (at.name.toLowerCase().endsWith("_at.cfg")) {
|
||||
atsFound = true
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
|
||||
}
|
||||
}
|
||||
for (File at : sourceSets.getByName("api").resources.files) {
|
||||
if (at.name.toLowerCase().endsWith("_at.cfg")) {
|
||||
atsFound = true
|
||||
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(at)
|
||||
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(at)
|
||||
}
|
||||
}
|
||||
if (atsFound) {
|
||||
logger.warn("Found and added access transformers in the resources folder, please configure gradle.properties to explicitly mention them by name")
|
||||
}
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
@@ -290,7 +337,7 @@ if (identifiedVersion == versionOverride) {
|
||||
out.style(Style.Failure).text('Override version to ').style(Style.Identifier).text(modVersion).style(Style.Failure).println('!\7')
|
||||
}
|
||||
|
||||
group = modGroup
|
||||
group = "com.github.GTNewHorizons"
|
||||
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
|
||||
archivesBaseName = customArchiveBaseName
|
||||
} else {
|
||||
@@ -356,6 +403,16 @@ configurations.configureEach {
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure tests have access to minecraft classes
|
||||
sourceSets {
|
||||
test {
|
||||
java {
|
||||
compileClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
|
||||
runtimeClasspath += sourceSets.patchedMc.output + sourceSets.mcLauncher.output
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file('addon.gradle').exists()) {
|
||||
apply from: 'addon.gradle'
|
||||
}
|
||||
@@ -363,7 +420,7 @@ if (file('addon.gradle').exists()) {
|
||||
// Allow unsafe repos but warn
|
||||
repositories.configureEach { repo ->
|
||||
if (repo instanceof org.gradle.api.artifacts.repositories.UrlArtifactRepository) {
|
||||
if (repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) {
|
||||
if (repo.getUrl() != null && repo.getUrl().getScheme() == "http" && !repo.allowInsecureProtocol) {
|
||||
logger.warn("Deprecated: Allowing insecure connections for repo '${repo.name}' - add 'allowInsecureProtocol = true'")
|
||||
repo.allowInsecureProtocol = true
|
||||
}
|
||||
@@ -473,6 +530,14 @@ dependencies {
|
||||
}
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
if (usesMixins.toBoolean()) {
|
||||
dependencies {
|
||||
kapt('com.gtnewhorizon:gtnhmixins:2.1.10:processor')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
|
||||
@@ -513,9 +578,11 @@ if (usesMixins.toBoolean()) {
|
||||
tasks.named("reobfJar", ReobfuscatedJar).configure {
|
||||
extraSrgFiles.from(mixinSrg)
|
||||
}
|
||||
}
|
||||
|
||||
if (usesMixins.toBoolean()) {
|
||||
tasks.named("processResources").configure {
|
||||
dependsOn("generateAssets")
|
||||
}
|
||||
|
||||
tasks.named("compileJava", JavaCompile).configure {
|
||||
doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
@@ -529,6 +596,25 @@ if (usesMixins.toBoolean()) {
|
||||
"-XDignore.symbol.file"
|
||||
]
|
||||
}
|
||||
|
||||
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
|
||||
kapt {
|
||||
correctErrorTypes = true
|
||||
javacOptions {
|
||||
option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}")
|
||||
option("-AoutSrgFile=$mixinSrg")
|
||||
option("-AoutRefMapFile=$refMap")
|
||||
}
|
||||
}
|
||||
tasks.configureEach { task ->
|
||||
if (task.name == "kaptKotlin") {
|
||||
task.doFirst {
|
||||
new File(mixinTmpDir).mkdirs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tasks.named("processResources", ProcessResources).configure {
|
||||
@@ -584,6 +670,7 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
|
||||
target = tasks.shadowJar
|
||||
prefix = modGroup + ".shadow"
|
||||
enabled = minimizeShadowedDependencies.toBoolean()
|
||||
}
|
||||
tasks.named("shadowJar", ShadowJar).configure {
|
||||
manifest {
|
||||
@@ -599,7 +686,9 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
project.configurations.shadeCompile
|
||||
]
|
||||
archiveClassifier.set('dev')
|
||||
dependsOn(relocateShadowJar)
|
||||
if (minimizeShadowedDependencies.toBoolean()) {
|
||||
dependsOn(relocateShadowJar)
|
||||
}
|
||||
}
|
||||
configurations.runtimeElements.outgoing.artifacts.clear()
|
||||
configurations.apiElements.outgoing.artifacts.clear()
|
||||
@@ -625,16 +714,6 @@ if (usesShadowedDependencies.toBoolean()) {
|
||||
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
|
||||
ext.publishableObfJar = tasks.reobfJar
|
||||
|
||||
tasks.named('extractForgeUserdev', Copy).configure { efu ->
|
||||
doLast {
|
||||
// Fix CoFH-repackaged CCL not finding mappings
|
||||
project.copy {
|
||||
from(mcpTasks.userdevDir("conf"))
|
||||
into(new File(project.buildDir, "unpacked/conf"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('apiJar', Jar) {
|
||||
from(sourceSets.main.allSource) {
|
||||
include modGroupPath + "/" + apiPackagePath + '/**'
|
||||
@@ -739,7 +818,7 @@ publishing {
|
||||
artifact apiJar
|
||||
}
|
||||
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: "com.github.GTNewHorizons"
|
||||
groupId = System.getenv("ARTIFACT_GROUP_ID") ?: project.group
|
||||
artifactId = System.getenv("ARTIFACT_ID") ?: project.name
|
||||
// Using the identified version, not project.version as it has the prepended 1.7.10
|
||||
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
|
||||
|
||||
@@ -288,6 +288,10 @@ public final class Config {
|
||||
public static int maxPhotovoltaicAdvancedOutputRF = 40;
|
||||
public static int maxPhotovoltaicVibrantOutputRF = 160;
|
||||
|
||||
public static int photovoltaicCellCapacityRF = 10000;
|
||||
public static int photovoltaicAdvancedCellCapacityRF = 10000;
|
||||
public static int photovoltaicVibrantCellCapacityRF = 10000;
|
||||
|
||||
public static int zombieGeneratorRfPerTick = 80;
|
||||
public static int zombieGeneratorTicksPerBucketFuel = 12000;
|
||||
|
||||
@@ -800,6 +804,33 @@ public final class Config {
|
||||
maxPhotovoltaicAdvancedOutputRF,
|
||||
"Maximum output in RF/t of the Advanced Photovoltaic Panels.")
|
||||
.getInt(maxPhotovoltaicAdvancedOutputRF);
|
||||
maxPhotovoltaicVibrantOutputRF = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"maxPhotovoltaicVibrantOutputRF",
|
||||
maxPhotovoltaicVibrantOutputRF,
|
||||
"Maximum output in RF/t of the Vibrant Photovoltaic Panels.")
|
||||
.getInt(maxPhotovoltaicVibrantOutputRF);
|
||||
|
||||
photovoltaicCellCapacityRF = config.get(
|
||||
sectionPower.name,
|
||||
"photovoltaicCellCapacityRF",
|
||||
photovoltaicCellCapacityRF,
|
||||
"Maximum capacity in RF/t of the Photovoltaic Panels.").getInt(photovoltaicCellCapacityRF);
|
||||
photovoltaicAdvancedCellCapacityRF = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"photovoltaicAdvancedCellCapacityRF",
|
||||
photovoltaicAdvancedCellCapacityRF,
|
||||
"Maximum capacity in RF/t of the Advanced Photovoltaic Panels.")
|
||||
.getInt(photovoltaicAdvancedCellCapacityRF);
|
||||
photovoltaicVibrantCellCapacityRF = config
|
||||
.get(
|
||||
sectionPower.name,
|
||||
"photovoltaicVibrantCellCapacityRF",
|
||||
photovoltaicVibrantCellCapacityRF,
|
||||
"Maximum capacity in RF/t of the Vibrant Photovoltaic Panels.")
|
||||
.getInt(photovoltaicVibrantCellCapacityRF);
|
||||
|
||||
useAlternateBinderRecipe = config
|
||||
.get(
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cofh.api.energy.EnergyStorage;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import crazypants.enderio.config.Config;
|
||||
|
||||
public class SolarPanelNetwork {
|
||||
|
||||
@@ -25,12 +26,13 @@ public class SolarPanelNetwork {
|
||||
|
||||
public SolarPanelNetwork() {
|
||||
panels = Lists.newArrayList();
|
||||
energy = new EnergyStorage(ENERGY_PER);
|
||||
energy = new EnergyStorage(getCapacity());
|
||||
}
|
||||
|
||||
SolarPanelNetwork(TileEntitySolarPanel initial) {
|
||||
this();
|
||||
panels.add(initial);
|
||||
energy.setCapacity(getCapacity(initial, 1));
|
||||
empty = false;
|
||||
}
|
||||
|
||||
@@ -83,8 +85,40 @@ public class SolarPanelNetwork {
|
||||
destroyNetwork();
|
||||
}
|
||||
|
||||
private int getCapacity() {
|
||||
int capacity = ENERGY_PER;
|
||||
|
||||
if (panels.size() > 0) {
|
||||
TileEntitySolarPanel masterPanel = getMaster();
|
||||
capacity = getCapacity(masterPanel, panels.size());
|
||||
}
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
private static int getCapacity(TileEntitySolarPanel panel, int panelsCount) {
|
||||
int capacity = ENERGY_PER;
|
||||
int meta = panel.getBlockMetadata();
|
||||
|
||||
switch (meta) {
|
||||
case 0: // Default
|
||||
capacity = Config.photovoltaicCellCapacityRF;
|
||||
break;
|
||||
case 1: // Advanced
|
||||
capacity = Config.photovoltaicAdvancedCellCapacityRF;
|
||||
break;
|
||||
case 2: // Vibrant
|
||||
capacity = Config.photovoltaicVibrantCellCapacityRF;
|
||||
break;
|
||||
}
|
||||
|
||||
capacity = capacity * panelsCount;
|
||||
|
||||
return capacity;
|
||||
}
|
||||
|
||||
private void updateEnergy() {
|
||||
energy.setCapacity(ENERGY_PER * panels.size());
|
||||
energy.setCapacity(getCapacity());
|
||||
energy.setMaxExtract(energy.getMaxEnergyStored());
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
if (itemStack.getItem() == EnderIO.itemPowerConduit) {
|
||||
if (itemStack.getItem() == EnderIO.itemPowerConduit || itemStack.getItem() == EnderIO.itemPowerConduitEndergy) {
|
||||
NBTTagCompound nbtRoot = _accessor.getNBTData();
|
||||
if (nbtRoot.hasKey("storedEnergyRF")) {
|
||||
int stored = nbtRoot.getInteger("storedEnergyRF");
|
||||
|
||||
Reference in new issue
Block a user