Skip to content

Commit

Permalink
Merge pull request #35 from GTMEGA/dev
Browse files Browse the repository at this point in the history
PVP Leaderboard #3
  • Loading branch information
Houstonruss authored May 5, 2024
2 parents b53dfd6 + 310a714 commit 3f1d8be
Show file tree
Hide file tree
Showing 112 changed files with 3,292 additions and 1,624 deletions.
125 changes: 80 additions & 45 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1656003793falsepattern68
//version: 1656003793falsepattern75
/*
DO NOT CHANGE THIS FILE!
Expand Down Expand Up @@ -132,6 +132,8 @@ propertyDefaultIfUnset("mixinConfigs", "")
propertyDefaultIfUnset("mixinPluginPreInit", "")
propertyDefaultIfUnset("mixinPluginMinimumVersion", "0.8.5")
propertyDefaultIfUnset("remapStubs", false)
propertyDefaultIfUnset("apiPackages", null)
propertyDefaultIfUnset("apiPackagesNoRecurse", null)

propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthDependencies", "")
Expand All @@ -147,20 +149,31 @@ String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"

String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/")
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/")
String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
def verifyPackage(thePackage, propName) {
String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + thePackage.toString().replaceAll("\\.", "/")
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + thePackage.toString().replaceAll("\\.", "/")
String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + thePackage.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"${propName}\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
}

verifyPackage("", "modGroup")

if(apiPackage) {
targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
verifyPackage(apiPackage, "apiPackage")
}


if (apiPackages) {
apiPackages.tokenize(';').forEach { it -> verifyPackage(it, "apiPackages")}
}

if (apiPackagesNoRecurse) {
apiPackagesNoRecurse.tokenize(';').forEach { it -> verifyPackage(it, "apiPackagesNoRecurse")}
}

if(accessTransformersFile) {
Expand All @@ -175,9 +188,9 @@ if(usesMixins.toBoolean()) {
throw new GradleException("\"usesMixins\" requires \"mixinsPackage\" to be set!")
}

targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
String targetPackageJava = javaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
String targetPackageScala = scalaSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
String targetPackageKotlin = kotlinSourceDir + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/")
if(!(getFile(targetPackageJava).exists() || getFile(targetPackageScala).exists() || getFile(targetPackageKotlin).exists())) {
throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackageJava + " or " + targetPackageScala + " or " + targetPackageKotlin)
}
Expand Down Expand Up @@ -309,34 +322,46 @@ repositories {
name = "sponge2"
url = "https://mvn.falsepattern.com/sponge"
}
maven {
name = "jitpack"
url = "https://mvn.falsepattern.com/jitpack/"
}
}
}

def unimixinsVersion = "0.1.15"

dependencies {
if(usesMixins.toBoolean()) {
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
annotationProcessor("com.google.guava:guava:24.1.1-jre")
annotationProcessor("com.google.code.gson:gson:2.8.6")
annotationProcessor("com.llamalad7:MixinExtras:0.1.1-gasstation")
annotationProcessor("org.spongepowered:mixin:0.8.5-gasstation_7")
compile("org.spongepowered:mixin:0.8.5-gasstation_7")
compile("com.llamalad7:MixinExtras:0.1.1-gasstation")
compile("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev")
runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16')
testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16')
annotationProcessor("com.github.LegacyModdingMC.UniMixins:unimixins-all-1.7.10:$unimixinsVersion:dev")
implementation("com.github.LegacyModdingMC.UniMixins:unimixins-all-1.7.10:$unimixinsVersion:dev")
runtimeOnly('org.jetbrains:intellij-fernflower:1.2.1.16')
} else if(hasMixinDeps.toBoolean()) {
runtime("com.llamalad7:MixinExtras:0.1.1-gasstation")
runtime("org.spongepowered:mixin:0.8.5-gasstation_7")
runtime("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev")
runtimeOnly("com.github.LegacyModdingMC.UniMixins:unimixins-all-1.7.10:$unimixinsVersion:dev")
}
// Latest LWJGL
compile "org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209"
compile "org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209"
implementation "org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209"
implementation "org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209"
minecraftNatives "org.lwjgl.lwjgl:lwjgl-platform:2.9.4-nightly-20150209"
minecraftDeps "org.lwjgl.lwjgl:lwjgl:2.9.4-nightly-20150209"
minecraftDeps "org.lwjgl.lwjgl:lwjgl_util:2.9.4-nightly-20150209"
}


if(usesMixins.toBoolean()) {
configurations.implementation.dependencies.each {
if (it instanceof ExternalModuleDependency) {
it.exclude module: "SpongeMixins"
it.exclude module: "SpongePoweredMixin"
it.exclude module: "00gasstation-mc1.7.10"
it.exclude module: "gtnhmixins"
}
}
}

apply from: 'dependencies.gradle'

if(file('dependencies_override.gradle').exists()) {
Expand Down Expand Up @@ -433,12 +458,6 @@ runClient {
def arguments = []
def jvmArguments = []

if (usesMixins.toBoolean()) {
arguments += [
"--mods=" + Paths.get("$projectDir").resolve(minecraft.runDir).normalize().relativize(Paths.get("$projectDir/build/libs/$archivesBaseName-${version}.jar"))
]
}

if(usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
arguments += [
"--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"
Expand All @@ -463,12 +482,6 @@ runServer {
def arguments = []
def jvmArguments = []

if (usesMixins.toBoolean()) {
arguments += [
"--mods=" + Paths.get("$projectDir").resolve(minecraft.runDir).normalize().relativize(Paths.get("$projectDir/build/libs/$archivesBaseName-${version}.jar"))
]
}

if (usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
arguments += [
"--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"
Expand Down Expand Up @@ -610,11 +623,29 @@ task devJar(type: Jar) {

task apiJar(type: Jar) {
from (sourceSets.main.allSource) {
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
if (apiPackage)
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
if (apiPackages)
apiPackages.tokenize(';').forEach { pkg ->
include modGroup.toString().replaceAll("\\.", "/") + "/" + pkg.toString().replaceAll("\\.", "/") + '/**'
}
if (apiPackagesNoRecurse)
apiPackagesNoRecurse.tokenize(';').forEach { pkg ->
include modGroup.toString().replaceAll("\\.", "/") + "/" + pkg.toString().replaceAll("\\.", "/") + '/*'
}
}

from (sourceSets.main.output) {
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
if (apiPackage)
include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + '/**'
if (apiPackages)
apiPackages.tokenize(';').forEach { pkg ->
include modGroup.toString().replaceAll("\\.", "/") + "/" + pkg.toString().replaceAll("\\.", "/") + '/**'
}
if (apiPackagesNoRecurse)
apiPackagesNoRecurse.tokenize(';').forEach { pkg ->
include modGroup.toString().replaceAll("\\.", "/") + "/" + pkg.toString().replaceAll("\\.", "/") + '/*'
}
}

from (sourceSets.main.resources.srcDirs) {
Expand All @@ -635,7 +666,7 @@ compileJava.dependsOn(copySrgs)
artifacts {
archives sourcesJar
archives devJar
if(apiPackage) {
if(apiPackage || apiPackages || apiPackagesNoRecurse) {
archives apiJar
}
}
Expand Down Expand Up @@ -691,7 +722,7 @@ publishing {
artifact source: sourcesJar, classifier: "sources"
}
artifact source: usesShadowedDependencies.toBoolean() ? shadowDevJar : devJar, classifier: "dev"
if (apiPackage) {
if (apiPackage || apiPackages || apiPackagesNoRecurse) {
artifact source: apiJar, classifier: "api"
}

Expand Down Expand Up @@ -785,7 +816,7 @@ if (curseForgeProjectId != "" && System.getenv("CURSEFORGE_TOKEN") != null) {
}

if (usesMixins.toBoolean()) {
addCurseForgeRelation("requiredDependency", "gasstation")
addCurseForgeRelation("requiredDependency", "unimixins")
}
tasks.curseforge.dependsOn(build)
tasks.publish.dependsOn(tasks.curseforge)
Expand Down Expand Up @@ -818,7 +849,7 @@ if (modrinthProjectId != "" && System.getenv("MODRINTH_TOKEN") != null) {
}
}
if (usesMixins.toBoolean()) {
addModrinthDep("required", "project", "cdeAhgfp")
addModrinthDep("required", "project", "ghjoiQAl")
}
tasks.modrinth.dependsOn(build)
tasks.publish.dependsOn(tasks.modrinth)
Expand Down Expand Up @@ -1003,6 +1034,10 @@ configure(deobfParams) {
description = 'Rename all obfuscated parameter names inherited from Minecraft classes'
}

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

// Dependency Deobfuscation

def deobfMaven(mavenDep) {
Expand Down
6 changes: 4 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ def deobfCurse(curseDep) {
}

dependencies {
implementation("mega:structurelib-mc1.7.10:1.1.2:dev")
implementation("mega:structurelib-mc1.7.10:1.2.1-mega:dev")
implementation("codechicken:codechickencore-mc1.7.10:1.0.9-gtmega:dev")
implementation("codechicken:codechickenlib-mc1.7.10:1.1.4-gtmega:dev")
implementation("codechicken:notenoughitems-mc1.7.10:2.1.5-gtmega:dev")
implementation("codechicken:notenoughitems-mc1.7.10:2.2.0-mega:dev")

implementation("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")

Expand Down Expand Up @@ -69,6 +69,8 @@ dependencies {
}
compileOnly("team.chisel:chisel-mc1.7.10:2.10.1:dev")

compileOnly("com.falsepattern:falsetweaks-mc1.7.10:2.8.1:dev")

compileOnly("org.projectlombok:lombok:1.18.26") {
transitive = false
}
Expand Down
6 changes: 6 additions & 0 deletions repositories.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
// Add any additional repositories for your dependencies here

repositories {
maven {
name = "mvnpattern"
url = "https://mvn.falsepattern.com/releases/"
}

maven {
name = "gtmega"
url = "https://mvn.falsepattern.com/gtmega_releases/"
}

maven {
name = "ic2"
url = "https://mvn.falsepattern.com/ic2/"
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/gregtech/GT_Mod.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import gregtech.api.threads.GT_Runnable_MachineBlockUpdate;
import gregtech.api.util.*;
import gregtech.api.util.keybind.GT_KeyHandler;
import gregtech.common.GT_Compat;
import gregtech.common.GT_DummyWorld;
import gregtech.common.GT_Network;
import gregtech.common.GT_Proxy;
Expand Down Expand Up @@ -180,6 +181,7 @@ public static int calculateTotalGTVersion(int majorVersion, int minorVersion) {

@Mod.EventHandler
public void onPreLoad(FMLPreInitializationEvent aEvent) {
GT_Compat.init();
Locale.setDefault(Locale.ENGLISH);
if (GregTech_API.sPreloadStarted) {
return;
Expand Down Expand Up @@ -723,6 +725,9 @@ private static void explosiveConfig(Configuration tMainConfig) {
TERadius = GT_Values.getConfigValue(tMainConfig, meSection, "radius", TERadius, "Radius of the tunnel explosive");
TERadiusVariation = GT_Values.getConfigValue(tMainConfig, meSection, "radiusVariation", TERadiusVariation, "Variation in the radius of the tunnel explosive");
TEMaxRange = GT_Values.getConfigValue(tMainConfig, meSection, "TEmaxRange", TEMaxRange, "Maximum range of the tunnel explosive");


ExplosivesActivatedByRS = GT_Values.getConfigValue(tMainConfig, meSection, "ExplosivesActivatedByRS", ExplosivesActivatedByRS, "Whether the explosives are activated by redstone");
}

@Mod.EventHandler
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/gregtech/api/GregTech_API.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ public class GregTech_API {
sSoundList.put(220, MOD_ID.toLowerCase() + ":" + "remote_detonator_trigger");
sSoundList.put(221, MOD_ID.toLowerCase() + ":" + "potentiometer_click");
sSoundList.put(222, MOD_ID.toLowerCase() + ":" + "macerator");
sSoundList.put(223, MOD_ID.toLowerCase() + ":" + "furnace");
sSoundList.put(224, MOD_ID.toLowerCase() + ":" + "steam_furnace");
sSoundList.put(225, MOD_ID.toLowerCase() + ":" + "steam_vent");
sSoundList.put(226, MOD_ID.toLowerCase() + ":" + "boiler_vent");
sSoundList.put(227, MOD_ID.toLowerCase() + ":" + "steam_hammer");
//Don't forget to put your sounds into sounds.json too!
}

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/gregtech/api/enums/GT_Values.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,16 @@ public class GT_Values {

public static float MERayBaseRayDist = 0.3f, MERayPowerDropRatio = 0.5f, MERayDropBump = 0.3f, MEOrePowerBoost = 3.0f, MERockResistanceDrop = 0.25f,
MESoilPowerBoost = 1.0f, MEOtherResistanceDrop = 10.0f, MEExplosionPower = 9.0f, MEMaxEntitySize = 1f, MEOreChance = 1.0f, MESoilChance = 0.05f,
MERockChance = 0.025f, MEOtherChance = 0.0f, MEMaxRange = 3.0f, MEMinEntitySize = 0.95f, MEOffsetRatio = 0.75f;
MERockChance = 0.1f, MEOtherChance = 0.0f, MEMaxRange = 3.5f, MEMinEntitySize = 0.95f, MEOffsetRatio = 0.75f;

public static float TEMaxRange = 30.0f, TERadius = 4.0f, TERadiusVariation = 1.5f;

public static boolean MEFancyDrops = false, MERequiresRemote = true;

public static boolean LV24EuCapAuto = true, MV112EuCapAuto = true;

public static boolean ExplosivesActivatedByRS = true;

public static int PAMapChangeDamageChance = 2;

public static boolean getConfigValue(final Configuration config, final String category, final String key, final boolean defValue, final String comment) {
Expand Down
Loading

0 comments on commit 3f1d8be

Please sign in to comment.