diff --git a/build.gradle b/build.gradle index 6d8a296a..1bdae641 100644 --- a/build.gradle +++ b/build.gradle @@ -155,8 +155,7 @@ test { useJUnitPlatform() } -runClient.outputs.upToDateWhen { false } -runServer.outputs.upToDateWhen { false } +runClient.inputs.property("always_changed", new Date()) apply from: "./processMods.gradle" apply from: "./makePatch.gradle" diff --git a/important-structure/fields-RTMResource.txt b/important-structure/fields-RTMResource.txt index ec0c2ec9..2c8972e0 100644 --- a/important-structure/fields-RTMResource.txt +++ b/important-structure/fields-RTMResource.txt @@ -25,6 +25,9 @@ type: Ljp/ngt/rtm/modelpack/ResourceType; name: RRS type: Ljp/ngt/rtm/modelpack/ResourceType; +name: MECHANISM +type: Ljp/ngt/rtm/modelpack/ResourceType; + name: CONNECTOR type: Ljp/ngt/rtm/modelpack/ResourceType; @@ -121,3 +124,6 @@ type: Ljp/ngt/rtm/modelpack/ResourceType; name: VEHICLE_TROLLEY type: Ljp/ngt/rtm/modelpack/ResourceType; +name: VEHICLE_LIFT +type: Ljp/ngt/rtm/modelpack/ResourceType; + diff --git a/important-structure/fields-ResourceConfig/jp/ngt/rtm/block/tileentity/MechanismType.txt b/important-structure/fields-ResourceConfig/jp/ngt/rtm/block/tileentity/MechanismType.txt new file mode 100644 index 00000000..f9c9bc0c --- /dev/null +++ b/important-structure/fields-ResourceConfig/jp/ngt/rtm/block/tileentity/MechanismType.txt @@ -0,0 +1,4 @@ +super: java/lang/Enum +name: useRS +type: Z + diff --git a/important-structure/fields-ResourceConfig/jp/ngt/rtm/modelpack/cfg/MechanismConfig.txt b/important-structure/fields-ResourceConfig/jp/ngt/rtm/modelpack/cfg/MechanismConfig.txt new file mode 100644 index 00000000..f2913b36 --- /dev/null +++ b/important-structure/fields-ResourceConfig/jp/ngt/rtm/modelpack/cfg/MechanismConfig.txt @@ -0,0 +1,31 @@ +super: jp/ngt/rtm/modelpack/cfg/ModelConfig +name: acceleration +type: F + +name: maxSpeed +type: F + +name: model +type: Ljp/ngt/rtm/modelpack/cfg/ModelConfig$ModelSource; + +name: name +type: Ljava/lang/String; + +name: radius +type: F + +name: teethCount +type: I + +name: transmissionRatioOFF +type: [F + +name: transmissionRatioON +type: [F + +name: type +type: Ljp/ngt/rtm/block/tileentity/MechanismType; + +name: useRedstonePower +type: Z + diff --git a/important-structure/fields-ResourceConfig/jp/ngt/rtm/modelpack/cfg/VehicleConfig.txt b/important-structure/fields-ResourceConfig/jp/ngt/rtm/modelpack/cfg/VehicleConfig.txt index 0054dd52..ef539353 100644 --- a/important-structure/fields-ResourceConfig/jp/ngt/rtm/modelpack/cfg/VehicleConfig.txt +++ b/important-structure/fields-ResourceConfig/jp/ngt/rtm/modelpack/cfg/VehicleConfig.txt @@ -11,6 +11,9 @@ type: F name: friction type: [F +name: gripPos +type: [F + name: hoveringSpeed type: F diff --git a/important-structure/fields-ResourceSet/jp/ngt/rtm/modelpack/modelset/ModelSetMechanism.txt b/important-structure/fields-ResourceSet/jp/ngt/rtm/modelpack/modelset/ModelSetMechanism.txt new file mode 100644 index 00000000..e5ad62c0 --- /dev/null +++ b/important-structure/fields-ResourceSet/jp/ngt/rtm/modelpack/modelset/ModelSetMechanism.txt @@ -0,0 +1 @@ +super: jp/ngt/rtm/modelpack/modelset/ModelSetBase diff --git a/patches/ngtlib.patch b/patches/ngtlib.patch index e75366f5..9a6bd244 100644 --- a/patches/ngtlib.patch +++ b/patches/ngtlib.patch @@ -1,230 +1,3 @@ -diff --git a/mods/ngtlib.deobf.jar.src.processed/jp/ngt/ngtlib/command/CommandPermit.jasm b/src/main/ngtlib/jp/ngt/ngtlib/command/CommandPermit.jasm -index 89cf20c..87dcf37 100644 ---- a/mods/ngtlib.deobf.jar.src.processed/jp/ngt/ngtlib/command/CommandPermit.jasm -+++ b/src/main/ngtlib/jp/ngt/ngtlib/command/CommandPermit.jasm -@@ -42,56 +42,57 @@ L_0004: - .limit local 2 - L_0000: - .line 29 - .var 0 is this Ljp/ngt/ngtlib/command/CommandPermit; from L_0000 to L_0004 - .var 1 is sender Lnet/minecraft/command/ICommandSender; from L_0000 to L_0004 - ldc "commands.permit.usage" - areturn - L_0004: - .end method - -+.method private static getPlayerOrNull "(Lnet/minecraft/command/ICommandSender;)Lnet/minecraft/entity/player/EntityPlayerMP;" -+ .limit stack 1 -+ .limit local 1 -+ .catch net/minecraft/command/PlayerNotFoundException from L_start to L_catch using L_catch -+ -+L_start: -+ .line 1038 -+ .var 0 is sender Lnet/minecraft/command/ICommandSender; from L_start to L_end -+ aload 0 -+ invokestatic jp/ngt/ngtlib/command/CommandPermit/getCommandSenderAsPlayer (Lnet/minecraft/command/ICommandSender;)Lnet/minecraft/entity/player/EntityPlayerMP; -+ areturn -+L_catch: -+ .line 1042 -+ .stack -+ locals Object net/minecraft/command/ICommandSender -+ stacks Object net/minecraft/command/PlayerNotFoundException -+ .end stack -+ pop -+ aconst_null -+ areturn -+L_end: -+ -+.end method -+ - .method public execute "(Lnet/minecraft/server/MinecraftServer;Lnet/minecraft/command/ICommandSender;[Ljava/lang/String;)V" - .throws net/minecraft/command/CommandException - .limit stack 4 - .limit local 7 -- .catch net/minecraft/command/PlayerNotFoundException from L_0000 to L_0005 using L_0008 - L_0000: -- .line 38 -+ .line 43 - .var 0 is this Ljp/ngt/ngtlib/command/CommandPermit; from L_0000 to L_009c - .var 1 is server Lnet/minecraft/server/MinecraftServer; from L_0000 to L_009c - .var 2 is sender Lnet/minecraft/command/ICommandSender; from L_0000 to L_009c - .var 3 is args "[Ljava/lang/String;" from L_0000 to L_009c -- aload 2 -- invokestatic jp/ngt/ngtlib/command/CommandPermit/getCommandSenderAsPlayer (Lnet/minecraft/command/ICommandSender;)Lnet/minecraft/entity/player/EntityPlayerMP; -+ aconst_null - astore 4 --L_0005: -- .line 44 -- .var 4 is player Lnet/minecraft/entity/player/EntityPlayerMP; from L_0005 to L_0008 -- goto L_0013 --L_0008: -- .line 40 -- .stack -- locals Object jp/ngt/ngtlib/command/CommandPermit -- locals Object net/minecraft/server/MinecraftServer -- locals Object net/minecraft/command/ICommandSender -- locals Object "[Ljava/lang/String;" -- stacks Object net/minecraft/command/PlayerNotFoundException -- .end stack -- astore 5 --L_000c: -- .line 42 -- .var 5 is e Lnet/minecraft/command/PlayerNotFoundException; from L_000c to L_0013 -- aload 5 -- invokevirtual net/minecraft/command/PlayerNotFoundException/printStackTrace ()V --L_0010: -- .line 43 -- return -+ - L_0013: - .line 46 - .var 4 is player Lnet/minecraft/entity/player/EntityPlayerMP; from L_0013 to L_009c - .stack - locals Object jp/ngt/ngtlib/command/CommandPermit - locals Object net/minecraft/server/MinecraftServer - locals Object net/minecraft/command/ICommandSender - locals Object "[Ljava/lang/String;" - locals Object net/minecraft/entity/player/EntityPlayerMP - .end stack -@@ -102,44 +103,45 @@ L_0019: - .line 48 - aload 3 - iconst_0 - aaload - ldc "list" - invokevirtual java/lang/String/equals (Ljava/lang/Object;)Z - ifeq L_0029 - L_0021: - .line 50 - getstatic jp/ngt/ngtlib/util/PermissionManager/INSTANCE Ljp/ngt/ngtlib/util/PermissionManager; -- aload 4 -- invokevirtual jp/ngt/ngtlib/util/PermissionManager/showPermissionList (Lnet/minecraft/entity/player/EntityPlayer;)V -+ aload 2 -+ invokevirtual jp/ngt/ngtlib/util/PermissionManager/showPermissionList (Lnet/minecraft/command/ICommandSender;)V - L_0026: - .line 51 - return - L_0029: - .line 53 - .stack use locals - .end stack - aload 3 - iconst_0 - aaload - ldc "myname" - invokevirtual java/lang/String/equals (Ljava/lang/Object;)Z - ifeq L_0044 - L_0032: - .line 55 -- aload 4 -+ aload 2 - new java/lang/StringBuilder - dup - invokespecial java/lang/StringBuilder/ ()V - ldc "My name is " - invokevirtual java/lang/StringBuilder/append (Ljava/lang/String;)Ljava/lang/StringBuilder; -- aload 4 -+ aload 2 -+ invokestatic jp/ngt/ngtlib/command/CommandPermit/getCommandSenderAsPlayer (Lnet/minecraft/command/ICommandSender;)Lnet/minecraft/entity/player/EntityPlayerMP; - invokevirtual net/minecraft/entity/player/EntityPlayerMP/getName ()Ljava/lang/String; - invokevirtual java/lang/StringBuilder/append (Ljava/lang/String;)Ljava/lang/StringBuilder; - invokevirtual java/lang/StringBuilder/toString ()Ljava/lang/String; - iconst_0 - anewarray java/lang/Object - invokestatic jp/ngt/ngtlib/io/NGTLog/sendChatMessage "(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;[Ljava/lang/Object;)V" - L_0041: - .line 56 - return - L_0044: -@@ -168,21 +170,22 @@ L_0057: - .var 6 is target Ljava/lang/String; from L_0057 to L_007c - aload 3 - iconst_0 - aaload - ldc "add" - invokevirtual java/lang/String/equals (Ljava/lang/Object;)Z - ifeq L_0069 - L_005f: - .line 65 - getstatic jp/ngt/ngtlib/util/PermissionManager/INSTANCE Ljp/ngt/ngtlib/util/PermissionManager; -- aload 4 -+ aload 2 -+ invokestatic jp/ngt/ngtlib/command/CommandPermit/getPlayerOrNull (Lnet/minecraft/command/ICommandSender;)Lnet/minecraft/entity/player/EntityPlayerMP; - aload 5 - aload 6 - invokevirtual jp/ngt/ngtlib/util/PermissionManager/addPermission (Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;Ljava/lang/String;)V - L_0066: - .line 66 - return - L_0069: - .line 68 - .stack - locals Object jp/ngt/ngtlib/command/CommandPermit -@@ -195,58 +198,59 @@ L_0069: - .end stack - aload 3 - iconst_0 - aaload - ldc "remove" - invokevirtual java/lang/String/equals (Ljava/lang/Object;)Z - ifeq L_007c - L_0072: - .line 70 - getstatic jp/ngt/ngtlib/util/PermissionManager/INSTANCE Ljp/ngt/ngtlib/util/PermissionManager; -- aload 4 -+ aload 2 -+ invokestatic jp/ngt/ngtlib/command/CommandPermit/getPlayerOrNull (Lnet/minecraft/command/ICommandSender;)Lnet/minecraft/entity/player/EntityPlayerMP; - aload 5 - aload 6 - invokevirtual jp/ngt/ngtlib/util/PermissionManager/removePermission (Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;Ljava/lang/String;)V - L_0079: - .line 71 - return - L_007c: - .line 76 - .stack - locals Object jp/ngt/ngtlib/command/CommandPermit - locals Object net/minecraft/server/MinecraftServer - locals Object net/minecraft/command/ICommandSender - locals Object "[Ljava/lang/String;" - locals Object net/minecraft/entity/player/EntityPlayerMP - .end stack -- aload 4 -+ aload 2 - ldc "/permit add " - iconst_0 - anewarray java/lang/Object - invokestatic jp/ngt/ngtlib/io/NGTLog/sendChatMessage "(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;[Ljava/lang/Object;)V" - L_0084: - .line 77 -- aload 4 -+ aload 2 - ldc "/permit remove " - iconst_0 - anewarray java/lang/Object - invokestatic jp/ngt/ngtlib/io/NGTLog/sendChatMessage "(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;[Ljava/lang/Object;)V" - L_008b: - .line 78 -- aload 4 -+ aload 2 - ldc "/permit list" - iconst_0 - anewarray java/lang/Object - invokestatic jp/ngt/ngtlib/io/NGTLog/sendChatMessage "(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;[Ljava/lang/Object;)V" - L_0092: - .line 79 -- aload 4 -+ aload 2 - ldc "/permit myname" - iconst_0 - anewarray java/lang/Object - invokestatic jp/ngt/ngtlib/io/NGTLog/sendChatMessage "(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;[Ljava/lang/Object;)V" - L_0099: - .line 80 - return - L_009c: - .end method - diff --git a/mods/ngtlib.deobf.jar.src.processed/jp/ngt/ngtlib/io/NGTLog.jasm b/src/main/ngtlib/jp/ngt/ngtlib/io/NGTLog.jasm index ea31691..427b9b6 100644 --- a/mods/ngtlib.deobf.jar.src.processed/jp/ngt/ngtlib/io/NGTLog.jasm @@ -576,138 +349,24 @@ index 5d26e9d..84909bf 100644 areturn L_0005: diff --git a/mods/ngtlib.deobf.jar.src.processed/jp/ngt/ngtlib/util/PermissionManager.jasm b/src/main/ngtlib/jp/ngt/ngtlib/util/PermissionManager.jasm -index e394adf..409cde6 100644 +index e68c287..1bf8d1c 100644 --- a/mods/ngtlib.deobf.jar.src.processed/jp/ngt/ngtlib/util/PermissionManager.jasm +++ b/src/main/ngtlib/jp/ngt/ngtlib/util/PermissionManager.jasm -@@ -403,35 +403,46 @@ L_0011: - aload 0 - getfield jp/ngt/ngtlib/util/PermissionManager/permissionMap Ljava/util/Map; - aload 1 - invokeinterface java/util/Map/get (Ljava/lang/Object;)Ljava/lang/Object; - checkcast java/util/List - areturn - L_001a: - .end method - - .method public showPermissionList (Lnet/minecraft/entity/player/EntityPlayer;)V -+ .limit stack 2 -+ .limit local 2 -+ -+ aload 0 -+ aload 1 -+ invokevirtual jp/ngt/ngtlib/util/PermissionManager/showPermissionList (Lnet/minecraft/command/ICommandSender;)V -+ return -+ -+.end method -+ -+.method public showPermissionList (Lnet/minecraft/command/ICommandSender;)V - .limit stack 3 - .limit local 7 - L_0000: - .line 98 - .var 0 is this Ljp/ngt/ngtlib/util/PermissionManager; from L_0000 to L_004b -- .var 1 is player Lnet/minecraft/entity/player/EntityPlayer; from L_0000 to L_004b -+ .var 1 is player Lnet/minecraft/command/ICommandSender; from L_0000 to L_004b - aload 0 - getfield jp/ngt/ngtlib/util/PermissionManager/permissionMap Ljava/util/Map; - invokeinterface java/util/Map/entrySet ()Ljava/util/Set; - invokeinterface java/util/Set/iterator ()Ljava/util/Iterator; - astore 2 - L_0007: - .stack - locals Object jp/ngt/ngtlib/util/PermissionManager -- locals Object net/minecraft/entity/player/EntityPlayer -+ locals Object net/minecraft/command/ICommandSender - locals Object java/util/Iterator - .end stack - aload 2 - invokeinterface java/util/Iterator/hasNext ()Z - ifeq L_0047 - aload 2 - invokeinterface java/util/Iterator/next ()Ljava/lang/Object; - checkcast java/util/Map$Entry - astore 3 - L_0010: -@@ -455,21 +466,21 @@ L_0016: - L_0020: - .line 102 - aload 3 - invokeinterface java/util/Map$Entry/getValue ()Ljava/lang/Object; - checkcast java/util/List - invokeinterface java/util/List/iterator ()Ljava/util/Iterator; - astore 5 - L_0027: - .stack - locals Object jp/ngt/ngtlib/util/PermissionManager -- locals Object net/minecraft/entity/player/EntityPlayer -+ locals Object net/minecraft/command/ICommandSender - locals Object java/util/Iterator - locals Object java/util/Map$Entry - locals Object java/lang/StringBuilder - locals Object java/util/Iterator - .end stack - aload 5 - invokeinterface java/util/Iterator/hasNext ()Z - ifeq L_003b - aload 5 - invokeinterface java/util/Iterator/next ()Ljava/lang/Object; -@@ -484,39 +495,39 @@ L_0030: - ldc "," - invokevirtual java/lang/StringBuilder/append (Ljava/lang/String;)Ljava/lang/StringBuilder; - pop - L_0038: - .line 105 - goto L_0027 - L_003b: - .line 106 - .stack - locals Object jp/ngt/ngtlib/util/PermissionManager -- locals Object net/minecraft/entity/player/EntityPlayer -+ locals Object net/minecraft/command/ICommandSender - locals Object java/util/Iterator - locals Object java/util/Map$Entry - locals Object java/lang/StringBuilder - .end stack - aload 1 - aload 4 - invokevirtual java/lang/StringBuilder/toString ()Ljava/lang/String; - iconst_0 - anewarray java/lang/Object - invokestatic jp/ngt/ngtlib/io/NGTLog/sendChatMessage "(Lnet/minecraft/command/ICommandSender;Ljava/lang/String;[Ljava/lang/Object;)V" - L_0044: - .line 107 - goto L_0007 - L_0047: - .line 108 - .stack - locals Object jp/ngt/ngtlib/util/PermissionManager -- locals Object net/minecraft/entity/player/EntityPlayer -+ locals Object net/minecraft/command/ICommandSender - .end stack - return - L_004b: - .end method - - .method public addPermission (Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;Ljava/lang/String;)V - .limit stack 5 - .limit local 4 - L_0000: - .line 112 -@@ -634,24 +645,46 @@ L_0029: +@@ -664,24 +664,46 @@ L_0029: .stack use locals .end stack return L_002d: .end method - .method public hasPermission (Lnet/minecraft/entity/player/EntityPlayer;Ljava/lang/String;)Z + .method public hasPermission (Lnet/minecraft/command/ICommandSender;Ljava/lang/String;)Z .limit stack 5 - .limit local 3 + .limit local 4 L_0000: -- .line 140 - .var 0 is this Ljp/ngt/ngtlib/util/PermissionManager; from L_0000 to L_002c - .var 1 is player Lnet/minecraft/entity/player/EntityPlayer; from L_0000 to L_002c - .var 2 is category Ljava/lang/String; from L_0000 to L_002c +- .line 151 + .var 0 is this Ljp/ngt/ngtlib/util/PermissionManager; from L_0000 to L_0035 + .var 1 is player Lnet/minecraft/command/ICommandSender; from L_0000 to L_0035 + .var 2 is category Ljava/lang/String; from L_0000 to L_0035 + + .line 2146 + getstatic com/anatawa12/fixRtm/asm/config/MainConfig/addNegativePermissionEnabled Z @@ -719,7 +378,7 @@ index e394adf..409cde6 100644 + invokevirtual java/lang/String/concat (Ljava/lang/String;)Ljava/lang/String; + invokevirtual jp/ngt/ngtlib/util/PermissionManager/getPlayerList (Ljava/lang/String;)Ljava/util/List; + aload 1 -+ invokevirtual net/minecraft/entity/player/EntityPlayer/getName ()Ljava/lang/String; ++ invokeinterface net/minecraft/command/ICommandSender/getName ()Ljava/lang/String; + invokeinterface java/util/List/contains (Ljava/lang/Object;)Z + ifeq L_if_has_negative_permit + goto L_no_permission @@ -727,35 +386,36 @@ index e394adf..409cde6 100644 + .line 140 + .stack + locals Object jp/ngt/ngtlib/util/PermissionManager -+ locals Object net/minecraft/entity/player/EntityPlayer ++ locals Object net/minecraft/command/ICommandSender + locals Object java/lang/String + .end stack + aload 0 aload 1 - invokevirtual jp/ngt/ngtlib/util/PermissionManager/isOp (Lnet/minecraft/entity/player/EntityPlayer;)Z + invokevirtual jp/ngt/ngtlib/util/PermissionManager/isOp (Lnet/minecraft/command/ICommandSender;)Z ifeq L_000a L_0006: - .line 142 + .line 153 iconst_1 ireturn L_000a: - .line 146 -@@ -665,20 +698,40 @@ L_000a: - invokevirtual jp/ngt/ngtlib/util/PermissionManager/getPlayerList (Ljava/lang/String;)Ljava/util/List; - aload 1 - invokevirtual net/minecraft/entity/player/EntityPlayer/getName ()Ljava/lang/String; - invokeinterface java/util/List/contains (Ljava/lang/Object;)Z - ifeq L_0018 - L_0014: - .line 148 + .line 157 +@@ -710,23 +732,46 @@ L_001c: + .line 160 + .stack + locals Object jp/ngt/ngtlib/util/PermissionManager + locals Object net/minecraft/command/ICommandSender + locals Object java/lang/String + locals Object java/util/List + .end stack iconst_1 ireturn - L_0018: + L_0021: +- .line 164 + + .line 1146 -+ .stack use locals -+ .end stack + .stack use locals + .end stack + getstatic com/anatawa12/fixRtm/asm/config/MainConfig/addAllowAllPermissionEnabled Z + ifeq L_if_has_not_all_permit + .line 1147 @@ -763,7 +423,7 @@ index e394adf..409cde6 100644 + ldc "fixrtm.all_permit" + invokevirtual jp/ngt/ngtlib/util/PermissionManager/getPlayerList (Ljava/lang/String;)Ljava/util/List; + aload 1 -+ invokevirtual net/minecraft/entity/player/EntityPlayer/getName ()Ljava/lang/String; ++ invokeinterface net/minecraft/command/ICommandSender/getName ()Ljava/lang/String; + invokeinterface java/util/List/contains (Ljava/lang/Object;)Z + ifeq L_if_has_not_all_permit + .line 1148 @@ -772,24 +432,30 @@ index e394adf..409cde6 100644 +L_if_has_not_all_permit: +L_no_permission: + - .line 152 - .stack use locals - .end stack ++ .line 164 ++ .stack ++ locals Object jp/ngt/ngtlib/util/PermissionManager ++ locals Object net/minecraft/command/ICommandSender ++ locals Object java/lang/String ++ .end stack ldc "%s need permission (%s)." iconst_2 anewarray java/lang/Object dup iconst_0 aload 1 - invokevirtual net/minecraft/entity/player/EntityPlayer/getName ()Ljava/lang/String; -@@ -704,20 +757,32 @@ L_0000: - .var 1 is player Lnet/minecraft/entity/player/EntityPlayer; from L_0000 to L_003f + invokeinterface net/minecraft/command/ICommandSender/getName ()Ljava/lang/String; + aastore + dup + iconst_1 +@@ -749,20 +794,32 @@ L_0000: + .var 1 is player Lnet/minecraft/command/ICommandSender; from L_0000 to L_004d getstatic jp/ngt/ngtlib/util/PermissionManager/DEBUG_MODE Z ifne L_000a invokestatic jp/ngt/ngtlib/util/NGTUtil/isSMP ()Z ifne L_000a L_0006: - .line 162 + .line 174 iconst_1 ireturn L_000a: @@ -797,7 +463,7 @@ index e394adf..409cde6 100644 + .line 1164 + .stack + locals Object jp/ngt/ngtlib/util/PermissionManager -+ locals Object net/minecraft/entity/player/EntityPlayer ++ locals Object net/minecraft/command/ICommandSender + .end stack + aload 1 + ifnonnull L_player_non_null @@ -805,13 +471,13 @@ index e394adf..409cde6 100644 + ireturn +L_player_non_null: + - .line 164 + .line 176 .stack locals Object jp/ngt/ngtlib/util/PermissionManager - locals Object net/minecraft/entity/player/EntityPlayer + locals Object net/minecraft/command/ICommandSender .end stack aload 1 instanceof net/minecraft/entity/player/EntityPlayerMP - ifeq L_003a + ifeq L_003e L_0010: - .line 166 + .line 178 diff --git a/patches/rtm.patch b/patches/rtm.patch index c51a3b21..50cd1665 100644 --- a/patches/rtm.patch +++ b/patches/rtm.patch @@ -1,32 +1,32 @@ diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/RTMItem.jasm b/src/main/rtm/jp/ngt/rtm/RTMItem.jasm -index 2297030..17edb7e 100644 +index 3762a0f..ee55f17 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/RTMItem.jasm +++ b/src/main/rtm/jp/ngt/rtm/RTMItem.jasm @@ -667,21 +667,21 @@ L_0012: L_0018: - .line 153 + .line 154 getstatic jp/ngt/rtm/RTMItem/itemtrain Lnet/minecraft/item/Item; iconst_3 ldc "item_train_3" invokestatic jp/ngt/rtm/RTMItem/registerItemModel (Lnet/minecraft/item/Item;ILjava/lang/String;)V L_001e: - .line 154 + .line 155 getstatic jp/ngt/rtm/RTMItem/itemtrain Lnet/minecraft/item/Item; bipush 127 - ldc "item_train_127" + ldc "item_train_fixrtm_test" invokestatic jp/ngt/rtm/RTMItem/registerItemModel (Lnet/minecraft/item/Item;ILjava/lang/String;)V L_0024: - .line 155 + .line 156 getstatic jp/ngt/rtm/RTMItem/itemMotorman Lnet/minecraft/item/Item; iconst_0 ldc "item_npc_0" invokestatic jp/ngt/rtm/RTMItem/registerItemModel (Lnet/minecraft/item/Item;ILjava/lang/String;)V L_002a: - .line 156 + .line 157 getstatic jp/ngt/rtm/RTMItem/itemMotorman Lnet/minecraft/item/Item; diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/train/EntityBogie.jasm b/src/main/rtm/jp/ngt/rtm/entity/train/EntityBogie.jasm -index 5ca3be3..92dcff4 100644 +index 58704f1..5e741cc 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/train/EntityBogie.jasm +++ b/src/main/rtm/jp/ngt/rtm/entity/train/EntityBogie.jasm @@ -128,20 +128,22 @@ L_0020: @@ -88,7 +88,7 @@ index 5ca3be3..92dcff4 100644 .method public onBogieUpdate ()V .limit stack 2 diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/train/EntityTrainBase.jasm b/src/main/rtm/jp/ngt/rtm/entity/train/EntityTrainBase.jasm -index 50ba737..796060f 100644 +index 2fe97f1..299abdb 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/train/EntityTrainBase.jasm +++ b/src/main/rtm/jp/ngt/rtm/entity/train/EntityTrainBase.jasm @@ -66,20 +66,23 @@ @@ -405,7 +405,7 @@ index 08fdfe9..a7f5e63 100644 L_0000: .line 404 diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/vehicle/EntityVehicleBase.jasm b/src/main/rtm/jp/ngt/rtm/entity/vehicle/EntityVehicleBase.jasm -index b252a06..595c970 100644 +index 7ae932e..c99504a 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/vehicle/EntityVehicleBase.jasm +++ b/src/main/rtm/jp/ngt/rtm/entity/vehicle/EntityVehicleBase.jasm @@ -271,20 +271,22 @@ L_0061: @@ -431,87 +431,6 @@ index b252a06..595c970 100644 L_0000: .line 105 .var 0 is this Ljp/ngt/rtm/entity/vehicle/EntityVehicleBase; signature "Ljp/ngt/rtm/entity/vehicle/EntityVehicleBase;" from L_0000 to L_0003 -@@ -1068,48 +1070,50 @@ L_0004: - astore 4 - L_000b: - .line 365 - .var 4 is set Ljp/ngt/rtm/modelpack/modelset/ModelSetBase; from L_000b to L_0011 - aload 4 - invokevirtual jp/ngt/rtm/modelpack/modelset/ModelSetBase/getCollisionObj ()Ljp/ngt/rtm/entity/util/CollisionObj; - invokevirtual jp/ngt/rtm/entity/util/CollisionObj/getSizeBox ()Lnet/minecraft/util/math/AxisAlignedBB; - astore 3 - L_0011: - .line 371 -- goto L_0028 -+ goto L_end_try - L_0014: - .line 367 - .stack - locals Object jp/ngt/rtm/entity/vehicle/EntityVehicleBase - locals Object net/minecraft/entity/Entity - locals Object net/minecraft/entity/Entity - locals Object net/minecraft/util/math/AxisAlignedBB - stacks Object java/lang/NullPointerException - .end stack -- astore 4 --L_0018: -- .line 369 -- .var 4 is e Ljava/lang/NullPointerException; from L_0018 to L_0028 -- aload 4 -- invokevirtual java/lang/NullPointerException/printStackTrace ()V -+ pop -+L_end_try: -+ .stack use locals -+ .end stack -+ aload 3 -+ invokestatic com/anatawa12/fixRtm/rtm/HooksKt/fixRiderPosOnDismount_remakeAABB (Lnet/minecraft/util/math/AxisAlignedBB;)Z -+ ifeq L_aabb_remake_end - L_001c: - .line 370 - new net/minecraft/util/math/AxisAlignedBB - dup - ldc -1.5 - dconst_0 - ldc -2.0 - ldc 1.5 - ldc 3.0 - ldc 2.0 - invokespecial net/minecraft/util/math/AxisAlignedBB/ (DDDDDD)V - astore 3 -+L_aabb_remake_end: - L_0028: - .line 375 - .stack use locals - .end stack - aload 2 - getfield net/minecraft/entity/Entity/posX D - aload 0 - getfield jp/ngt/rtm/entity/vehicle/EntityVehicleBase/posX D - dsub - aload 2 -@@ -1228,21 +1232,21 @@ L_0092: - .line 387 - .var 12 is z D from L_0092 to L_00b1 - aload 0 - getfield jp/ngt/rtm/entity/vehicle/EntityVehicleBase/world Lnet/minecraft/world/World; - new net/minecraft/util/math/BlockPos - dup - dload 8 - dload 10 - dload 12 - invokespecial net/minecraft/util/math/BlockPos/ (DDD)V -- invokevirtual net/minecraft/world/World/getTopSolidOrLiquidBlock (Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/BlockPos; -+ invokestatic com/anatawa12/fixRtm/rtm/HooksKt/fixRiderPosOnDismount_calcBestBlockPos (Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/math/BlockPos; - astore 14 - L_009e: - .line 388 - .var 14 is pos Lnet/minecraft/util/math/BlockPos; from L_009e to L_00b1 - aload 1 - aload 14 - invokevirtual net/minecraft/util/math/BlockPos/getX ()I - i2d - ldc 0.5 - dadd diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/vehicle/RenderVehicleBase.jasm b/src/main/rtm/jp/ngt/rtm/entity/vehicle/RenderVehicleBase.jasm index 5298b6c..b941866 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/entity/vehicle/RenderVehicleBase.jasm @@ -1296,7 +1215,7 @@ index e05f400..1418cc5 100644 .end method diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/modelpack/state/ResourceState.jasm b/src/main/rtm/jp/ngt/rtm/modelpack/state/ResourceState.jasm -index 2945cc2..a90bdee 100644 +index a1ac675..2fcbda9 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/modelpack/state/ResourceState.jasm +++ b/src/main/rtm/jp/ngt/rtm/modelpack/state/ResourceState.jasm @@ -350,20 +350,23 @@ L_0009: @@ -1353,7 +1272,7 @@ index 6e5c39c..e670ca1 100644 .var 5 is x D from L_0032 to L_0078 aload 1 diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/rail/BlockMarker.jasm b/src/main/rtm/jp/ngt/rtm/rail/BlockMarker.jasm -index d2c0e4b..6ffb4cc 100644 +index aa59bb1..c959d84 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/rail/BlockMarker.jasm +++ b/src/main/rtm/jp/ngt/rtm/rail/BlockMarker.jasm @@ -527,20 +527,22 @@ L_000f: @@ -1643,7 +1562,7 @@ index 283bb01..efd8f8d 100644 invokespecial java/lang/RuntimeException/ (Ljava/lang/String;Ljava/lang/Throwable;)V athrow diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/render/RTMRenderers.jasm b/src/main/rtm/jp/ngt/rtm/render/RTMRenderers.jasm -index 7cd3941..be222d2 100644 +index 222fb92..39ecbf5 100644 --- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/render/RTMRenderers.jasm +++ b/src/main/rtm/jp/ngt/rtm/render/RTMRenderers.jasm @@ -20,30 +20,48 @@ L_0005: diff --git a/processMods.gradle b/processMods.gradle index cfd172f5..d5a11188 100644 --- a/processMods.gradle +++ b/processMods.gradle @@ -14,13 +14,13 @@ task CopyJarToTest(type: Copy, dependsOn: reobfJar) { task downloadRTM (type: DownloadModJar) { projectId = 288988 - version = "2.4.19" + version = "2.4.20" to = new File(projectDir, "mods/rtm.jar") } task downloadNgtLib (type: DownloadModJar) { projectId = 288989 - version = "2.4.17" + version = "2.4.18" to = new File(projectDir, "mods/ngtlib.jar") } diff --git a/src/main/java/com/anatawa12/fixRtm/rtm/Hooks.kt b/src/main/java/com/anatawa12/fixRtm/rtm/Hooks.kt index 7560975d..b26f7df1 100644 --- a/src/main/java/com/anatawa12/fixRtm/rtm/Hooks.kt +++ b/src/main/java/com/anatawa12/fixRtm/rtm/Hooks.kt @@ -5,12 +5,8 @@ import jp.ngt.ngtlib.renderer.model.ModelFormatException import jp.ngt.rtm.modelpack.ModelPackManager import jp.ngt.rtm.modelpack.ResourceType import jp.ngt.rtm.modelpack.modelset.ResourceSet -import net.minecraft.block.material.Material import net.minecraft.entity.player.EntityPlayer -import net.minecraft.util.math.AxisAlignedBB -import net.minecraft.util.math.BlockPos import net.minecraft.util.text.TextComponentTranslation -import net.minecraft.world.World @Suppress("unused") // Used with Transform fun eraseNullForModelSet(inSet: ResourceSet<*>?, type: ResourceType<*, *>): ResourceSet<*> { @@ -53,33 +49,3 @@ fun sendSwitchTypeError(message: String, vararg objects: Any?) { player.sendMessage(TextComponentTranslation(message, *objects)) BlockMarker_onMarkerActivated_player = null } - -@Suppress("unused") // Used from jasm -fun fixRiderPosOnDismount_remakeAABB(aabb: AxisAlignedBB?): Boolean { - if (aabb == null) return true - if (!aabb.minX.isFinite()) return true - if (!aabb.minY.isFinite()) return true - if (!aabb.minZ.isFinite()) return true - if (!aabb.maxX.isFinite()) return true - if (!aabb.maxY.isFinite()) return true - if (!aabb.maxZ.isFinite()) return true - return false -} - -@Suppress("unused") // Used from jasm -fun fixRiderPosOnDismount_calcBestBlockPos(world: World, pos: BlockPos): BlockPos { - for (i in 0..10) { - val pos1 = BlockPos(pos.x, pos.y + i, pos.z) - val pos2 = BlockPos(pos.x, pos.y - i, pos.z) - - if (canBeSpawnedAt(world, pos1)) return pos1 - if (canBeSpawnedAt(world, pos2)) return pos2 - } - return world.getTopSolidOrLiquidBlock(pos) -} - -private fun canBeSpawnedAt(world: World, pos: BlockPos): Boolean { - if (world.isOutsideBuildHeight(pos)) return false - return world.getBlockState(pos).material == Material.AIR - && world.getBlockState(pos.up()).material == Material.AIR -} diff --git a/version-map.md b/version-map.md index 92d9e7c5..dc72214d 100644 --- a/version-map.md +++ b/version-map.md @@ -18,4 +18,4 @@ | 2.4.19 | 2.4.17 | 2.0.9 | | 2.4.19 | 2.4.17 | 2.0.10 | | 2.4.19 | 2.4.17 | 2.0.11 | -| 2.4.19 | 2.4.17 | master | +| 2.4.20 | 2.4.18 | master |