Commit 23f62bda1a2c4c90018f4096d76f6df9da12e9f4
1 parent
62eaf16e
Update Mixin version and make ctor redirectors compatible with new ver
Showing
4 changed files
with
22 additions
and
19 deletions
build.gradle
@@ -72,7 +72,7 @@ repositories { | @@ -72,7 +72,7 @@ repositories { | ||
72 | } | 72 | } |
73 | 73 | ||
74 | dependencies { | 74 | dependencies { |
75 | - compile('org.spongepowered:mixin:0.6.1-SNAPSHOT') { | 75 | + compile('org.spongepowered:mixin:0.6.4-SNAPSHOT') { |
76 | exclude module: 'asm-commons' | 76 | exclude module: 'asm-commons' |
77 | exclude module: 'asm-tree' | 77 | exclude module: 'asm-tree' |
78 | exclude module: 'launchwrapper' | 78 | exclude module: 'launchwrapper' |
src/client/java/com/mumfrey/liteloader/client/gui/startup/LoadingBar.java
@@ -42,13 +42,14 @@ public class LoadingBar extends LoadingProgress | @@ -42,13 +42,14 @@ public class LoadingBar extends LoadingProgress | ||
42 | { | 42 | { |
43 | private static LoadingBar instance; | 43 | private static LoadingBar instance; |
44 | 44 | ||
45 | + private static final int MAX_MINECRAFT_PROGRESS = 90; | ||
46 | + private static final int LITELOADER_PROGRESS_SCALE = 2; | ||
47 | + | ||
45 | private static final String LOADING_MESSAGE_1 = "Starting Game..."; | 48 | private static final String LOADING_MESSAGE_1 = "Starting Game..."; |
46 | private static final String LOADING_MESSAGE_2 = "Initialising..."; | 49 | private static final String LOADING_MESSAGE_2 = "Initialising..."; |
47 | 50 | ||
48 | private int minecraftProgress = 0; | 51 | private int minecraftProgress = 0; |
49 | - private int totalMinecraftProgress = 606; | ||
50 | - | ||
51 | - private int liteLoaderProgressScale = 3; | 52 | + private int totalMinecraftProgress = LoadingBar.MAX_MINECRAFT_PROGRESS; |
52 | 53 | ||
53 | private int liteLoaderProgress = 0; | 54 | private int liteLoaderProgress = 0; |
54 | private int totalLiteLoaderProgress = 0; | 55 | private int totalLiteLoaderProgress = 0; |
@@ -129,7 +130,7 @@ public class LoadingBar extends LoadingProgress | @@ -129,7 +130,7 @@ public class LoadingBar extends LoadingProgress | ||
129 | @Override | 130 | @Override |
130 | protected void _incLiteLoaderProgress() | 131 | protected void _incLiteLoaderProgress() |
131 | { | 132 | { |
132 | - this.liteLoaderProgress += this.liteLoaderProgressScale; | 133 | + this.liteLoaderProgress += LoadingBar.LITELOADER_PROGRESS_SCALE; |
133 | this.render(); | 134 | this.render(); |
134 | } | 135 | } |
135 | 136 | ||
@@ -144,14 +145,14 @@ public class LoadingBar extends LoadingProgress | @@ -144,14 +145,14 @@ public class LoadingBar extends LoadingProgress | ||
144 | protected void _incLiteLoaderProgress(String message) | 145 | protected void _incLiteLoaderProgress(String message) |
145 | { | 146 | { |
146 | this.message = message; | 147 | this.message = message; |
147 | - this.liteLoaderProgress += this.liteLoaderProgressScale ; | 148 | + this.liteLoaderProgress += LoadingBar.LITELOADER_PROGRESS_SCALE ; |
148 | this.render(); | 149 | this.render(); |
149 | } | 150 | } |
150 | 151 | ||
151 | @Override | 152 | @Override |
152 | protected void _incTotalLiteLoaderProgress(int by) | 153 | protected void _incTotalLiteLoaderProgress(int by) |
153 | { | 154 | { |
154 | - this.totalLiteLoaderProgress += (by * this.liteLoaderProgressScale); | 155 | + this.totalLiteLoaderProgress += (by * LoadingBar.LITELOADER_PROGRESS_SCALE); |
155 | this.render(); | 156 | this.render(); |
156 | } | 157 | } |
157 | 158 | ||
@@ -198,7 +199,7 @@ public class LoadingBar extends LoadingProgress | @@ -198,7 +199,7 @@ public class LoadingBar extends LoadingProgress | ||
198 | { | 199 | { |
199 | if (this.totalMinecraftProgress == -1) | 200 | if (this.totalMinecraftProgress == -1) |
200 | { | 201 | { |
201 | - this.totalMinecraftProgress = 606 - this.minecraftProgress; | 202 | + this.totalMinecraftProgress = LoadingBar.MAX_MINECRAFT_PROGRESS - this.minecraftProgress; |
202 | this.minecraftProgress = 0; | 203 | this.minecraftProgress = 0; |
203 | } | 204 | } |
204 | 205 |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinSession.java
@@ -23,8 +23,9 @@ public abstract class MixinSession | @@ -23,8 +23,9 @@ public abstract class MixinSession | ||
23 | 23 | ||
24 | @Inject(method = "getProfile()Lcom/mojang/authlib/GameProfile;", cancellable = true, at = @At( | 24 | @Inject(method = "getProfile()Lcom/mojang/authlib/GameProfile;", cancellable = true, at = @At( |
25 | value = "NEW", | 25 | value = "NEW", |
26 | - args = "class=com/mojang/authlib/GameProfile", | ||
27 | - ordinal = 1 | 26 | + target = "com/mojang/authlib/GameProfile", |
27 | + ordinal = 1, | ||
28 | + remap = false | ||
28 | )) | 29 | )) |
29 | private void generateGameProfile(CallbackInfoReturnable<GameProfile> ci) | 30 | private void generateGameProfile(CallbackInfoReturnable<GameProfile> ci) |
30 | { | 31 | { |
src/client/java/com/mumfrey/liteloader/client/transformers/MinecraftTransformer.java
@@ -48,12 +48,18 @@ public class MinecraftTransformer extends ClassTransformer | @@ -48,12 +48,18 @@ public class MinecraftTransformer extends ClassTransformer | ||
48 | { | 48 | { |
49 | InsnList insns = new InsnList(); | 49 | InsnList insns = new InsnList(); |
50 | 50 | ||
51 | + boolean loadingBarEnabled = LiteLoaderTweaker.loadingBarEnabled(); | ||
51 | boolean found = false; | 52 | boolean found = false; |
52 | 53 | ||
53 | Iterator<AbstractInsnNode> iter = method.instructions.iterator(); | 54 | Iterator<AbstractInsnNode> iter = method.instructions.iterator(); |
54 | while (iter.hasNext()) | 55 | while (iter.hasNext()) |
55 | { | 56 | { |
56 | AbstractInsnNode insn = iter.next(); | 57 | AbstractInsnNode insn = iter.next(); |
58 | + if (loadingBarEnabled && insn instanceof MethodInsnNode) | ||
59 | + { | ||
60 | + insns.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Obf.LoadingBar.ref, "incrementProgress", "()V", false)); | ||
61 | + } | ||
62 | + | ||
57 | insns.add(insn); | 63 | insns.add(insn); |
58 | 64 | ||
59 | if (insn instanceof TypeInsnNode && insn.getOpcode() == Opcodes.NEW && insns.getLast() != null) | 65 | if (insn instanceof TypeInsnNode && insn.getOpcode() == Opcodes.NEW && insns.getLast() != null) |
@@ -69,18 +75,13 @@ public class MinecraftTransformer extends ClassTransformer | @@ -69,18 +75,13 @@ public class MinecraftTransformer extends ClassTransformer | ||
69 | } | 75 | } |
70 | } | 76 | } |
71 | 77 | ||
72 | - if (LiteLoaderTweaker.loadingBarEnabled()) | 78 | + if (loadingBarEnabled && insn instanceof LdcInsnNode) |
73 | { | 79 | { |
74 | - if (insn instanceof LdcInsnNode) | 80 | + LdcInsnNode ldcInsn = (LdcInsnNode)insn; |
81 | + if ("textures/blocks".equals(ldcInsn.cst)) | ||
75 | { | 82 | { |
76 | - LdcInsnNode ldcInsn = (LdcInsnNode)insn; | ||
77 | - if ("textures/blocks".equals(ldcInsn.cst)) | ||
78 | - { | ||
79 | - insns.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Obf.LoadingBar.ref, "initTextures", "()V", false)); | ||
80 | - } | 83 | + insns.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Obf.LoadingBar.ref, "initTextures", "()V", false)); |
81 | } | 84 | } |
82 | - | ||
83 | - insns.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Obf.LoadingBar.ref, "incrementProgress", "()V", false)); | ||
84 | } | 85 | } |
85 | } | 86 | } |
86 | 87 |