Commit 647e49fdcf20d7bb6475e727d1f122df39f08eb2
1 parent
aa74fddf
Bump mixin and mappings version, fix packet registration, fixes #31
Showing
10 changed files
with
31 additions
and
136 deletions
build.gradle
... | ... | @@ -72,7 +72,7 @@ repositories { |
72 | 72 | } |
73 | 73 | |
74 | 74 | dependencies { |
75 | - compile('org.spongepowered:mixin:0.6.10-SNAPSHOT') { | |
75 | + compile('org.spongepowered:mixin:0.6.12-SNAPSHOT') { | |
76 | 76 | exclude module: 'asm-commons' |
77 | 77 | exclude module: 'asm-tree' |
78 | 78 | exclude module: 'launchwrapper' | ... | ... |
gradle.properties
src/client/java/com/mumfrey/liteloader/client/gui/GuiCheckbox.java
... | ... | @@ -27,7 +27,7 @@ public class GuiCheckbox extends GuiButton |
27 | 27 | } |
28 | 28 | |
29 | 29 | @Override |
30 | - public void func_191745_a(Minecraft minecraft, int mouseX, int mouseY, float partialTicks) // drawButton | |
30 | + public void drawButton(Minecraft minecraft, int mouseX, int mouseY, float partialTicks) | |
31 | 31 | { |
32 | 32 | if (this.visible) |
33 | 33 | { | ... | ... |
src/client/java/com/mumfrey/liteloader/client/gui/GuiHoverLabel.java
... | ... | @@ -37,7 +37,7 @@ public class GuiHoverLabel extends GuiButton |
37 | 37 | } |
38 | 38 | |
39 | 39 | @Override |
40 | - public void func_191745_a(Minecraft minecraft, int mouseX, int mouseY, float partialTicks) // drawButton | |
40 | + public void drawButton(Minecraft minecraft, int mouseX, int mouseY, float partialTicks) | |
41 | 41 | { |
42 | 42 | if (this.visible) |
43 | 43 | { | ... | ... |
src/client/java/com/mumfrey/liteloader/client/gui/GuiPanel.java
... | ... | @@ -106,7 +106,7 @@ public abstract class GuiPanel extends Gui |
106 | 106 | { |
107 | 107 | for (GuiButton control : this.controls) |
108 | 108 | { |
109 | - control.func_191745_a(this.mc, mouseX, mouseY, partialTicks); // drawButton | |
109 | + control.drawButton(this.mc, mouseX, mouseY, partialTicks); | |
110 | 110 | } |
111 | 111 | } |
112 | 112 | ... | ... |
src/client/java/com/mumfrey/liteloader/client/mixin/IKeyBinding.java
... | ... | @@ -16,7 +16,7 @@ import net.minecraft.client.settings.KeyBinding; |
16 | 16 | @Mixin(KeyBinding.class) |
17 | 17 | public interface IKeyBinding |
18 | 18 | { |
19 | - @Accessor(value = "field_193627_d") | |
19 | + @Accessor(value = "CATEGORY_ORDER") | |
20 | 20 | public static Map<String, Integer> getCategorySort() |
21 | 21 | { |
22 | 22 | throw new NotImplementedException("IKeyBinding mixin failed to apply"); | ... | ... |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinMinecraft.java
... | ... | @@ -36,7 +36,7 @@ public abstract class MixinMinecraft implements IMinecraft |
36 | 36 | @Shadow private String serverName; |
37 | 37 | @Shadow private int serverPort; |
38 | 38 | @Shadow private boolean isGamePaused; |
39 | - @Shadow private float field_193996_ah; | |
39 | + @Shadow private float renderPartialTicksPaused; | |
40 | 40 | |
41 | 41 | @Shadow abstract void resize(int width, int height); |
42 | 42 | @Shadow private void clickMouse() {} |
... | ... | @@ -82,7 +82,7 @@ public abstract class MixinMinecraft implements IMinecraft |
82 | 82 | private void onTick(CallbackInfo ci) |
83 | 83 | { |
84 | 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 | 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 | 19 | @Mixin(TileEntityRendererDispatcher.class) |
20 | 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 | 24 | @Override |
25 | 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/client/java/com/mumfrey/liteloader/modconfig/AbstractConfigPanel.java
... | ... | @@ -75,7 +75,7 @@ public abstract class AbstractConfigPanel implements ConfigPanel |
75 | 75 | |
76 | 76 | if (this.control != null) |
77 | 77 | { |
78 | - this.control.func_191745_a(minecraft, mouseX, mouseY, partialTicks); // drawButton | |
78 | + this.control.drawButton(minecraft, mouseX, mouseY, partialTicks); | |
79 | 79 | } |
80 | 80 | } |
81 | 81 | ... | ... |
src/main/java/com/mumfrey/liteloader/core/runtime/Packets.java
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | */ |
6 | 6 | package com.mumfrey.liteloader.core.runtime; |
7 | 7 | |
8 | +import java.lang.reflect.Field; | |
8 | 9 | import java.util.HashMap; |
9 | 10 | import java.util.Map; |
10 | 11 | |
... | ... | @@ -163,131 +164,7 @@ public final class Packets extends Obf |
163 | 164 | |
164 | 165 | // CHECKSTYLE:ON |
165 | 166 | |
166 | - public static final Packets[] packets = new Packets[] { | |
167 | - Packets.CPacketEncryptionResponse, | |
168 | - Packets.CPacketLoginStart, | |
169 | - Packets.SPacketDisconnectLogin, | |
170 | - Packets.SPacketEnableCompression, | |
171 | - Packets.SPacketEncryptionRequest, | |
172 | - Packets.SPacketLoginSuccess, | |
173 | - Packets.CPacketAnimation, | |
174 | - Packets.CPacketChatMessage, | |
175 | - Packets.CPacketClickWindow, | |
176 | - Packets.CPacketClientSettings, | |
177 | - Packets.CPacketClientStatus, | |
178 | - Packets.CPacketCloseWindow, | |
179 | - Packets.CPacketConfirmTeleport, | |
180 | - Packets.CPacketConfirmTransaction, | |
181 | - Packets.CPacketCreativeInventoryAction, | |
182 | - Packets.CPacketCustomPayload, | |
183 | - Packets.CPacketEnchantItem, | |
184 | - Packets.CPacketEntityAction, | |
185 | - Packets.CPacketHeldItemChange, | |
186 | - Packets.CPacketInput, | |
187 | - Packets.C00Handshake, | |
188 | - Packets.CPacketKeepAlive, | |
189 | - Packets.CPacketPlayer, | |
190 | - Packets.CPacketPlayerPosition, | |
191 | - Packets.CPacketPlayerPositionRotation, | |
192 | - Packets.CPacketPlayerRotation, | |
193 | - Packets.CPacketPlayerAbilities, | |
194 | - Packets.CPacketPlayerDigging, | |
195 | - Packets.CPacketPlayerTryUseItem, | |
196 | - Packets.CPacketPlayerTryUseItemOnBlock, | |
197 | - Packets.CPacketResourcePackStatus, | |
198 | - Packets.CPacketSpectate, | |
199 | - Packets.CPacketSteerBoat, | |
200 | - Packets.CPacketTabComplete, | |
201 | - Packets.CPacketUpdateSign, | |
202 | - Packets.CPacketUseEntity, | |
203 | - Packets.CPacketVehicleMove, | |
204 | - Packets.SPacketAnimation, | |
205 | - Packets.SPacketBlockAction, | |
206 | - Packets.SPacketBlockBreakAnim, | |
207 | - Packets.SPacketBlockChange, | |
208 | - Packets.SPacketCamera, | |
209 | - Packets.SPacketChangeGameState, | |
210 | - Packets.SPacketChat, | |
211 | - Packets.SPacketChunkData, | |
212 | - Packets.SPacketCloseWindow, | |
213 | - Packets.SPacketCollectItem, | |
214 | - Packets.SPacketCombatEvent, | |
215 | - Packets.SPacketConfirmTransaction, | |
216 | - Packets.SPacketCooldown, | |
217 | - Packets.SPacketCustomPayload, | |
218 | - Packets.SPacketCustomSound, | |
219 | - Packets.SPacketDestroyEntities, | |
220 | - Packets.SPacketDisconnect, | |
221 | - Packets.SPacketDisplayObjective, | |
222 | - Packets.SPacketEffect, | |
223 | - Packets.SPacketEntity, | |
224 | - Packets.S15PacketEntityRelMove, | |
225 | - Packets.S16PacketEntityLook, | |
226 | - Packets.S17PacketEntityLookMove, | |
227 | - Packets.SPacketEntityAttach, | |
228 | - Packets.SPacketEntityEffect, | |
229 | - Packets.SPacketEntityEquipment, | |
230 | - Packets.SPacketEntityHeadLook, | |
231 | - Packets.SPacketEntityMetadata, | |
232 | - Packets.SPacketEntityProperties, | |
233 | - Packets.SPacketEntityStatus, | |
234 | - Packets.SPacketEntityTeleport, | |
235 | - Packets.SPacketEntityVelocity, | |
236 | - Packets.SPacketExplosion, | |
237 | - Packets.SPacketHeldItemChange, | |
238 | - Packets.SPacketJoinGame, | |
239 | - Packets.SPacketKeepAlive, | |
240 | - Packets.SPacketMaps, | |
241 | - Packets.SPacketMoveVehicle, | |
242 | - Packets.SPacketMultiBlockChange, | |
243 | - Packets.SPacketOpenWindow, | |
244 | - Packets.SPacketParticles, | |
245 | - Packets.SPacketPlayerAbilities, | |
246 | - Packets.SPacketPlayerListHeaderFooter, | |
247 | - Packets.SPacketPlayerListItem, | |
248 | - Packets.SPacketPlayerPosLook, | |
249 | - Packets.SPacketRemoveEntityEffect, | |
250 | - Packets.SPacketResourcePackSend, | |
251 | - Packets.SPacketRespawn, | |
252 | - Packets.SPacketScoreboardObjective, | |
253 | - Packets.SPacketServerDifficulty, | |
254 | - Packets.SPacketSetExperience, | |
255 | - Packets.SPacketSetPassengers, | |
256 | - Packets.SPacketSetSlot, | |
257 | - Packets.SPacketSignEditorOpen, | |
258 | - Packets.SPacketSoundEffect, | |
259 | - Packets.SPacketSpawnExperienceOrb, | |
260 | - Packets.SPacketSpawnGlobalEntity, | |
261 | - Packets.SPacketSpawnMob, | |
262 | - Packets.SPacketSpawnObject, | |
263 | - Packets.SPacketSpawnPainting, | |
264 | - Packets.SPacketSpawnPlayer, | |
265 | - Packets.SPacketSpawnPosition, | |
266 | - Packets.SPacketStatistics, | |
267 | - Packets.SPacketTabComplete, | |
268 | - Packets.SPacketTeams, | |
269 | - Packets.SPacketTimeUpdate, | |
270 | - Packets.SPacketTitle, | |
271 | - Packets.SPacketUnloadChunk, | |
272 | - Packets.SPacketUpdateBossInfo, | |
273 | - Packets.SPacketUpdateHealth, | |
274 | - Packets.SPacketUpdateScore, | |
275 | - Packets.SPacketUpdateTileEntity, | |
276 | - Packets.SPacketUseBed, | |
277 | - Packets.SPacketWindowItems, | |
278 | - Packets.SPacketWindowProperty, | |
279 | - Packets.SPacketWorldBorder, | |
280 | - Packets.CPacketPing, | |
281 | - Packets.CPacketServerQuery, | |
282 | - Packets.SPacketPong, | |
283 | - Packets.SPacketServerInfo, | |
284 | - Packets.CPacketRecipeInfo, | |
285 | - Packets.CPacketRecipePlacement, | |
286 | - Packets.CPacketSeenAdvancements, | |
287 | - Packets.SPacketAdvancementInfo, | |
288 | - Packets.SPacketRecipeBook, | |
289 | - Packets.SPacketSelectAdvancementsTab | |
290 | - }; | |
167 | + public static final Packets[] packets = Packets.toArray(); | |
291 | 168 | |
292 | 169 | private static int nextPacketIndex; |
293 | 170 | |
... | ... | @@ -307,6 +184,24 @@ public final class Packets extends Obf |
307 | 184 | this.context = context; |
308 | 185 | } |
309 | 186 | |
187 | + private static Packets[] toArray() | |
188 | + { | |
189 | + Field[] fields = Packets.class.getFields(); | |
190 | + Packets[] packets = new Packets[Packets.nextPacketIndex]; | |
191 | + for (int index = 0; index < Packets.nextPacketIndex; index++) | |
192 | + { | |
193 | + try | |
194 | + { | |
195 | + packets[index] = (Packets)fields[index].get(null); | |
196 | + } | |
197 | + catch (Exception ex) | |
198 | + { | |
199 | + throw new RuntimeException(ex); | |
200 | + } | |
201 | + } | |
202 | + return packets; | |
203 | + } | |
204 | + | |
310 | 205 | public int getIndex() |
311 | 206 | { |
312 | 207 | return this.index; | ... | ... |