Browse Source

initial update to 1.15

Kajetan Johannes Hammerle 4 years ago
parent
commit
599106e06e

+ 3 - 7
build.gradle

@@ -10,17 +10,13 @@ buildscript {
 }
 apply plugin: 'net.minecraftforge.gradle'
 // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
-//apply plugin: 'eclipse'
-//apply plugin: 'maven-publish'
 
 version = '1.0'
 group = 'me.hammerle.ktcm'
 archivesBaseName = 'ktcm'
 
-sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
-
 minecraft {
-    mappings channel: 'snapshot', version: '20190719-1.14.3'
+    mappings channel: 'snapshot', version: '20200214-1.15.1'
 
     runs {
         client {
@@ -38,5 +34,5 @@ minecraft {
 }
 
 dependencies {
-    minecraft 'net.minecraftforge:forge:1.14.4-28.1.90'
-}
+    minecraft 'net.minecraftforge:forge:1.15.2-31.1.0'
+}

+ 1 - 1
src/main/java/me/ktcm/text/ModTextFormatting.java → src/main/java/me/ktcm/ModTextFormatting.java

@@ -1,4 +1,4 @@
-package me.ktcm.text;
+package me.ktcm;
 
 import java.util.Locale;
 import javax.annotation.Nullable;

+ 2 - 2
src/main/resources/META-INF/mods.toml

@@ -1,5 +1,5 @@
 modLoader="javafml"
-loaderVersion="[28,)"
+loaderVersion="[31,)"
 [[mods]]
 modId="ktcm"
 version="0.0.1"
@@ -9,4 +9,4 @@ credits="kajetanjohannes"
 authors="kajetanjohannes"
 description='''
 Kajetans Text Core Mod for Mundus Crassus
-'''
+'''

+ 8 - 7
src/main/resources/class_transformer/font_renderer.js

@@ -14,14 +14,15 @@ function initializeCoreMod() {
             'transformer': function (classNode) {
                 var methods = classNode.methods;
                 
-                var targetMethodName = ASMAPI.mapMethod("func_211843_b"); // renderStringAtPos
-                var targetMethodDesc = "(Ljava/lang/String;FFIZ)F";                
+                var targetMethodName = ASMAPI.mapMethod("func_228081_c_"); // renderStringAtPos
+                var targetMethodDesc = "(Ljava/lang/String;FFIZLnet/minecraft/client/renderer/Matrix4f;Lnet/minecraft/client/renderer/IRenderTypeBuffer;ZII)F";                
 
                 for (var i in methods)
                 {
                     var method = methods[i];
                     if (method.name.equals(targetMethodName) && method.desc.equals(targetMethodDesc))
                     {
+                        print(method.name + " " + method.desc);
                         transform(method);
                         break;
                     }
@@ -41,14 +42,14 @@ function transform(method)
         if(instr instanceof MethodInsnNode && instr.owner.equals("net/minecraft/util/text/TextFormatting"))
         {
             instrList.remove(instr);
-            instrList.insert(instrList.get(i - 1), new MethodInsnNode(instr.getOpcode(), "me/ktcm/text/ModTextFormatting", 
-                ASMAPI.mapMethod(instr.name), instr.desc.replace("net/minecraft/util/text/TextFormatting", "me/ktcm/text/ModTextFormatting"), false));
+            instrList.insert(instrList.get(i - 1), new MethodInsnNode(instr.getOpcode(), "me/ktcm/ModTextFormatting", 
+                ASMAPI.mapMethod(instr.name), instr.desc.replace("net/minecraft/util/text/TextFormatting", "me/ktcm/ModTextFormatting"), false));
         }
         else if(instr instanceof FieldInsnNode && instr.owner.equals("net/minecraft/util/text/TextFormatting"))
         {
             instrList.remove(instr);
-            instrList.insert(instrList.get(i - 1), new FieldInsnNode(instr.getOpcode(), "me/ktcm/text/ModTextFormatting", 
-                ASMAPI.mapField(instr.name), instr.desc.replace("net/minecraft/util/text/TextFormatting", "me/ktcm/text/ModTextFormatting")));
+            instrList.insert(instrList.get(i - 1), new FieldInsnNode(instr.getOpcode(), "me/ktcm/ModTextFormatting", 
+                ASMAPI.mapField(instr.name), instr.desc.replace("net/minecraft/util/text/TextFormatting", "me/ktcm/ModTextFormatting")));
         }
     }
-}
+}

+ 2 - 2
src/main/resources/pack.mcmeta

@@ -1,7 +1,7 @@
 {
     "pack": {
         "description": "ktcm resources",
-        "pack_format": 4,
-        "_comment": "A pack_format of 4 requires json lang files. Note: we require v4 pack meta for all mods."
+        "pack_format": 5,
+        "_comment": "A pack_format of 5 requires json lang files and some texture changes from 1.15. Note: we require v5 pack meta for all mods."
     }
 }