Commit f87a0b45a2cc56ae98fc93e1fee79749b8b948e6
1 parent
4b167b40
Bump mixin and mappings version, fix packet registration, fixes #31
Showing
5 changed files
with
36 additions
and
129 deletions
build.gradle
@@ -60,8 +60,8 @@ archivesBaseName = "liteloader" | @@ -60,8 +60,8 @@ archivesBaseName = "liteloader" | ||
60 | version = buildVersion + (project.isReleaseBuild ? '' : '-' + project.classifier) | 60 | version = buildVersion + (project.isReleaseBuild ? '' : '-' + project.classifier) |
61 | 61 | ||
62 | // Minimum version of Java required | 62 | // Minimum version of Java required |
63 | -sourceCompatibility = '1.6' | ||
64 | -targetCompatibility = '1.6' | 63 | +sourceCompatibility = '1.8' |
64 | +targetCompatibility = '1.8' | ||
65 | 65 | ||
66 | repositories { | 66 | repositories { |
67 | mavenLocal() | 67 | mavenLocal() |
@@ -89,11 +89,11 @@ minecraft { | @@ -89,11 +89,11 @@ minecraft { | ||
89 | 89 | ||
90 | sourceSets { | 90 | sourceSets { |
91 | main { | 91 | main { |
92 | - refMap = "mixins.liteloader.core.refmap.json" | 92 | + ext.refMap = "mixins.liteloader.core.refmap.json" |
93 | } | 93 | } |
94 | client { | 94 | client { |
95 | compileClasspath += main.compileClasspath + main.output | 95 | compileClasspath += main.compileClasspath + main.output |
96 | - refMap = "mixins.liteloader.client.refmap.json" | 96 | + ext.refMap = "mixins.liteloader.client.refmap.json" |
97 | } | 97 | } |
98 | debug { | 98 | debug { |
99 | compileClasspath += client.compileClasspath + client.output | 99 | compileClasspath += client.compileClasspath + client.output |
@@ -123,7 +123,7 @@ javadoc { | @@ -123,7 +123,7 @@ javadoc { | ||
123 | afterEvaluate { | 123 | afterEvaluate { |
124 | logger.lifecycle '=================================================' | 124 | logger.lifecycle '=================================================' |
125 | logger.lifecycle ' LiteLoader' | 125 | logger.lifecycle ' LiteLoader' |
126 | - logger.lifecycle ' Copyright (C) 2011-2016 Adam Mummery-Smith' | 126 | + logger.lifecycle ' Copyright (C) 2011-2017 Adam Mummery-Smith' |
127 | logger.lifecycle ' Running in {} mode', (project.isReleaseBuild ? "RELEASE" : "SNAPSHOT") | 127 | logger.lifecycle ' Running in {} mode', (project.isReleaseBuild ? "RELEASE" : "SNAPSHOT") |
128 | logger.lifecycle '=================================================' | 128 | logger.lifecycle '=================================================' |
129 | 129 |
gradle.properties
@@ -5,6 +5,12 @@ description=LiteLoader | @@ -5,6 +5,12 @@ description=LiteLoader | ||
5 | url=http://www.liteloader.com | 5 | url=http://www.liteloader.com |
6 | organization=LiteLoader | 6 | organization=LiteLoader |
7 | buildType=SNAPSHOT | 7 | buildType=SNAPSHOT |
8 | +<<<<<<< Upstream, based on origin/1.11.2 | ||
8 | buildVersion=1.11.2 | 9 | buildVersion=1.11.2 |
9 | mcVersion=1.11.2 | 10 | mcVersion=1.11.2 |
10 | -mcMappings=snapshot_20161224 | ||
11 | \ No newline at end of file | 11 | \ No newline at end of file |
12 | +mcMappings=snapshot_20161224 | ||
13 | +======= | ||
14 | +buildVersion=1.12 | ||
15 | +mcVersion=1.12 | ||
16 | +mcMappings=snapshot_20170627 | ||
17 | +>>>>>>> 647e49f Bump mixin and mappings version, fix packet registration, fixes #31 |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinMinecraft.java
@@ -36,7 +36,7 @@ public abstract class MixinMinecraft implements IMinecraft | @@ -36,7 +36,7 @@ public abstract class MixinMinecraft implements IMinecraft | ||
36 | @Shadow private String serverName; | 36 | @Shadow private String serverName; |
37 | @Shadow private int serverPort; | 37 | @Shadow private int serverPort; |
38 | @Shadow private boolean isGamePaused; | 38 | @Shadow private boolean isGamePaused; |
39 | - @Shadow private float field_193996_ah; | 39 | + @Shadow private float renderPartialTicksPaused; |
40 | 40 | ||
41 | @Shadow abstract void resize(int width, int height); | 41 | @Shadow abstract void resize(int width, int height); |
42 | @Shadow private void clickMouse() {} | 42 | @Shadow private void clickMouse() {} |
@@ -82,7 +82,7 @@ public abstract class MixinMinecraft implements IMinecraft | @@ -82,7 +82,7 @@ public abstract class MixinMinecraft implements IMinecraft | ||
82 | private void onTick(CallbackInfo ci) | 82 | private void onTick(CallbackInfo ci) |
83 | { | 83 | { |
84 | boolean clock = this.timer.elapsedTicks > 0; | 84 | boolean clock = this.timer.elapsedTicks > 0; |
85 | - float partialTicks = this.isGamePaused ? this.field_193996_ah : this.timer.field_194147_b; | 85 | + float partialTicks = this.isGamePaused ? this.renderPartialTicksPaused : this.timer.renderPartialTicks; |
86 | this.broker.onTick(clock, partialTicks); | 86 | this.broker.onTick(clock, partialTicks); |
87 | } | 87 | } |
88 | 88 |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinTileEntityRendererDispatcher.java
@@ -19,11 +19,11 @@ import net.minecraft.tileentity.TileEntity; | @@ -19,11 +19,11 @@ import net.minecraft.tileentity.TileEntity; | ||
19 | @Mixin(TileEntityRendererDispatcher.class) | 19 | @Mixin(TileEntityRendererDispatcher.class) |
20 | public abstract class MixinTileEntityRendererDispatcher implements ITileEntityRendererDispatcher | 20 | public abstract class MixinTileEntityRendererDispatcher implements ITileEntityRendererDispatcher |
21 | { | 21 | { |
22 | - @Shadow private Map<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>> mapSpecialRenderers; | 22 | + @Shadow private Map<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>> renderers; |
23 | 23 | ||
24 | @Override | 24 | @Override |
25 | public Map<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>> getSpecialRenderMap() | 25 | public Map<Class<? extends TileEntity>, TileEntitySpecialRenderer<? extends TileEntity>> getSpecialRenderMap() |
26 | { | 26 | { |
27 | - return this.mapSpecialRenderers; | 27 | + return this.renderers; |
28 | } | 28 | } |
29 | } | 29 | } |
src/main/java/com/mumfrey/liteloader/core/runtime/Packets.java
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | */ | 5 | */ |
6 | package com.mumfrey.liteloader.core.runtime; | 6 | package com.mumfrey.liteloader.core.runtime; |
7 | 7 | ||
8 | +import java.lang.reflect.Field; | ||
8 | import java.util.HashMap; | 9 | import java.util.HashMap; |
9 | import java.util.Map; | 10 | import java.util.Map; |
10 | 11 | ||
@@ -157,125 +158,7 @@ public final class Packets extends Obf | @@ -157,125 +158,7 @@ public final class Packets extends Obf | ||
157 | 158 | ||
158 | // CHECKSTYLE:ON | 159 | // CHECKSTYLE:ON |
159 | 160 | ||
160 | - public static final Packets[] packets = new Packets[] { | ||
161 | - CPacketEncryptionResponse, | ||
162 | - CPacketLoginStart, | ||
163 | - SPacketDisconnectLogin, | ||
164 | - SPacketEnableCompression, | ||
165 | - SPacketEncryptionRequest, | ||
166 | - SPacketLoginSuccess, | ||
167 | - CPacketAnimation, | ||
168 | - CPacketChatMessage, | ||
169 | - CPacketClickWindow, | ||
170 | - CPacketClientSettings, | ||
171 | - CPacketClientStatus, | ||
172 | - CPacketCloseWindow, | ||
173 | - CPacketConfirmTeleport, | ||
174 | - CPacketConfirmTransaction, | ||
175 | - CPacketCreativeInventoryAction, | ||
176 | - CPacketCustomPayload, | ||
177 | - CPacketEnchantItem, | ||
178 | - CPacketEntityAction, | ||
179 | - CPacketHeldItemChange, | ||
180 | - CPacketInput, | ||
181 | - C00Handshake, | ||
182 | - CPacketKeepAlive, | ||
183 | - CPacketPlayer, | ||
184 | - CPacketPlayerPosition, | ||
185 | - CPacketPlayerPositionRotation, | ||
186 | - CPacketPlayerRotation, | ||
187 | - CPacketPlayerAbilities, | ||
188 | - CPacketPlayerDigging, | ||
189 | - CPacketPlayerTryUseItem, | ||
190 | - CPacketPlayerTryUseItemOnBlock, | ||
191 | - CPacketResourcePackStatus, | ||
192 | - CPacketSpectate, | ||
193 | - CPacketSteerBoat, | ||
194 | - CPacketTabComplete, | ||
195 | - CPacketUpdateSign, | ||
196 | - CPacketUseEntity, | ||
197 | - CPacketVehicleMove, | ||
198 | - SPacketAnimation, | ||
199 | - SPacketBlockAction, | ||
200 | - SPacketBlockBreakAnim, | ||
201 | - SPacketBlockChange, | ||
202 | - SPacketCamera, | ||
203 | - SPacketChangeGameState, | ||
204 | - SPacketChat, | ||
205 | - SPacketChunkData, | ||
206 | - SPacketCloseWindow, | ||
207 | - SPacketCollectItem, | ||
208 | - SPacketCombatEvent, | ||
209 | - SPacketConfirmTransaction, | ||
210 | - SPacketCooldown, | ||
211 | - SPacketCustomPayload, | ||
212 | - SPacketCustomSound, | ||
213 | - SPacketDestroyEntities, | ||
214 | - SPacketDisconnect, | ||
215 | - SPacketDisplayObjective, | ||
216 | - SPacketEffect, | ||
217 | - SPacketEntity, | ||
218 | - S15PacketEntityRelMove, | ||
219 | - S16PacketEntityLook, | ||
220 | - S17PacketEntityLookMove, | ||
221 | - SPacketEntityAttach, | ||
222 | - SPacketEntityEffect, | ||
223 | - SPacketEntityEquipment, | ||
224 | - SPacketEntityHeadLook, | ||
225 | - SPacketEntityMetadata, | ||
226 | - SPacketEntityProperties, | ||
227 | - SPacketEntityStatus, | ||
228 | - SPacketEntityTeleport, | ||
229 | - SPacketEntityVelocity, | ||
230 | - SPacketExplosion, | ||
231 | - SPacketHeldItemChange, | ||
232 | - SPacketJoinGame, | ||
233 | - SPacketKeepAlive, | ||
234 | - SPacketMaps, | ||
235 | - SPacketMoveVehicle, | ||
236 | - SPacketMultiBlockChange, | ||
237 | - SPacketOpenWindow, | ||
238 | - SPacketParticles, | ||
239 | - SPacketPlayerAbilities, | ||
240 | - SPacketPlayerListHeaderFooter, | ||
241 | - SPacketPlayerListItem, | ||
242 | - SPacketPlayerPosLook, | ||
243 | - SPacketRemoveEntityEffect, | ||
244 | - SPacketResourcePackSend, | ||
245 | - SPacketRespawn, | ||
246 | - SPacketScoreboardObjective, | ||
247 | - SPacketServerDifficulty, | ||
248 | - SPacketSetExperience, | ||
249 | - SPacketSetPassengers, | ||
250 | - SPacketSetSlot, | ||
251 | - SPacketSignEditorOpen, | ||
252 | - SPacketSoundEffect, | ||
253 | - SPacketSpawnExperienceOrb, | ||
254 | - SPacketSpawnGlobalEntity, | ||
255 | - SPacketSpawnMob, | ||
256 | - SPacketSpawnObject, | ||
257 | - SPacketSpawnPainting, | ||
258 | - SPacketSpawnPlayer, | ||
259 | - SPacketSpawnPosition, | ||
260 | - SPacketStatistics, | ||
261 | - SPacketTabComplete, | ||
262 | - SPacketTeams, | ||
263 | - SPacketTimeUpdate, | ||
264 | - SPacketTitle, | ||
265 | - SPacketUnloadChunk, | ||
266 | - SPacketUpdateBossInfo, | ||
267 | - SPacketUpdateHealth, | ||
268 | - SPacketUpdateScore, | ||
269 | - SPacketUpdateTileEntity, | ||
270 | - SPacketUseBed, | ||
271 | - SPacketWindowItems, | ||
272 | - SPacketWindowProperty, | ||
273 | - SPacketWorldBorder, | ||
274 | - CPacketPing, | ||
275 | - CPacketServerQuery, | ||
276 | - SPacketPong, | ||
277 | - SPacketServerInfo | ||
278 | - }; | 161 | + public static final Packets[] packets = Packets.toArray(); |
279 | 162 | ||
280 | private static int nextPacketIndex; | 163 | private static int nextPacketIndex; |
281 | 164 | ||
@@ -295,6 +178,24 @@ public final class Packets extends Obf | @@ -295,6 +178,24 @@ public final class Packets extends Obf | ||
295 | this.context = context; | 178 | this.context = context; |
296 | } | 179 | } |
297 | 180 | ||
181 | + private static Packets[] toArray() | ||
182 | + { | ||
183 | + Field[] fields = Packets.class.getFields(); | ||
184 | + Packets[] packets = new Packets[Packets.nextPacketIndex]; | ||
185 | + for (int index = 0; index < Packets.nextPacketIndex; index++) | ||
186 | + { | ||
187 | + try | ||
188 | + { | ||
189 | + packets[index] = (Packets)fields[index].get(null); | ||
190 | + } | ||
191 | + catch (Exception ex) | ||
192 | + { | ||
193 | + throw new RuntimeException(ex); | ||
194 | + } | ||
195 | + } | ||
196 | + return packets; | ||
197 | + } | ||
198 | + | ||
298 | public int getIndex() | 199 | public int getIndex() |
299 | { | 200 | { |
300 | return this.index; | 201 | return this.index; |