Skip to content

Commit fd885da

Browse files
committed
Begin porting to 1.12.2
~40% done. There are some problems with porting the GL code, serious problems with the RenderType code, and problems with the matrix code. GUI code inspired by Angelica
1 parent a2ed799 commit fd885da

File tree

252 files changed

+3836
-3449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+3836
-3449
lines changed

build.gradle

Lines changed: 50 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
11
plugins {
2-
id 'dev.architectury.loom' version '0.10.0-SNAPSHOT'
2+
id "java-library"
3+
id "com.gtnewhorizons.retrofuturagradle" version "1.3.26"
34
id 'com.github.johnrengelman.shadow' version '7.1.2'
4-
id 'maven-publish'
55
}
66

7-
loom {
8-
silentMojangMappingsLicense()
9-
10-
forge {
11-
mixinConfigs = [
12-
"mixins.oculus.json",
13-
"mixins.oculus.fantastic.json",
14-
"mixins.oculus.vertexformat.json",
15-
"mixins.oculus.bettermipmaps.json",
16-
"mixins.oculus.fixes.maxfpscrash.json",
17-
"mixins.oculus.optimized-stitching.json",
18-
"oculus-batched-entity-rendering.mixins.json",
19-
"mixins.oculus.compat.sodium.json",
20-
"mixins.oculus.compat.json"
21-
]
22-
}
23-
mixin.defaultRefmapName = "oculus-mixins-refmap.json"
7+
archivesBaseName = "${project.mod_id}-mc${project.minecraft_version}-${project.mod_version}"
8+
9+
// Set the toolchain version to decouple the Java we run Gradle with from the Java used to compile and run the mod
10+
java {
11+
toolchain {
12+
languageVersion.set(JavaLanguageVersion.of(8))
13+
// Azul covers the most platforms for Java 8 toolchains, crucially including MacOS arm64
14+
vendor.set(org.gradle.jvm.toolchain.JvmVendorSpec.AZUL)
15+
}
2416
}
2517

26-
sourceCompatibility = JavaVersion.VERSION_1_8
27-
targetCompatibility = JavaVersion.VERSION_1_8
18+
minecraft {
19+
mcVersion.set(minecraft_version)
20+
username.set("Developer")
2821

29-
archivesBaseName = "${project.archives_base_name}-mc${project.minecraft_version}"
30-
version = project.mod_version
31-
group = project.maven_group
22+
injectedTags.put("MOD_VERSION", mod_version)
23+
injectedTags.put("MOD_NAME", "Vintagium")
24+
}
25+
26+
tasks.injectTags.outputClassName.set("${mod_base_package}.Tags")
27+
28+
tasks.deobfuscateMergedJarToSrg.configure {accessTransformerFiles.from("src/main/resources/META-INF/oculus_at.cfg")}
3229

3330
repositories {
3431
mavenLocal()
32+
maven { url "https://maven.cleanroommc.com" }
33+
maven {
34+
name 'SpongePowered Maven'
35+
url 'https://repo.spongepowered.org/maven'
36+
}
3537
maven {
3638
name = "CurseForge"
3739
url = "https://cursemaven.com"
@@ -49,15 +51,18 @@ repositories {
4951
}
5052

5153
dependencies {
52-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
53-
mappings loom.officialMojangMappings()
54-
forge "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
55-
56-
modCompileOnly "maven.modrinth:rubidium:0.2.13"
57-
//modCompileOnly "me.jellysquid.mods:Rubidium:0.2.13"
58-
modCompileOnly "curse.maven:epic-fight-mod-405076:4029362"
59-
60-
modRuntimeOnly "curse.maven:lazydfu-460819:3249059"
54+
def mixinBooter = modUtils.enableMixins("zone.rong:mixinbooter:8.9", "oculus-mixins-refmap.json")
55+
api (mixinBooter) {
56+
transitive = false
57+
}
58+
annotationProcessor "org.ow2.asm:asm-debug-all:5.2"
59+
annotationProcessor "com.google.guava:guava:32.1.2-jre"
60+
annotationProcessor "com.google.code.gson:gson:2.8.9"
61+
annotationProcessor (mixinBooter) {
62+
transitive = false
63+
}
64+
65+
//modCompileOnly "maven.modrinth:rubidium:0.2.13"
6166

6267
implementation(shadow(project(path: ":glsl-relocated", configuration: "bundledJar"))) {
6368
transitive = false
@@ -66,27 +71,20 @@ dependencies {
6671
transitive = false
6772
}
6873
shadow("org.slf4j:slf4j-api:1.7.12") // for jcpp
69-
}
70-
71-
processResources {
72-
inputs.property "version", project.version
73-
74-
filesMatching("META-INF/mods.toml") {
75-
expand "version": project.version
76-
}
77-
}
78-
79-
tasks.withType(JavaCompile).configureEach {
80-
it.options.encoding = "UTF-8"
8174

82-
def targetVersion = 8
83-
if (JavaVersion.current().isJava9Compatible()) {
84-
it.options.release = targetVersion
85-
}
75+
implementation fileTree(dir: 'libs', include: ['*.jar'])
8676
}
8777

88-
java {
89-
withSourcesJar()
78+
processResources {
79+
filesMatching("mcmod.info") { fcd ->
80+
fcd.expand(
81+
'mod_id': project.mod_id,
82+
'mod_name': project.mod_name,
83+
'mod_version': project.mod_version,
84+
'mod_description': project.mod_description,
85+
'minecraft_version': project.minecraft_version
86+
)
87+
}
9088
}
9189

9290
shadowJar {
@@ -105,25 +103,4 @@ shadowJar {
105103
'Main-Class': 'net.coderbot.iris.LaunchWarn'
106104
)
107105
}
108-
}
109-
110-
remapJar {
111-
input.set shadowJar.archiveFile
112-
dependsOn shadowJar
113-
}
114-
115-
publishing {
116-
publications {
117-
mavenJava(MavenPublication) {
118-
artifact(remapJar) {
119-
builtBy remapJar
120-
}
121-
artifact(sourcesJar) {
122-
builtBy remapSourcesJar
123-
}
124-
}
125-
}
126-
127-
repositories {
128-
}
129-
}
106+
}

gradle.properties

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# Done to increase the memory available to gradle.
2-
org.gradle.jvmargs=-Xmx6G
2+
org.gradle.jvmargs=-Xmx3G
33

4-
# Fabric Properties
5-
minecraft_version=1.16.5
6-
yarn_mappings=1.16.5+build.10
7-
loader_version=0.13.2
4+
minecraft_version=1.12.2
5+
minecraft_version_range=[1.12,1.13)
6+
forge_version=14.23.5.2860
7+
forge_version_range=[23,)
8+
loader_version_range=[23,)
9+
mappings_channel=stable
10+
mappings_version=39-1.12
811

912
# Mod Properties
10-
mod_version = 1.4.8
11-
maven_group = net.coderbot
12-
archives_base_name = oculus
13-
14-
forge_version=36.2.29
15-
16-
loom.platform=forge
17-
18-
# Dependencies
19-
fabric_version=0.42.0+1.16
13+
mod_id=oculus
14+
mod_name=Oculus
15+
mod_main_class=Iris
16+
mod_version = 1.4.7
17+
mod_base_package = net.coderbot.iris
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

libs/vintagium-mc1.12.2-0.1-dev.jar

1.18 MB
Binary file not shown.

settings.gradle

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
pluginManagement {
22
repositories {
3+
gradlePluginPortal()
4+
maven { url = 'https://gitlab.com/api/v4/projects/26758973/packages/maven' }
35
maven {
4-
name = 'Fabric'
5-
url = 'https://maven.fabricmc.net/'
6+
// RetroFuturaGradle
7+
name = "GTNH Maven"
8+
url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/")
9+
allowInsecureProtocol = true
10+
mavenContent {
11+
includeGroup("com.gtnewhorizons")
12+
includeGroup("com.gtnewhorizons.retrofuturagradle")
13+
}
614
}
7-
maven { url "https://maven.architectury.dev/" }
8-
maven { url "https://files.minecraftforge.net/maven/" }
9-
gradlePluginPortal()
1015
}
1116
}
1217

13-
include("glsl-relocated")
18+
plugins {
19+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
20+
}
21+
22+
23+
rootProject.name = "${mod_name}"
24+
25+
include("glsl-relocated")
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
package it.unimi.dsi.fastutil;
2+
3+
public final class SafeMath {
4+
private SafeMath() {
5+
}
6+
7+
public static char safeIntToChar(int value) {
8+
if (value >= 0 && 65535 >= value) {
9+
return (char)value;
10+
} else {
11+
throw new IllegalArgumentException(value + " can't be represented as char");
12+
}
13+
}
14+
15+
public static byte safeIntToByte(int value) {
16+
if (value >= -128 && 127 >= value) {
17+
return (byte)value;
18+
} else {
19+
throw new IllegalArgumentException(value + " can't be represented as byte (out of range)");
20+
}
21+
}
22+
23+
public static short safeIntToShort(int value) {
24+
if (value >= -32768 && 32767 >= value) {
25+
return (short)value;
26+
} else {
27+
throw new IllegalArgumentException(value + " can't be represented as short (out of range)");
28+
}
29+
}
30+
31+
public static char safeLongToChar(long value) {
32+
if (value >= 0L && 65535L >= value) {
33+
return (char)((int)value);
34+
} else {
35+
throw new IllegalArgumentException(value + " can't be represented as int (out of range)");
36+
}
37+
}
38+
39+
public static byte safeLongToByte(long value) {
40+
if (value >= -128L && 127L >= value) {
41+
return (byte)((int)value);
42+
} else {
43+
throw new IllegalArgumentException(value + " can't be represented as int (out of range)");
44+
}
45+
}
46+
47+
public static short safeLongToShort(long value) {
48+
if (value >= -32768L && 32767L >= value) {
49+
return (short)((int)value);
50+
} else {
51+
throw new IllegalArgumentException(value + " can't be represented as int (out of range)");
52+
}
53+
}
54+
55+
public static int safeLongToInt(long value) {
56+
if (value >= -2147483648L && 2147483647L >= value) {
57+
return (int)value;
58+
} else {
59+
throw new IllegalArgumentException(value + " can't be represented as int (out of range)");
60+
}
61+
}
62+
63+
public static float safeDoubleToFloat(double value) {
64+
if (Double.isNaN(value)) {
65+
return Float.NaN;
66+
} else if (Double.isInfinite(value)) {
67+
return value < 0.0 ? Float.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY;
68+
} else if (!(value < -Float.MAX_VALUE) && !(Float.MAX_VALUE < value)) {
69+
float floatValue = (float)value;
70+
if ((double)floatValue != value) {
71+
throw new IllegalArgumentException(value + " can't be represented as float (imprecise)");
72+
} else {
73+
return floatValue;
74+
}
75+
} else {
76+
throw new IllegalArgumentException(value + " can't be represented as float (out of range)");
77+
}
78+
}
79+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package it.unimi.dsi.fastutil.booleans;
2+
3+
import java.util.Objects;
4+
import java.util.function.Consumer;
5+
6+
@FunctionalInterface
7+
public interface BooleanConsumer extends Consumer<Boolean> {
8+
void accept(boolean var1);
9+
10+
@Deprecated
11+
default void accept(Boolean t) {
12+
this.accept(t.booleanValue());
13+
}
14+
15+
default BooleanConsumer andThen(BooleanConsumer after) {
16+
Objects.requireNonNull(after);
17+
return t -> {
18+
this.accept(t);
19+
after.accept(t);
20+
};
21+
}
22+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package it.unimi.dsi.fastutil.floats;
2+
3+
import it.unimi.dsi.fastutil.SafeMath;
4+
import java.util.Objects;
5+
import java.util.function.Consumer;
6+
import java.util.function.DoubleConsumer;
7+
8+
@FunctionalInterface
9+
public interface FloatConsumer extends Consumer<Float>, DoubleConsumer {
10+
void accept(float var1);
11+
12+
@Deprecated
13+
default void accept(double t) {
14+
this.accept(SafeMath.safeDoubleToFloat(t));
15+
}
16+
17+
@Deprecated
18+
default void accept(Float t) {
19+
this.accept(t.floatValue());
20+
}
21+
22+
default FloatConsumer andThen(FloatConsumer after) {
23+
Objects.requireNonNull(after);
24+
return t -> {
25+
this.accept(t);
26+
after.accept(t);
27+
};
28+
}
29+
30+
default FloatConsumer andThen(DoubleConsumer after) {
31+
return this.andThen(after instanceof FloatConsumer ? (FloatConsumer)after : after::accept);
32+
}
33+
}

0 commit comments

Comments
 (0)