Skip to content

Commit

Permalink
fix patch for version up: change parameters for permissions from Enti…
Browse files Browse the repository at this point in the history
…tyPlayer to ICommandSender
  • Loading branch information
anatawa12 committed Jul 14, 2020
1 parent 008fe12 commit f92a5b8
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions patches/ngtlib.patch
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ 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 e68c287..f9f40cd 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
@@ -664,24 +664,46 @@ L_0029:
Expand Down Expand Up @@ -378,15 +378,15 @@ index e68c287..f9f40cd 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
+L_if_has_negative_permit:
+ .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
+
Expand All @@ -400,7 +400,7 @@ index e68c287..f9f40cd 100644
ireturn
L_000a:
.line 157
@@ -710,20 +732,40 @@ L_001c:
@@ -710,23 +732,46 @@ L_001c:
.line 160
.stack
locals Object jp/ngt/ngtlib/util/PermissionManager
Expand All @@ -411,18 +411,19 @@ index e68c287..f9f40cd 100644
iconst_1
ireturn
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
+ aload 0
+ 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
Expand All @@ -431,17 +432,23 @@ index e68c287..f9f40cd 100644
+L_if_has_not_all_permit:
+L_no_permission:
+
.line 164
.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
invokeinterface net/minecraft/command/ICommandSender/getName ()Ljava/lang/String;
@@ -749,20 +791,32 @@ L_0000:
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
Expand All @@ -456,7 +463,7 @@ index e68c287..f9f40cd 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
Expand Down

0 comments on commit f92a5b8

Please sign in to comment.