Commit fe379483ea4a07c0e535f42bd772ebbf96a7bd68
1 parent
7347bfef
Initial update to 1.9
Showing
62 changed files
with
960 additions
and
733 deletions
gradle.properties
@@ -5,6 +5,6 @@ description=LiteLoader | @@ -5,6 +5,6 @@ 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 | -buildVersion=1.8.9 | ||
9 | -mcVersion=1.8.9 | ||
10 | -mcMappings=snapshot_20160204 | ||
11 | \ No newline at end of file | 8 | \ No newline at end of file |
9 | +buildVersion=1.9 | ||
10 | +mcVersion=1.9 | ||
11 | +mcMappings=snapshot_20160411 | ||
12 | \ No newline at end of file | 12 | \ No newline at end of file |
src/client/java/com/mumfrey/liteloader/ChatFilter.java
@@ -2,7 +2,7 @@ package com.mumfrey.liteloader; | @@ -2,7 +2,7 @@ package com.mumfrey.liteloader; | ||
2 | 2 | ||
3 | import com.mumfrey.liteloader.core.LiteLoaderEventBroker.ReturnValue; | 3 | import com.mumfrey.liteloader.core.LiteLoaderEventBroker.ReturnValue; |
4 | 4 | ||
5 | -import net.minecraft.util.IChatComponent; | 5 | +import net.minecraft.util.text.ITextComponent; |
6 | 6 | ||
7 | 7 | ||
8 | /** | 8 | /** |
@@ -23,5 +23,5 @@ public interface ChatFilter extends LiteMod | @@ -23,5 +23,5 @@ public interface ChatFilter extends LiteMod | ||
23 | * | 23 | * |
24 | * @return True to keep the packet, false to discard | 24 | * @return True to keep the packet, false to discard |
25 | */ | 25 | */ |
26 | - public abstract boolean onChat(IChatComponent chat, String message, ReturnValue<IChatComponent> newMessage); | 26 | + public abstract boolean onChat(ITextComponent chat, String message, ReturnValue<ITextComponent> newMessage); |
27 | } | 27 | } |
src/client/java/com/mumfrey/liteloader/ChatListener.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | -import net.minecraft.util.IChatComponent; | 3 | +import net.minecraft.util.text.ITextComponent; |
4 | 4 | ||
5 | 5 | ||
6 | /** | 6 | /** |
@@ -13,8 +13,8 @@ public interface ChatListener extends LiteMod | @@ -13,8 +13,8 @@ public interface ChatListener extends LiteMod | ||
13 | /** | 13 | /** |
14 | * Handle an inbound message | 14 | * Handle an inbound message |
15 | * | 15 | * |
16 | - * @param chat IChatComponent parsed from the chat packet | 16 | + * @param chat ITextComponent parsed from the chat packet |
17 | * @param message Chat message parsed from the chat message component | 17 | * @param message Chat message parsed from the chat message component |
18 | */ | 18 | */ |
19 | - public abstract void onChat(IChatComponent chat, String message); | 19 | + public abstract void onChat(ITextComponent chat, String message); |
20 | } | 20 | } |
src/client/java/com/mumfrey/liteloader/JoinGameListener.java
@@ -2,7 +2,7 @@ package com.mumfrey.liteloader; | @@ -2,7 +2,7 @@ package com.mumfrey.liteloader; | ||
2 | 2 | ||
3 | import net.minecraft.client.multiplayer.ServerData; | 3 | import net.minecraft.client.multiplayer.ServerData; |
4 | import net.minecraft.network.INetHandler; | 4 | import net.minecraft.network.INetHandler; |
5 | -import net.minecraft.network.play.server.S01PacketJoinGame; | 5 | +import net.minecraft.network.play.server.SPacketJoinGame; |
6 | 6 | ||
7 | import com.mojang.realmsclient.dto.RealmsServer; | 7 | import com.mojang.realmsclient.dto.RealmsServer; |
8 | 8 | ||
@@ -25,5 +25,5 @@ public interface JoinGameListener extends LiteMod | @@ -25,5 +25,5 @@ public interface JoinGameListener extends LiteMod | ||
25 | * @param realmsServer If connecting to a realm, a reference to the | 25 | * @param realmsServer If connecting to a realm, a reference to the |
26 | * RealmsServer object | 26 | * RealmsServer object |
27 | */ | 27 | */ |
28 | - public abstract void onJoinGame(INetHandler netHandler, S01PacketJoinGame joinGamePacket, ServerData serverData, RealmsServer realmsServer); | 28 | + public abstract void onJoinGame(INetHandler netHandler, SPacketJoinGame joinGamePacket, ServerData serverData, RealmsServer realmsServer); |
29 | } | 29 | } |
src/client/java/com/mumfrey/liteloader/OutboundChatListener.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | -import net.minecraft.network.play.client.C01PacketChatMessage; | 3 | +import net.minecraft.network.play.client.CPacketChatMessage; |
4 | 4 | ||
5 | /** | 5 | /** |
6 | * Interface for mods which want to monitor outbound chat | 6 | * Interface for mods which want to monitor outbound chat |
@@ -16,5 +16,5 @@ public interface OutboundChatListener extends LiteMod | @@ -16,5 +16,5 @@ public interface OutboundChatListener extends LiteMod | ||
16 | * @param packet | 16 | * @param packet |
17 | * @param message | 17 | * @param message |
18 | */ | 18 | */ |
19 | - public abstract void onSendChatMessage(C01PacketChatMessage packet, String message); | 19 | + public abstract void onSendChatMessage(CPacketChatMessage packet, String message); |
20 | } | 20 | } |
src/client/java/com/mumfrey/liteloader/PostLoginListener.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | import net.minecraft.network.login.INetHandlerLoginClient; | 3 | import net.minecraft.network.login.INetHandlerLoginClient; |
4 | -import net.minecraft.network.login.server.S02PacketLoginSuccess; | 4 | +import net.minecraft.network.login.server.SPacketLoginSuccess; |
5 | 5 | ||
6 | /** | 6 | /** |
7 | * | 7 | * |
@@ -17,5 +17,5 @@ public interface PostLoginListener extends LiteMod | @@ -17,5 +17,5 @@ public interface PostLoginListener extends LiteMod | ||
17 | * @param netHandler | 17 | * @param netHandler |
18 | * @param packet | 18 | * @param packet |
19 | */ | 19 | */ |
20 | - public abstract void onPostLogin(INetHandlerLoginClient netHandler, S02PacketLoginSuccess packet); | 20 | + public abstract void onPostLogin(INetHandlerLoginClient netHandler, SPacketLoginSuccess packet); |
21 | } | 21 | } |
src/client/java/com/mumfrey/liteloader/ScreenshotListener.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | import net.minecraft.client.shader.Framebuffer; | 3 | import net.minecraft.client.shader.Framebuffer; |
4 | -import net.minecraft.util.IChatComponent; | 4 | +import net.minecraft.util.text.ITextComponent; |
5 | 5 | ||
6 | import com.mumfrey.liteloader.core.LiteLoaderEventBroker.ReturnValue; | 6 | import com.mumfrey.liteloader.core.LiteLoaderEventBroker.ReturnValue; |
7 | 7 | ||
@@ -24,5 +24,5 @@ public interface ScreenshotListener extends LiteMod | @@ -24,5 +24,5 @@ public interface ScreenshotListener extends LiteMod | ||
24 | * @return FALSE to suspend further processing, or TRUE to allow processing | 24 | * @return FALSE to suspend further processing, or TRUE to allow processing |
25 | * to continue normally | 25 | * to continue normally |
26 | */ | 26 | */ |
27 | - public boolean onSaveScreenshot(String screenshotName, int width, int height, Framebuffer fbo, ReturnValue<IChatComponent> message); | 27 | + public boolean onSaveScreenshot(String screenshotName, int width, int height, Framebuffer fbo, ReturnValue<ITextComponent> message); |
28 | } | 28 | } |
src/client/java/com/mumfrey/liteloader/client/ClientPluginChannelsClient.java
@@ -9,11 +9,11 @@ import net.minecraft.network.INetHandler; | @@ -9,11 +9,11 @@ import net.minecraft.network.INetHandler; | ||
9 | import net.minecraft.network.NetworkManager; | 9 | import net.minecraft.network.NetworkManager; |
10 | import net.minecraft.network.PacketBuffer; | 10 | import net.minecraft.network.PacketBuffer; |
11 | import net.minecraft.network.login.INetHandlerLoginClient; | 11 | import net.minecraft.network.login.INetHandlerLoginClient; |
12 | -import net.minecraft.network.login.server.S02PacketLoginSuccess; | 12 | +import net.minecraft.network.login.server.SPacketLoginSuccess; |
13 | import net.minecraft.network.play.INetHandlerPlayClient; | 13 | import net.minecraft.network.play.INetHandlerPlayClient; |
14 | -import net.minecraft.network.play.client.C17PacketCustomPayload; | ||
15 | -import net.minecraft.network.play.server.S01PacketJoinGame; | ||
16 | -import net.minecraft.network.play.server.S3FPacketCustomPayload; | 14 | +import net.minecraft.network.play.client.CPacketCustomPayload; |
15 | +import net.minecraft.network.play.server.SPacketJoinGame; | ||
16 | +import net.minecraft.network.play.server.SPacketCustomPayload; | ||
17 | 17 | ||
18 | /** | 18 | /** |
19 | * Handler for client plugin channels | 19 | * Handler for client plugin channels |
@@ -26,7 +26,7 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | @@ -26,7 +26,7 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | ||
26 | * @param netHandler | 26 | * @param netHandler |
27 | * @param loginPacket | 27 | * @param loginPacket |
28 | */ | 28 | */ |
29 | - void onPostLogin(INetHandlerLoginClient netHandler, S02PacketLoginSuccess loginPacket) | 29 | + void onPostLogin(INetHandlerLoginClient netHandler, SPacketLoginSuccess loginPacket) |
30 | { | 30 | { |
31 | this.clearPluginChannels(netHandler); | 31 | this.clearPluginChannels(netHandler); |
32 | } | 32 | } |
@@ -35,7 +35,7 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | @@ -35,7 +35,7 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | ||
35 | * @param netHandler | 35 | * @param netHandler |
36 | * @param loginPacket | 36 | * @param loginPacket |
37 | */ | 37 | */ |
38 | - void onJoinGame(INetHandler netHandler, S01PacketJoinGame loginPacket) | 38 | + void onJoinGame(INetHandler netHandler, SPacketJoinGame loginPacket) |
39 | { | 39 | { |
40 | this.sendRegisteredPluginChannels(netHandler); | 40 | this.sendRegisteredPluginChannels(netHandler); |
41 | } | 41 | } |
@@ -46,7 +46,7 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | @@ -46,7 +46,7 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | ||
46 | * @param customPayload | 46 | * @param customPayload |
47 | */ | 47 | */ |
48 | @Override | 48 | @Override |
49 | - public void onPluginChannelMessage(S3FPacketCustomPayload customPayload) | 49 | + public void onPluginChannelMessage(SPacketCustomPayload customPayload) |
50 | { | 50 | { |
51 | if (customPayload != null && customPayload.getChannelName() != null) | 51 | if (customPayload != null && customPayload.getChannelName() != null) |
52 | { | 52 | { |
@@ -67,11 +67,11 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | @@ -67,11 +67,11 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | ||
67 | if (netHandler instanceof INetHandlerLoginClient) | 67 | if (netHandler instanceof INetHandlerLoginClient) |
68 | { | 68 | { |
69 | NetworkManager networkManager = ((IClientNetLoginHandler)netHandler).getNetMgr(); | 69 | NetworkManager networkManager = ((IClientNetLoginHandler)netHandler).getNetMgr(); |
70 | - networkManager.sendPacket(new C17PacketCustomPayload(CHANNEL_REGISTER, registrationData)); | 70 | + networkManager.sendPacket(new CPacketCustomPayload(CHANNEL_REGISTER, registrationData)); |
71 | } | 71 | } |
72 | else if (netHandler instanceof INetHandlerPlayClient) | 72 | else if (netHandler instanceof INetHandlerPlayClient) |
73 | { | 73 | { |
74 | - ClientPluginChannelsClient.dispatch(new C17PacketCustomPayload(CHANNEL_REGISTER, registrationData)); | 74 | + ClientPluginChannelsClient.dispatch(new CPacketCustomPayload(CHANNEL_REGISTER, registrationData)); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
@@ -95,14 +95,14 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | @@ -95,14 +95,14 @@ public class ClientPluginChannelsClient extends ClientPluginChannels | ||
95 | throw new UnregisteredChannelException(channel); | 95 | throw new UnregisteredChannelException(channel); |
96 | } | 96 | } |
97 | 97 | ||
98 | - C17PacketCustomPayload payload = new C17PacketCustomPayload(channel, data); | 98 | + CPacketCustomPayload payload = new CPacketCustomPayload(channel, data); |
99 | return ClientPluginChannelsClient.dispatch(payload); | 99 | return ClientPluginChannelsClient.dispatch(payload); |
100 | } | 100 | } |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * @param payload | 103 | * @param payload |
104 | */ | 104 | */ |
105 | - static boolean dispatch(C17PacketCustomPayload payload) | 105 | + static boolean dispatch(CPacketCustomPayload payload) |
106 | { | 106 | { |
107 | try | 107 | try |
108 | { | 108 | { |
src/client/java/com/mumfrey/liteloader/client/ClientProxy.java
@@ -16,7 +16,7 @@ import net.minecraft.client.renderer.entity.RenderManager; | @@ -16,7 +16,7 @@ import net.minecraft.client.renderer.entity.RenderManager; | ||
16 | import net.minecraft.client.shader.Framebuffer; | 16 | import net.minecraft.client.shader.Framebuffer; |
17 | import net.minecraft.entity.Entity; | 17 | import net.minecraft.entity.Entity; |
18 | import net.minecraft.server.integrated.IntegratedServer; | 18 | import net.minecraft.server.integrated.IntegratedServer; |
19 | -import net.minecraft.util.IChatComponent; | 19 | +import net.minecraft.util.text.ITextComponent; |
20 | import net.minecraft.world.WorldSettings; | 20 | import net.minecraft.world.WorldSettings; |
21 | 21 | ||
22 | /** | 22 | /** |
@@ -165,7 +165,7 @@ public abstract class ClientProxy extends Proxy | @@ -165,7 +165,7 @@ public abstract class ClientProxy extends Proxy | ||
165 | ClientProxy.broker.onRenderTerrain(partialTicks, pass, timeSlice); | 165 | ClientProxy.broker.onRenderTerrain(partialTicks, pass, timeSlice); |
166 | } | 166 | } |
167 | 167 | ||
168 | - public static void onSaveScreenshot(CallbackInfoReturnable<IChatComponent> ci, File gameDir, String name, int width, int height, | 168 | + public static void onSaveScreenshot(CallbackInfoReturnable<ITextComponent> ci, File gameDir, String name, int width, int height, |
169 | Framebuffer fbo) | 169 | Framebuffer fbo) |
170 | { | 170 | { |
171 | ClientProxy.broker.onScreenshot(ci, name, width, height, fbo); | 171 | ClientProxy.broker.onScreenshot(ci, name, width, height, fbo); |
src/client/java/com/mumfrey/liteloader/client/LiteLoaderCoreProviderClient.java
@@ -5,7 +5,7 @@ import net.minecraft.client.resources.IResourceManager; | @@ -5,7 +5,7 @@ import net.minecraft.client.resources.IResourceManager; | ||
5 | import net.minecraft.client.resources.IResourcePack; | 5 | import net.minecraft.client.resources.IResourcePack; |
6 | import net.minecraft.client.resources.SimpleReloadableResourceManager; | 6 | import net.minecraft.client.resources.SimpleReloadableResourceManager; |
7 | import net.minecraft.network.INetHandler; | 7 | import net.minecraft.network.INetHandler; |
8 | -import net.minecraft.network.play.server.S01PacketJoinGame; | 8 | +import net.minecraft.network.play.server.SPacketJoinGame; |
9 | import net.minecraft.world.World; | 9 | import net.minecraft.world.World; |
10 | 10 | ||
11 | import com.mumfrey.liteloader.api.CoreProvider; | 11 | import com.mumfrey.liteloader.api.CoreProvider; |
@@ -85,7 +85,7 @@ public class LiteLoaderCoreProviderClient implements CoreProvider | @@ -85,7 +85,7 @@ public class LiteLoaderCoreProviderClient implements CoreProvider | ||
85 | } | 85 | } |
86 | 86 | ||
87 | @Override | 87 | @Override |
88 | - public void onJoinGame(INetHandler netHandler, S01PacketJoinGame loginPacket) | 88 | + public void onJoinGame(INetHandler netHandler, SPacketJoinGame loginPacket) |
89 | { | 89 | { |
90 | } | 90 | } |
91 | 91 |
src/client/java/com/mumfrey/liteloader/client/LiteLoaderEventBrokerClient.java
@@ -4,7 +4,20 @@ import org.lwjgl.input.Mouse; | @@ -4,7 +4,20 @@ import org.lwjgl.input.Mouse; | ||
4 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | 4 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
5 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | 5 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
6 | 6 | ||
7 | -import com.mumfrey.liteloader.*; | 7 | +import com.mumfrey.liteloader.ChatRenderListener; |
8 | +import com.mumfrey.liteloader.EntityRenderListener; | ||
9 | +import com.mumfrey.liteloader.FrameBufferListener; | ||
10 | +import com.mumfrey.liteloader.GameLoopListener; | ||
11 | +import com.mumfrey.liteloader.HUDRenderListener; | ||
12 | +import com.mumfrey.liteloader.InitCompleteListener; | ||
13 | +import com.mumfrey.liteloader.OutboundChatFilter; | ||
14 | +import com.mumfrey.liteloader.OutboundChatListener; | ||
15 | +import com.mumfrey.liteloader.PostRenderListener; | ||
16 | +import com.mumfrey.liteloader.PreRenderListener; | ||
17 | +import com.mumfrey.liteloader.RenderListener; | ||
18 | +import com.mumfrey.liteloader.ScreenshotListener; | ||
19 | +import com.mumfrey.liteloader.Tickable; | ||
20 | +import com.mumfrey.liteloader.ViewportListener; | ||
8 | import com.mumfrey.liteloader.client.overlays.IEntityRenderer; | 21 | import com.mumfrey.liteloader.client.overlays.IEntityRenderer; |
9 | import com.mumfrey.liteloader.client.overlays.IMinecraft; | 22 | import com.mumfrey.liteloader.client.overlays.IMinecraft; |
10 | import com.mumfrey.liteloader.common.LoadingProgress; | 23 | import com.mumfrey.liteloader.common.LoadingProgress; |
@@ -28,10 +41,10 @@ import net.minecraft.client.resources.IResourceManager; | @@ -28,10 +41,10 @@ import net.minecraft.client.resources.IResourceManager; | ||
28 | import net.minecraft.client.resources.IResourceManagerReloadListener; | 41 | import net.minecraft.client.resources.IResourceManagerReloadListener; |
29 | import net.minecraft.client.shader.Framebuffer; | 42 | import net.minecraft.client.shader.Framebuffer; |
30 | import net.minecraft.entity.Entity; | 43 | import net.minecraft.entity.Entity; |
31 | -import net.minecraft.network.play.client.C01PacketChatMessage; | 44 | +import net.minecraft.network.play.client.CPacketChatMessage; |
32 | import net.minecraft.server.integrated.IntegratedServer; | 45 | import net.minecraft.server.integrated.IntegratedServer; |
33 | -import net.minecraft.util.IChatComponent; | ||
34 | import net.minecraft.util.Timer; | 46 | import net.minecraft.util.Timer; |
47 | +import net.minecraft.util.text.ITextComponent; | ||
35 | 48 | ||
36 | public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft, IntegratedServer> implements IResourceManagerReloadListener | 49 | public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft, IntegratedServer> implements IResourceManagerReloadListener |
37 | { | 50 | { |
@@ -434,7 +447,7 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | @@ -434,7 +447,7 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | ||
434 | * @param packet | 447 | * @param packet |
435 | * @param message | 448 | * @param message |
436 | */ | 449 | */ |
437 | - void onSendChatMessage(C01PacketChatMessage packet, String message) | 450 | + void onSendChatMessage(CPacketChatMessage packet, String message) |
438 | { | 451 | { |
439 | this.outboundChatListeners.all().onSendChatMessage(packet, message); | 452 | this.outboundChatListeners.all().onSendChatMessage(packet, message); |
440 | } | 453 | } |
@@ -522,9 +535,9 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | @@ -522,9 +535,9 @@ public class LiteLoaderEventBrokerClient extends LiteLoaderEventBroker<Minecraft | ||
522 | * @param height | 535 | * @param height |
523 | * @param fbo | 536 | * @param fbo |
524 | */ | 537 | */ |
525 | - void onScreenshot(CallbackInfoReturnable<IChatComponent> ci, String name, int width, int height, Framebuffer fbo) | 538 | + void onScreenshot(CallbackInfoReturnable<ITextComponent> ci, String name, int width, int height, Framebuffer fbo) |
526 | { | 539 | { |
527 | - ReturnValue<IChatComponent> ret = new ReturnValue<IChatComponent>(ci.getReturnValue()); | 540 | + ReturnValue<ITextComponent> ret = new ReturnValue<ITextComponent>(ci.getReturnValue()); |
528 | 541 | ||
529 | if (!this.screenshotListeners.all().onSaveScreenshot(name, width, height, fbo, ret)) | 542 | if (!this.screenshotListeners.all().onSaveScreenshot(name, width, height, fbo, ret)) |
530 | { | 543 | { |
src/client/java/com/mumfrey/liteloader/client/PacketEventsClient.java
@@ -21,13 +21,12 @@ import net.minecraft.client.Minecraft; | @@ -21,13 +21,12 @@ import net.minecraft.client.Minecraft; | ||
21 | import net.minecraft.network.INetHandler; | 21 | import net.minecraft.network.INetHandler; |
22 | import net.minecraft.network.Packet; | 22 | import net.minecraft.network.Packet; |
23 | import net.minecraft.network.login.INetHandlerLoginClient; | 23 | import net.minecraft.network.login.INetHandlerLoginClient; |
24 | -import net.minecraft.network.login.server.S02PacketLoginSuccess; | 24 | +import net.minecraft.network.login.server.SPacketLoginSuccess; |
25 | import net.minecraft.network.play.INetHandlerPlayClient; | 25 | import net.minecraft.network.play.INetHandlerPlayClient; |
26 | -import net.minecraft.network.play.server.S01PacketJoinGame; | ||
27 | -import net.minecraft.network.play.server.S02PacketChat; | ||
28 | -import net.minecraft.server.MinecraftServer; | ||
29 | -import net.minecraft.util.ChatComponentText; | ||
30 | -import net.minecraft.util.IChatComponent; | 26 | +import net.minecraft.network.play.server.SPacketJoinGame; |
27 | +import net.minecraft.network.play.server.SPacketChat; | ||
28 | +import net.minecraft.util.text.TextComponentString; | ||
29 | +import net.minecraft.util.text.ITextComponent; | ||
31 | import net.minecraft.util.IThreadListener; | 30 | import net.minecraft.util.IThreadListener; |
32 | 31 | ||
33 | /** | 32 | /** |
@@ -115,22 +114,23 @@ public class PacketEventsClient extends PacketEvents | @@ -115,22 +114,23 @@ public class PacketEventsClient extends PacketEvents | ||
115 | @Override | 114 | @Override |
116 | protected IThreadListener getPacketContextListener(Packets.Context context) | 115 | protected IThreadListener getPacketContextListener(Packets.Context context) |
117 | { | 116 | { |
117 | + Minecraft minecraft = Minecraft.getMinecraft(); | ||
118 | if (context == Packets.Context.SERVER) | 118 | if (context == Packets.Context.SERVER) |
119 | { | 119 | { |
120 | - return MinecraftServer.getServer(); | 120 | + return minecraft.getIntegratedServer(); |
121 | } | 121 | } |
122 | 122 | ||
123 | - return Minecraft.getMinecraft(); | 123 | + return minecraft; |
124 | } | 124 | } |
125 | 125 | ||
126 | /* (non-Javadoc) | 126 | /* (non-Javadoc) |
127 | * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket( | 127 | * @see com.mumfrey.liteloader.core.PacketEvents#handlePacket( |
128 | * com.mumfrey.liteloader.common.transformers.PacketEventInfo, | 128 | * com.mumfrey.liteloader.common.transformers.PacketEventInfo, |
129 | * net.minecraft.network.INetHandler, | 129 | * net.minecraft.network.INetHandler, |
130 | - * net.minecraft.network.play.server.S01PacketJoinGame) | 130 | + * net.minecraft.network.play.server.SPacketJoinGame) |
131 | */ | 131 | */ |
132 | @Override | 132 | @Override |
133 | - protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S01PacketJoinGame packet) | 133 | + protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketJoinGame packet) |
134 | { | 134 | { |
135 | if (this.preJoinGame(e, netHandler, packet)) | 135 | if (this.preJoinGame(e, netHandler, packet)) |
136 | { | 136 | { |
@@ -149,7 +149,7 @@ public class PacketEventsClient extends PacketEvents | @@ -149,7 +149,7 @@ public class PacketEventsClient extends PacketEvents | ||
149 | * @param packet | 149 | * @param packet |
150 | * @throws EventCancellationException | 150 | * @throws EventCancellationException |
151 | */ | 151 | */ |
152 | - private boolean preJoinGame(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S01PacketJoinGame packet) throws EventCancellationException | 152 | + private boolean preJoinGame(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketJoinGame packet) throws EventCancellationException |
153 | { | 153 | { |
154 | if (!(netHandler instanceof INetHandlerPlayClient)) | 154 | if (!(netHandler instanceof INetHandlerPlayClient)) |
155 | { | 155 | { |
@@ -166,7 +166,7 @@ public class PacketEventsClient extends PacketEvents | @@ -166,7 +166,7 @@ public class PacketEventsClient extends PacketEvents | ||
166 | * @param netHandler | 166 | * @param netHandler |
167 | * @param packet | 167 | * @param packet |
168 | */ | 168 | */ |
169 | - private void postJoinGame(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S01PacketJoinGame packet) | 169 | + private void postJoinGame(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketJoinGame packet) |
170 | { | 170 | { |
171 | this.joinGameListeners.all().onJoinGame(netHandler, packet, Minecraft.getMinecraft().getCurrentServerData(), PacketEventsClient.joiningRealm); | 171 | this.joinGameListeners.all().onJoinGame(netHandler, packet, Minecraft.getMinecraft().getCurrentServerData(), PacketEventsClient.joiningRealm); |
172 | PacketEventsClient.joiningRealm = null; | 172 | PacketEventsClient.joiningRealm = null; |
@@ -185,7 +185,7 @@ public class PacketEventsClient extends PacketEvents | @@ -185,7 +185,7 @@ public class PacketEventsClient extends PacketEvents | ||
185 | * net.minecraft.network.login.server.S02PacketLoginSuccess) | 185 | * net.minecraft.network.login.server.S02PacketLoginSuccess) |
186 | */ | 186 | */ |
187 | @Override | 187 | @Override |
188 | - protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S02PacketLoginSuccess packet) | 188 | + protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketLoginSuccess packet) |
189 | { | 189 | { |
190 | if (netHandler instanceof INetHandlerLoginClient) | 190 | if (netHandler instanceof INetHandlerLoginClient) |
191 | { | 191 | { |
@@ -208,21 +208,21 @@ public class PacketEventsClient extends PacketEvents | @@ -208,21 +208,21 @@ public class PacketEventsClient extends PacketEvents | ||
208 | * net.minecraft.network.play.server.S02PacketChat) | 208 | * net.minecraft.network.play.server.S02PacketChat) |
209 | */ | 209 | */ |
210 | @Override | 210 | @Override |
211 | - protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S02PacketChat packet) | 211 | + protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketChat packet) |
212 | { | 212 | { |
213 | if (packet.getChatComponent() == null) | 213 | if (packet.getChatComponent() == null) |
214 | { | 214 | { |
215 | return; | 215 | return; |
216 | } | 216 | } |
217 | 217 | ||
218 | - IChatComponent originalChat = packet.getChatComponent(); | ||
219 | - IChatComponent chat = originalChat; | 218 | + ITextComponent originalChat = packet.getChatComponent(); |
219 | + ITextComponent chat = originalChat; | ||
220 | String message = chat.getFormattedText(); | 220 | String message = chat.getFormattedText(); |
221 | 221 | ||
222 | // Chat filters get a stab at the chat first, if any filter returns false the chat is discarded | 222 | // Chat filters get a stab at the chat first, if any filter returns false the chat is discarded |
223 | for (ChatFilter chatFilter : this.chatFilters) | 223 | for (ChatFilter chatFilter : this.chatFilters) |
224 | { | 224 | { |
225 | - ReturnValue<IChatComponent> ret = new ReturnValue<IChatComponent>(); | 225 | + ReturnValue<ITextComponent> ret = new ReturnValue<ITextComponent>(); |
226 | 226 | ||
227 | if (chatFilter.onChat(chat, message, ret)) | 227 | if (chatFilter.onChat(chat, message, ret)) |
228 | { | 228 | { |
@@ -231,7 +231,7 @@ public class PacketEventsClient extends PacketEvents | @@ -231,7 +231,7 @@ public class PacketEventsClient extends PacketEvents | ||
231 | chat = ret.get(); | 231 | chat = ret.get(); |
232 | if (chat == null) | 232 | if (chat == null) |
233 | { | 233 | { |
234 | - chat = new ChatComponentText(""); | 234 | + chat = new TextComponentString(""); |
235 | } | 235 | } |
236 | message = chat.getFormattedText(); | 236 | message = chat.getFormattedText(); |
237 | } | 237 | } |
src/client/java/com/mumfrey/liteloader/client/ducks/IIntIdentityHashBiMap.java
0 โ 100644
src/client/java/com/mumfrey/liteloader/client/ducks/INamespacedRegistry.java renamed to src/client/java/com/mumfrey/liteloader/client/ducks/IMutableRegistry.java
1 | package com.mumfrey.liteloader.client.ducks; | 1 | package com.mumfrey.liteloader.client.ducks; |
2 | 2 | ||
3 | -public interface INamespacedRegistry | 3 | +public interface IMutableRegistry<K, V> |
4 | { | 4 | { |
5 | - public abstract IObjectIntIdentityMap getUnderlyingMap(); | 5 | + public abstract V removeObjectFromRegistry(K key); |
6 | } | 6 | } |
src/client/java/com/mumfrey/liteloader/client/ducks/IObjectIntIdentityMap.java deleted
100644 โ 0
src/client/java/com/mumfrey/liteloader/client/ducks/IRegistrySimple.java deleted
100644 โ 0
src/client/java/com/mumfrey/liteloader/client/gui/GuiLiteLoaderPanel.java
1 | package com.mumfrey.liteloader.client.gui; | 1 | package com.mumfrey.liteloader.client.gui; |
2 | 2 | ||
3 | import static com.mumfrey.liteloader.gl.GL.*; | 3 | import static com.mumfrey.liteloader.gl.GL.*; |
4 | -import static net.minecraft.client.renderer.vertex.DefaultVertexFormats.*; | ||
5 | 4 | ||
6 | import java.io.IOException; | 5 | import java.io.IOException; |
7 | import java.util.ArrayList; | 6 | import java.util.ArrayList; |
@@ -32,7 +31,7 @@ import net.minecraft.client.gui.GuiButton; | @@ -32,7 +31,7 @@ import net.minecraft.client.gui.GuiButton; | ||
32 | import net.minecraft.client.gui.GuiMainMenu; | 31 | import net.minecraft.client.gui.GuiMainMenu; |
33 | import net.minecraft.client.gui.GuiScreen; | 32 | import net.minecraft.client.gui.GuiScreen; |
34 | import net.minecraft.client.renderer.Tessellator; | 33 | import net.minecraft.client.renderer.Tessellator; |
35 | -import net.minecraft.client.renderer.WorldRenderer; | 34 | +import net.minecraft.client.renderer.VertexBuffer; |
36 | import net.minecraft.client.resources.I18n; | 35 | import net.minecraft.client.resources.I18n; |
37 | import net.minecraft.util.ResourceLocation; | 36 | import net.minecraft.util.ResourceLocation; |
38 | 37 | ||
@@ -790,8 +789,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | @@ -790,8 +789,8 @@ public class GuiLiteLoaderPanel extends GuiScreen | ||
790 | glColor4f(1.0F, 1.0F, 1.0F, alpha); | 789 | glColor4f(1.0F, 1.0F, 1.0F, alpha); |
791 | 790 | ||
792 | Tessellator tessellator = Tessellator.getInstance(); | 791 | Tessellator tessellator = Tessellator.getInstance(); |
793 | - WorldRenderer worldRenderer = tessellator.getWorldRenderer(); | ||
794 | - worldRenderer.begin(GL_QUADS, POSITION_TEX); | 792 | + VertexBuffer worldRenderer = tessellator.getBuffer(); |
793 | + worldRenderer.begin(GL_QUADS, VF_POSITION_TEX); | ||
795 | worldRenderer.pos(x + 0, y + height, 0).tex(u , v2).endVertex(); | 794 | worldRenderer.pos(x + 0, y + height, 0).tex(u , v2).endVertex(); |
796 | worldRenderer.pos(x + width, y + height, 0).tex(u2, v2).endVertex(); | 795 | worldRenderer.pos(x + width, y + height, 0).tex(u2, v2).endVertex(); |
797 | worldRenderer.pos(x + width, y + 0, 0).tex(u2, v ).endVertex(); | 796 | worldRenderer.pos(x + width, y + 0, 0).tex(u2, v ).endVertex(); |
src/client/java/com/mumfrey/liteloader/client/gui/startup/LoadingBar.java
1 | package com.mumfrey.liteloader.client.gui.startup; | 1 | package com.mumfrey.liteloader.client.gui.startup; |
2 | 2 | ||
3 | import static com.mumfrey.liteloader.gl.GL.*; | 3 | import static com.mumfrey.liteloader.gl.GL.*; |
4 | -import static net.minecraft.client.renderer.vertex.DefaultVertexFormats.*; | ||
5 | 4 | ||
6 | import java.awt.image.BufferedImage; | 5 | import java.awt.image.BufferedImage; |
7 | import java.io.IOException; | 6 | import java.io.IOException; |
@@ -15,7 +14,7 @@ import net.minecraft.client.Minecraft; | @@ -15,7 +14,7 @@ import net.minecraft.client.Minecraft; | ||
15 | import net.minecraft.client.gui.FontRenderer; | 14 | import net.minecraft.client.gui.FontRenderer; |
16 | import net.minecraft.client.gui.ScaledResolution; | 15 | import net.minecraft.client.gui.ScaledResolution; |
17 | import net.minecraft.client.renderer.Tessellator; | 16 | import net.minecraft.client.renderer.Tessellator; |
18 | -import net.minecraft.client.renderer.WorldRenderer; | 17 | +import net.minecraft.client.renderer.VertexBuffer; |
19 | import net.minecraft.client.renderer.texture.DynamicTexture; | 18 | import net.minecraft.client.renderer.texture.DynamicTexture; |
20 | import net.minecraft.client.renderer.texture.ITextureObject; | 19 | import net.minecraft.client.renderer.texture.ITextureObject; |
21 | import net.minecraft.client.renderer.texture.TextureManager; | 20 | import net.minecraft.client.renderer.texture.TextureManager; |
@@ -255,13 +254,13 @@ public class LoadingBar extends LoadingProgress | @@ -255,13 +254,13 @@ public class LoadingBar extends LoadingProgress | ||
255 | 254 | ||
256 | this.textureManager.bindTexture(this.textureLocation); | 255 | this.textureManager.bindTexture(this.textureLocation); |
257 | Tessellator tessellator = Tessellator.getInstance(); | 256 | Tessellator tessellator = Tessellator.getInstance(); |
258 | - WorldRenderer worldRenderer = tessellator.getWorldRenderer(); | ||
259 | - worldRenderer.begin(GL_QUADS, POSITION); | 257 | + VertexBuffer vertexBuffer = tessellator.getBuffer(); |
258 | + vertexBuffer.begin(GL_QUADS, VF_POSITION); | ||
260 | glColor4f(1.0F, 1.0F, 1.0F, 1.0F); | 259 | glColor4f(1.0F, 1.0F, 1.0F, 1.0F); |
261 | - worldRenderer.pos(0.0D, scaledHeight, 0.0D).endVertex(); | ||
262 | - worldRenderer.pos(scaledWidth, scaledHeight, 0.0D).endVertex(); | ||
263 | - worldRenderer.pos(scaledWidth, 0.0D, 0.0D).endVertex(); | ||
264 | - worldRenderer.pos(0.0D, 0.0D, 0.0D).endVertex(); | 260 | + vertexBuffer.pos(0.0D, scaledHeight, 0.0D).endVertex(); |
261 | + vertexBuffer.pos(scaledWidth, scaledHeight, 0.0D).endVertex(); | ||
262 | + vertexBuffer.pos(scaledWidth, 0.0D, 0.0D).endVertex(); | ||
263 | + vertexBuffer.pos(0.0D, 0.0D, 0.0D).endVertex(); | ||
265 | tessellator.draw(); | 264 | tessellator.draw(); |
266 | 265 | ||
267 | glColor4f(1.0F, 1.0F, 1.0F, 1.0F); | 266 | glColor4f(1.0F, 1.0F, 1.0F, 1.0F); |
@@ -274,11 +273,11 @@ public class LoadingBar extends LoadingProgress | @@ -274,11 +273,11 @@ public class LoadingBar extends LoadingProgress | ||
274 | int v2 = 256; | 273 | int v2 = 256; |
275 | 274 | ||
276 | float texMapScale = 0.00390625F; | 275 | float texMapScale = 0.00390625F; |
277 | - worldRenderer.begin(GL_QUADS, POSITION_TEX); | ||
278 | - worldRenderer.pos(left + 0, top + v2, 0.0D).tex((u1 + 0) * texMapScale, (v1 + v2) * texMapScale).endVertex(); | ||
279 | - worldRenderer.pos(left + u2, top + v2, 0.0D).tex((u1 + u2) * texMapScale, (v1 + v2) * texMapScale).endVertex(); | ||
280 | - worldRenderer.pos(left + u2, top + 0, 0.0D).tex((u1 + u2) * texMapScale, (v1 + 0) * texMapScale).endVertex(); | ||
281 | - worldRenderer.pos(left + 0, top + 0, 0.0D).tex((u1 + 0) * texMapScale, (v1 + 0) * texMapScale).endVertex(); | 276 | + vertexBuffer.begin(GL_QUADS, VF_POSITION_TEX); |
277 | + vertexBuffer.pos(left + 0, top + v2, 0.0D).tex((u1 + 0) * texMapScale, (v1 + v2) * texMapScale).endVertex(); | ||
278 | + vertexBuffer.pos(left + u2, top + v2, 0.0D).tex((u1 + u2) * texMapScale, (v1 + v2) * texMapScale).endVertex(); | ||
279 | + vertexBuffer.pos(left + u2, top + 0, 0.0D).tex((u1 + u2) * texMapScale, (v1 + 0) * texMapScale).endVertex(); | ||
280 | + vertexBuffer.pos(left + 0, top + 0, 0.0D).tex((u1 + 0) * texMapScale, (v1 + 0) * texMapScale).endVertex(); | ||
282 | tessellator.draw(); | 281 | tessellator.draw(); |
283 | 282 | ||
284 | glEnableTexture2D(); | 283 | glEnableTexture2D(); |
@@ -319,25 +318,25 @@ public class LoadingBar extends LoadingProgress | @@ -319,25 +318,25 @@ public class LoadingBar extends LoadingProgress | ||
319 | // tessellator.addVertex(0.0D, scaledHeight - (scaledHeight / 3), 0.0D); | 318 | // tessellator.addVertex(0.0D, scaledHeight - (scaledHeight / 3), 0.0D); |
320 | // tessellator.draw(); | 319 | // tessellator.draw(); |
321 | 320 | ||
322 | - worldRenderer.begin(GL_QUADS, POSITION); | 321 | + vertexBuffer.begin(GL_QUADS, VF_POSITION); |
323 | float luma = this.barLuma / 255.0F; | 322 | float luma = this.barLuma / 255.0F; |
324 | glColor4f(luma, luma, luma, 0.5F); | 323 | glColor4f(luma, luma, luma, 0.5F); |
325 | - worldRenderer.pos(0.0D, scaledHeight, 0.0D).endVertex(); | ||
326 | - worldRenderer.pos(0.0D + scaledWidth, scaledHeight, 0.0D).endVertex(); | ||
327 | - worldRenderer.pos(0.0D + scaledWidth, scaledHeight - barHeight, 0.0D).endVertex(); | ||
328 | - worldRenderer.pos(0.0D, scaledHeight - barHeight, 0.0D).endVertex(); | 324 | + vertexBuffer.pos(0.0D, scaledHeight, 0.0D).endVertex(); |
325 | + vertexBuffer.pos(0.0D + scaledWidth, scaledHeight, 0.0D).endVertex(); | ||
326 | + vertexBuffer.pos(0.0D + scaledWidth, scaledHeight - barHeight, 0.0D).endVertex(); | ||
327 | + vertexBuffer.pos(0.0D, scaledHeight - barHeight, 0.0D).endVertex(); | ||
329 | tessellator.draw(); | 328 | tessellator.draw(); |
330 | 329 | ||
331 | barHeight -= 1; | 330 | barHeight -= 1; |
332 | 331 | ||
333 | - worldRenderer.begin(GL_QUADS, POSITION_COLOR); | 332 | + vertexBuffer.begin(GL_QUADS, VF_POSITION_COLOR); |
334 | float r2 = this.r2 / 255.0F; | 333 | float r2 = this.r2 / 255.0F; |
335 | float g2 = this.g2 / 255.0F; | 334 | float g2 = this.g2 / 255.0F; |
336 | float b2 = this.b2 / 255.0F; | 335 | float b2 = this.b2 / 255.0F; |
337 | - worldRenderer.pos(1.0D + barWidth * progress, scaledHeight - 1, 1.0D).color(r2, g2, b2, 1.0F).endVertex(); | ||
338 | - worldRenderer.pos(1.0D + barWidth * progress, scaledHeight - barHeight, 1.0D).color(r2, g2, b2, 1.0F).endVertex(); | ||
339 | - worldRenderer.pos(1.0D, scaledHeight - barHeight, 1.0D).color(0.0F, 0.0F, 0.0F, 1.0F).endVertex(); | ||
340 | - worldRenderer.pos(1.0D, scaledHeight - 1, 1.0D).color(0.0F, 0.0F, 0.0F, 1.0F).endVertex(); | 336 | + vertexBuffer.pos(1.0D + barWidth * progress, scaledHeight - 1, 1.0D).color(r2, g2, b2, 1.0F).endVertex(); |
337 | + vertexBuffer.pos(1.0D + barWidth * progress, scaledHeight - barHeight, 1.0D).color(r2, g2, b2, 1.0F).endVertex(); | ||
338 | + vertexBuffer.pos(1.0D, scaledHeight - barHeight, 1.0D).color(0.0F, 0.0F, 0.0F, 1.0F).endVertex(); | ||
339 | + vertexBuffer.pos(1.0D, scaledHeight - 1, 1.0D).color(0.0F, 0.0F, 0.0F, 1.0F).endVertex(); | ||
341 | tessellator.draw(); | 340 | tessellator.draw(); |
342 | 341 | ||
343 | glAlphaFunc(GL_GREATER, 0.1F); | 342 | glAlphaFunc(GL_GREATER, 0.1F); |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinEntityRenderer.java
@@ -17,7 +17,7 @@ import net.minecraft.util.ResourceLocation; | @@ -17,7 +17,7 @@ import net.minecraft.util.ResourceLocation; | ||
17 | @Mixin(EntityRenderer.class) | 17 | @Mixin(EntityRenderer.class) |
18 | public abstract class MixinEntityRenderer implements IEntityRenderer | 18 | public abstract class MixinEntityRenderer implements IEntityRenderer |
19 | { | 19 | { |
20 | - @Shadow private static ResourceLocation[] shaderResourceLocations; | 20 | + @Shadow private static ResourceLocation[] SHADERS_TEXTURES; |
21 | @Shadow private boolean useShader; | 21 | @Shadow private boolean useShader; |
22 | @Shadow private int shaderIndex; | 22 | @Shadow private int shaderIndex; |
23 | 23 | ||
@@ -139,7 +139,7 @@ public abstract class MixinEntityRenderer implements IEntityRenderer | @@ -139,7 +139,7 @@ public abstract class MixinEntityRenderer implements IEntityRenderer | ||
139 | @Override | 139 | @Override |
140 | public ResourceLocation[] getShaders() | 140 | public ResourceLocation[] getShaders() |
141 | { | 141 | { |
142 | - return MixinEntityRenderer.shaderResourceLocations; | 142 | + return MixinEntityRenderer.SHADERS_TEXTURES; |
143 | } | 143 | } |
144 | 144 | ||
145 | @Override | 145 | @Override |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinGuiIngame.java
1 | package com.mumfrey.liteloader.client.mixin; | 1 | package com.mumfrey.liteloader.client.mixin; |
2 | 2 | ||
3 | +import org.spongepowered.asm.mixin.Final; | ||
3 | import org.spongepowered.asm.mixin.Mixin; | 4 | import org.spongepowered.asm.mixin.Mixin; |
4 | import org.spongepowered.asm.mixin.Shadow; | 5 | import org.spongepowered.asm.mixin.Shadow; |
5 | import org.spongepowered.asm.mixin.injection.At; | 6 | import org.spongepowered.asm.mixin.injection.At; |
@@ -16,7 +17,7 @@ import net.minecraft.client.gui.GuiNewChat; | @@ -16,7 +17,7 @@ import net.minecraft.client.gui.GuiNewChat; | ||
16 | @Mixin(GuiIngame.class) | 17 | @Mixin(GuiIngame.class) |
17 | public abstract class MixinGuiIngame extends Gui | 18 | public abstract class MixinGuiIngame extends Gui |
18 | { | 19 | { |
19 | - @Shadow private GuiNewChat persistantChatGUI; | 20 | + @Shadow @Final private GuiNewChat persistantChatGUI; |
20 | 21 | ||
21 | @Inject(method = "renderGameOverlay(F)V", at = @At( | 22 | @Inject(method = "renderGameOverlay(F)V", at = @At( |
22 | value = "INVOKE", | 23 | value = "INVOKE", |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinIntIdentityHashBiMap.java
0 โ 100644
1 | +/* | ||
2 | + * This file is part of LiteLoader. | ||
3 | + * Copyright (C) 2012-16 Adam Mummery-Smith | ||
4 | + * All Rights Reserved. | ||
5 | + */ | ||
6 | +package com.mumfrey.liteloader.client.mixin; | ||
7 | + | ||
8 | +import org.spongepowered.asm.mixin.Mixin; | ||
9 | +import org.spongepowered.asm.mixin.Shadow; | ||
10 | + | ||
11 | +import com.mumfrey.liteloader.client.ducks.IIntIdentityHashBiMap; | ||
12 | + | ||
13 | +import net.minecraft.util.IntIdentityHashBiMap; | ||
14 | + | ||
15 | +@Mixin(IntIdentityHashBiMap.class) | ||
16 | +public abstract class MixinIntIdentityHashBiMap<V> implements IIntIdentityHashBiMap<V> | ||
17 | +{ | ||
18 | + @Shadow private static final Object field_186817_a = null; | ||
19 | + @Shadow private V[] objectArray; | ||
20 | + @Shadow private int[] intKeys; | ||
21 | + @Shadow private V[] intToObjects; | ||
22 | + @Shadow private int field_186821_e; | ||
23 | + @Shadow private int mapSize; | ||
24 | + | ||
25 | + @Shadow private int func_186816_b(V object, int hash) | ||
26 | + { | ||
27 | + return -1; | ||
28 | + } | ||
29 | + | ||
30 | + @Shadow private int hashObject(V object) | ||
31 | + { | ||
32 | + return -1; | ||
33 | + } | ||
34 | + | ||
35 | + @Override | ||
36 | + public void removeObject(V object) | ||
37 | + { | ||
38 | + int index = this.func_186816_b(object, this.hashObject(object)); | ||
39 | + int intKey = this.intKeys[index]; | ||
40 | + this.objectArray[index] = null; | ||
41 | + this.intKeys[index] = 0; | ||
42 | + this.intToObjects[intKey] = null; | ||
43 | + } | ||
44 | +} |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinIntegratedServer.java
@@ -6,11 +6,15 @@ import org.spongepowered.asm.mixin.injection.Inject; | @@ -6,11 +6,15 @@ import org.spongepowered.asm.mixin.injection.Inject; | ||
6 | import org.spongepowered.asm.mixin.injection.Surrogate; | 6 | import org.spongepowered.asm.mixin.injection.Surrogate; |
7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
8 | 8 | ||
9 | +import com.mojang.authlib.GameProfileRepository; | ||
10 | +import com.mojang.authlib.minecraft.MinecraftSessionService; | ||
11 | +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; | ||
9 | import com.mumfrey.liteloader.client.ClientProxy; | 12 | import com.mumfrey.liteloader.client.ClientProxy; |
10 | 13 | ||
11 | import net.minecraft.client.Minecraft; | 14 | import net.minecraft.client.Minecraft; |
12 | import net.minecraft.server.MinecraftServer; | 15 | import net.minecraft.server.MinecraftServer; |
13 | import net.minecraft.server.integrated.IntegratedServer; | 16 | import net.minecraft.server.integrated.IntegratedServer; |
17 | +import net.minecraft.server.management.PlayerProfileCache; | ||
14 | import net.minecraft.world.WorldSettings; | 18 | import net.minecraft.world.WorldSettings; |
15 | 19 | ||
16 | @Mixin(IntegratedServer.class) | 20 | @Mixin(IntegratedServer.class) |
@@ -18,7 +22,7 @@ public abstract class MixinIntegratedServer extends MinecraftServer | @@ -18,7 +22,7 @@ public abstract class MixinIntegratedServer extends MinecraftServer | ||
18 | { | 22 | { |
19 | public MixinIntegratedServer() | 23 | public MixinIntegratedServer() |
20 | { | 24 | { |
21 | - super(null, null); | 25 | + super(null, null, null, null, null, null, null); |
22 | } | 26 | } |
23 | 27 | ||
24 | @Inject( | 28 | @Inject( |
@@ -26,7 +30,8 @@ public abstract class MixinIntegratedServer extends MinecraftServer | @@ -26,7 +30,8 @@ public abstract class MixinIntegratedServer extends MinecraftServer | ||
26 | at = @At("RETURN"), | 30 | at = @At("RETURN"), |
27 | remap = false | 31 | remap = false |
28 | ) | 32 | ) |
29 | - private void onConstructed(Minecraft mcIn, String folderName, String worldName, WorldSettings settings, CallbackInfo ci) | 33 | + private void onConstructed(Minecraft mcIn, String folderName, String worldName, WorldSettings settings, YggdrasilAuthenticationService authSrv, |
34 | + MinecraftSessionService sessionSrv, GameProfileRepository profileRepo, PlayerProfileCache profileCache, CallbackInfo ci) | ||
30 | { | 35 | { |
31 | ClientProxy.onCreateIntegratedServer((IntegratedServer)(Object)this, folderName, worldName, settings); | 36 | ClientProxy.onCreateIntegratedServer((IntegratedServer)(Object)this, folderName, worldName, settings); |
32 | } | 37 | } |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinObjectIntIdentityMap.java deleted
100644 โ 0
1 | -package com.mumfrey.liteloader.client.mixin; | ||
2 | - | ||
3 | -import java.util.IdentityHashMap; | ||
4 | -import java.util.List; | ||
5 | - | ||
6 | -import org.spongepowered.asm.mixin.Mixin; | ||
7 | -import org.spongepowered.asm.mixin.Shadow; | ||
8 | - | ||
9 | -import com.mumfrey.liteloader.client.ducks.IObjectIntIdentityMap; | ||
10 | - | ||
11 | -import net.minecraft.util.ObjectIntIdentityMap; | ||
12 | - | ||
13 | -@Mixin(ObjectIntIdentityMap.class) | ||
14 | -public abstract class MixinObjectIntIdentityMap<T> implements IObjectIntIdentityMap | ||
15 | -{ | ||
16 | - @Shadow private IdentityHashMap<T, Integer> identityMap; | ||
17 | - @Shadow private List<T> objectList; | ||
18 | - | ||
19 | - @SuppressWarnings("unchecked") | ||
20 | - @Override | ||
21 | - public <V> IdentityHashMap<V, Integer> getIdentityMap() | ||
22 | - { | ||
23 | - return (IdentityHashMap<V, Integer>)this.identityMap; | ||
24 | - } | ||
25 | - | ||
26 | - @SuppressWarnings("unchecked") | ||
27 | - @Override | ||
28 | - public <V> List<V> getObjectList() | ||
29 | - { | ||
30 | - return (List<V>)this.objectList; | ||
31 | - } | ||
32 | -} |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinRegistryNamespaced.java
1 | package com.mumfrey.liteloader.client.mixin; | 1 | package com.mumfrey.liteloader.client.mixin; |
2 | 2 | ||
3 | +import org.spongepowered.asm.mixin.Final; | ||
3 | import org.spongepowered.asm.mixin.Mixin; | 4 | import org.spongepowered.asm.mixin.Mixin; |
4 | import org.spongepowered.asm.mixin.Shadow; | 5 | import org.spongepowered.asm.mixin.Shadow; |
5 | 6 | ||
6 | -import com.mumfrey.liteloader.client.ducks.INamespacedRegistry; | ||
7 | -import com.mumfrey.liteloader.client.ducks.IObjectIntIdentityMap; | 7 | +import com.mumfrey.liteloader.client.ducks.IIntIdentityHashBiMap; |
8 | 8 | ||
9 | -import net.minecraft.util.ObjectIntIdentityMap; | ||
10 | -import net.minecraft.util.RegistryNamespaced; | ||
11 | -import net.minecraft.util.RegistrySimple; | 9 | +import net.minecraft.util.IntIdentityHashBiMap; |
10 | +import net.minecraft.util.registry.RegistryNamespaced; | ||
12 | 11 | ||
13 | @Mixin(RegistryNamespaced.class) | 12 | @Mixin(RegistryNamespaced.class) |
14 | -public abstract class MixinRegistryNamespaced<K, V> extends RegistrySimple<K, V> implements INamespacedRegistry | 13 | +public abstract class MixinRegistryNamespaced<K, V> extends MixinRegistrySimple<K, V> |
15 | { | 14 | { |
16 | - @Shadow protected ObjectIntIdentityMap<V> underlyingIntegerMap; | ||
17 | - | 15 | + @Shadow @Final protected IntIdentityHashBiMap<V> underlyingIntegerMap; |
16 | + | ||
17 | + @SuppressWarnings("unchecked") | ||
18 | @Override | 18 | @Override |
19 | - public IObjectIntIdentityMap getUnderlyingMap() | 19 | + public V removeObjectFromRegistry(K key) |
20 | { | 20 | { |
21 | - return (IObjectIntIdentityMap)this.underlyingIntegerMap; | 21 | + V removed = super.removeObjectFromRegistry(key); |
22 | + System.err.println("===================================================================================================="); | ||
23 | + System.err.println("===================================================================================================="); | ||
24 | + System.err.println("Removed object: " + removed); | ||
25 | + if (removed != null && this.underlyingIntegerMap instanceof IIntIdentityHashBiMap) | ||
26 | + { | ||
27 | + System.err.println("Removing " + removed + " from underlying int map"); | ||
28 | + ((IIntIdentityHashBiMap<V>)this.underlyingIntegerMap).removeObject(removed); | ||
29 | + } | ||
30 | + System.err.println("===================================================================================================="); | ||
31 | + System.err.println("===================================================================================================="); | ||
32 | + return removed; | ||
22 | } | 33 | } |
23 | } | 34 | } |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinRegistrySimple.java
@@ -2,21 +2,30 @@ package com.mumfrey.liteloader.client.mixin; | @@ -2,21 +2,30 @@ package com.mumfrey.liteloader.client.mixin; | ||
2 | 2 | ||
3 | import java.util.Map; | 3 | import java.util.Map; |
4 | 4 | ||
5 | +import org.spongepowered.asm.mixin.Final; | ||
5 | import org.spongepowered.asm.mixin.Mixin; | 6 | import org.spongepowered.asm.mixin.Mixin; |
6 | import org.spongepowered.asm.mixin.Shadow; | 7 | import org.spongepowered.asm.mixin.Shadow; |
7 | 8 | ||
8 | -import com.mumfrey.liteloader.client.ducks.IRegistrySimple; | 9 | +import com.mumfrey.liteloader.client.ducks.IMutableRegistry; |
9 | 10 | ||
10 | -import net.minecraft.util.RegistrySimple; | 11 | +import net.minecraft.util.registry.RegistrySimple; |
11 | 12 | ||
12 | @Mixin(RegistrySimple.class) | 13 | @Mixin(RegistrySimple.class) |
13 | -public abstract class MixinRegistrySimple<K, V> implements IRegistrySimple<K, V> | 14 | +public abstract class MixinRegistrySimple<K, V> implements IMutableRegistry<K, V> |
14 | { | 15 | { |
15 | - @Shadow protected Map<K, V> registryObjects; | 16 | + @Shadow private Object[] values; |
17 | + @Shadow @Final protected Map<K, V> registryObjects; | ||
16 | 18 | ||
17 | @Override | 19 | @Override |
18 | - public Map<K, V> getRegistryObjects() | 20 | + public V removeObjectFromRegistry(K key) |
19 | { | 21 | { |
20 | - return this.registryObjects; | 22 | + System.err.println("===================================================================================================="); |
23 | + System.err.println("===================================================================================================="); | ||
24 | + System.err.println("removeObjectFromRegistry: " + key); | ||
25 | + System.err.println("===================================================================================================="); | ||
26 | + System.err.println("===================================================================================================="); | ||
27 | + | ||
28 | + this.values = null; | ||
29 | + return this.registryObjects.remove(key); | ||
21 | } | 30 | } |
22 | } | 31 | } |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinRenderManager.java
@@ -25,7 +25,7 @@ public abstract class MixinRenderManager implements IRenderManager | @@ -25,7 +25,7 @@ public abstract class MixinRenderManager implements IRenderManager | ||
25 | return this.entityRenderMap; | 25 | return this.entityRenderMap; |
26 | } | 26 | } |
27 | 27 | ||
28 | - @Redirect(method = "doRenderEntity(Lnet/minecraft/entity/Entity;DDDFFZ)Z", at = @At( | 28 | + @Redirect(method = "doRenderEntity(Lnet/minecraft/entity/Entity;DDDFFZ)V", at = @At( |
29 | value = "INVOKE", | 29 | value = "INVOKE", |
30 | target = "Lnet/minecraft/client/renderer/entity/Render;doRender(Lnet/minecraft/entity/Entity;DDDFF)V" | 30 | target = "Lnet/minecraft/client/renderer/entity/Render;doRender(Lnet/minecraft/entity/Entity;DDDFF)V" |
31 | )) | 31 | )) |
src/client/java/com/mumfrey/liteloader/client/mixin/MixinScreenShotHelper.java
@@ -10,22 +10,24 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | @@ -10,22 +10,24 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
10 | import com.mumfrey.liteloader.client.ClientProxy; | 10 | import com.mumfrey.liteloader.client.ClientProxy; |
11 | 11 | ||
12 | import net.minecraft.client.shader.Framebuffer; | 12 | import net.minecraft.client.shader.Framebuffer; |
13 | -import net.minecraft.util.IChatComponent; | 13 | +import net.minecraft.util.text.ITextComponent; |
14 | import net.minecraft.util.ScreenShotHelper; | 14 | import net.minecraft.util.ScreenShotHelper; |
15 | 15 | ||
16 | @Mixin(ScreenShotHelper.class) | 16 | @Mixin(ScreenShotHelper.class) |
17 | public abstract class MixinScreenShotHelper | 17 | public abstract class MixinScreenShotHelper |
18 | { | 18 | { |
19 | @Inject( | 19 | @Inject( |
20 | - method = "saveScreenshot(Ljava/io/File;Ljava/lang/String;IILnet/minecraft/client/shader/Framebuffer;)Lnet/minecraft/util/IChatComponent;", | 20 | + method = "saveScreenshot(Ljava/io/File;Ljava/lang/String;IILnet/minecraft/client/shader/Framebuffer;)" |
21 | + + "Lnet/minecraft/util/text/ITextComponent;", | ||
21 | at = @At( | 22 | at = @At( |
22 | value = "INVOKE", | 23 | value = "INVOKE", |
23 | - target = "Lnet/minecraft/client/renderer/OpenGlHelper;isFramebufferEnabled()Z", | 24 | + target = "Lnet/minecraft/util/ScreenShotHelper;createScreenshot(IILnet/minecraft/client/shader/Framebuffer;)" |
25 | + + "Ljava/awt/image/BufferedImage;", | ||
24 | ordinal = 0 | 26 | ordinal = 0 |
25 | ), | 27 | ), |
26 | cancellable = true | 28 | cancellable = true |
27 | ) | 29 | ) |
28 | - private static void onSaveScreenshot(File gameDir, String name, int width, int height, Framebuffer fbo, CallbackInfoReturnable<IChatComponent> ci) | 30 | + private static void onSaveScreenshot(File gameDir, String name, int width, int height, Framebuffer fbo, CallbackInfoReturnable<ITextComponent> ci) |
29 | { | 31 | { |
30 | ClientProxy.onSaveScreenshot(ci, gameDir, name, width, height, fbo); | 32 | ClientProxy.onSaveScreenshot(ci, gameDir, name, width, height, fbo); |
31 | } | 33 | } |
src/client/java/com/mumfrey/liteloader/gl/GL.java
@@ -6,7 +6,11 @@ import java.nio.FloatBuffer; | @@ -6,7 +6,11 @@ import java.nio.FloatBuffer; | ||
6 | import java.nio.IntBuffer; | 6 | import java.nio.IntBuffer; |
7 | 7 | ||
8 | import net.minecraft.client.renderer.GlStateManager; | 8 | import net.minecraft.client.renderer.GlStateManager; |
9 | +import net.minecraft.client.renderer.GlStateManager.CullFace; | ||
10 | +import net.minecraft.client.renderer.GlStateManager.FogMode; | ||
9 | import net.minecraft.client.renderer.GlStateManager.TexGen; | 11 | import net.minecraft.client.renderer.GlStateManager.TexGen; |
12 | +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; | ||
13 | +import net.minecraft.client.renderer.vertex.VertexFormat; | ||
10 | 14 | ||
11 | import org.lwjgl.opengl.GL11; | 15 | import org.lwjgl.opengl.GL11; |
12 | import org.lwjgl.util.glu.GLU; | 16 | import org.lwjgl.util.glu.GLU; |
@@ -42,6 +46,20 @@ import org.lwjgl.util.glu.GLU; | @@ -42,6 +46,20 @@ import org.lwjgl.util.glu.GLU; | ||
42 | */ | 46 | */ |
43 | public class GL | 47 | public class GL |
44 | { | 48 | { |
49 | + // Vertex Formats | ||
50 | + public static final VertexFormat VF_BLOCK = DefaultVertexFormats.BLOCK; | ||
51 | + public static final VertexFormat VF_ITEM = DefaultVertexFormats.ITEM; | ||
52 | + public static final VertexFormat VF_OLDMODEL_POSITION_TEX_NORMAL = DefaultVertexFormats.OLDMODEL_POSITION_TEX_NORMAL; | ||
53 | + public static final VertexFormat VF_PARTICLE_POSITION_TEX_COLOR_LMAP = DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP; | ||
54 | + public static final VertexFormat VF_POSITION = DefaultVertexFormats.POSITION; | ||
55 | + public static final VertexFormat VF_POSITION_COLOR = DefaultVertexFormats.POSITION_COLOR; | ||
56 | + public static final VertexFormat VF_POSITION_TEX = DefaultVertexFormats.POSITION_TEX; | ||
57 | + public static final VertexFormat VF_POSITION_NORMAL = DefaultVertexFormats.POSITION_NORMAL; | ||
58 | + public static final VertexFormat VF_POSITION_TEX_COLOR = DefaultVertexFormats.POSITION_TEX_COLOR; | ||
59 | + public static final VertexFormat VF_POSITION_TEX_NORMAL = DefaultVertexFormats.POSITION_TEX_NORMAL; | ||
60 | + public static final VertexFormat VF_POSITION_TEX_LMAP_COLOR = DefaultVertexFormats.POSITION_TEX_LMAP_COLOR; | ||
61 | + public static final VertexFormat VF_POSITION_TEX_COLOR_NORMAL = DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL; | ||
62 | + | ||
45 | // GL11 | 63 | // GL11 |
46 | public static final int GL_ACCUM = 0x100; | 64 | public static final int GL_ACCUM = 0x100; |
47 | public static final int GL_LOAD = 0x101; | 65 | public static final int GL_LOAD = 0x101; |
@@ -943,7 +961,7 @@ public class GL | @@ -943,7 +961,7 @@ public class GL | ||
943 | GlStateManager.disableFog(); | 961 | GlStateManager.disableFog(); |
944 | } | 962 | } |
945 | 963 | ||
946 | - public static void glSetFogMode(int mode) | 964 | + public static void glSetFogMode(FogMode mode) |
947 | { | 965 | { |
948 | GlStateManager.setFog(mode); | 966 | GlStateManager.setFog(mode); |
949 | } | 967 | } |
@@ -988,7 +1006,7 @@ public class GL | @@ -988,7 +1006,7 @@ public class GL | ||
988 | GlStateManager.disableCull(); | 1006 | GlStateManager.disableCull(); |
989 | } | 1007 | } |
990 | 1008 | ||
991 | - public static void glCullFace(int mode) | 1009 | + public static void glCullFace(CullFace mode) |
992 | { | 1010 | { |
993 | GlStateManager.cullFace(mode); | 1011 | GlStateManager.cullFace(mode); |
994 | } | 1012 | } |
src/client/java/com/mumfrey/liteloader/util/ModUtilities.java
@@ -2,15 +2,15 @@ package com.mumfrey.liteloader.util; | @@ -2,15 +2,15 @@ package com.mumfrey.liteloader.util; | ||
2 | 2 | ||
3 | import java.lang.reflect.Field; | 3 | import java.lang.reflect.Field; |
4 | import java.lang.reflect.Modifier; | 4 | import java.lang.reflect.Modifier; |
5 | -import java.util.IdentityHashMap; | ||
6 | -import java.util.List; | ||
7 | import java.util.Map; | 5 | import java.util.Map; |
8 | 6 | ||
9 | import org.lwjgl.LWJGLException; | 7 | import org.lwjgl.LWJGLException; |
10 | import org.lwjgl.opengl.Display; | 8 | import org.lwjgl.opengl.Display; |
11 | import org.lwjgl.opengl.DisplayMode; | 9 | import org.lwjgl.opengl.DisplayMode; |
12 | 10 | ||
13 | -import com.mumfrey.liteloader.client.ducks.*; | 11 | +import com.mumfrey.liteloader.client.ducks.IMutableRegistry; |
12 | +import com.mumfrey.liteloader.client.ducks.IRenderManager; | ||
13 | +import com.mumfrey.liteloader.client.ducks.ITileEntityRendererDispatcher; | ||
14 | import com.mumfrey.liteloader.client.overlays.IMinecraft; | 14 | import com.mumfrey.liteloader.client.overlays.IMinecraft; |
15 | import com.mumfrey.liteloader.client.util.PrivateFieldsClient; | 15 | import com.mumfrey.liteloader.client.util.PrivateFieldsClient; |
16 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | 16 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; |
@@ -26,7 +26,6 @@ import net.minecraft.init.Blocks; | @@ -26,7 +26,6 @@ import net.minecraft.init.Blocks; | ||
26 | import net.minecraft.init.Items; | 26 | import net.minecraft.init.Items; |
27 | import net.minecraft.item.Item; | 27 | import net.minecraft.item.Item; |
28 | import net.minecraft.tileentity.TileEntity; | 28 | import net.minecraft.tileentity.TileEntity; |
29 | -import net.minecraft.util.RegistrySimple; | ||
30 | import net.minecraft.util.ResourceLocation; | 29 | import net.minecraft.util.ResourceLocation; |
31 | 30 | ||
32 | /** | 31 | /** |
@@ -106,24 +105,32 @@ public abstract class ModUtilities | @@ -106,24 +105,32 @@ public abstract class ModUtilities | ||
106 | * @param blockName Block identifier | 105 | * @param blockName Block identifier |
107 | * @param block Block to register | 106 | * @param block Block to register |
108 | * @param force Force insertion even if the operation is blocked by FMl | 107 | * @param force Force insertion even if the operation is blocked by FMl |
108 | + * | ||
109 | + * @deprecated Register blocks directly with the registry | ||
109 | */ | 110 | */ |
111 | + @SuppressWarnings("unchecked") | ||
112 | + @Deprecated | ||
110 | public static void addBlock(int blockId, ResourceLocation blockName, Block block, boolean force) | 113 | public static void addBlock(int blockId, ResourceLocation blockName, Block block, boolean force) |
111 | { | 114 | { |
112 | - Block existingBlock = Block.blockRegistry.getObject(blockName); | ||
113 | - | 115 | + boolean exists = Block.REGISTRY.containsKey(blockName); |
116 | + Block existingBlock = Block.REGISTRY.getObject(blockName); | ||
117 | + | ||
114 | try | 118 | try |
115 | { | 119 | { |
116 | - Block.blockRegistry.register(blockId, blockName, block); | 120 | + Block.REGISTRY.register(blockId, blockName, block); |
117 | } | 121 | } |
118 | catch (IllegalArgumentException ex) | 122 | catch (IllegalArgumentException ex) |
119 | { | 123 | { |
120 | if (!force) throw new IllegalArgumentException("Could not register block '" + blockName + "', the operation was blocked by FML.", ex); | 124 | if (!force) throw new IllegalArgumentException("Could not register block '" + blockName + "', the operation was blocked by FML.", ex); |
121 | 125 | ||
122 | - ModUtilities.removeObjectFromRegistry(Block.blockRegistry, blockName); | ||
123 | - Block.blockRegistry.register(blockId, blockName, block); | 126 | + if (Block.REGISTRY instanceof IMutableRegistry) |
127 | + { | ||
128 | + ((IMutableRegistry<ResourceLocation, Block>)Block.REGISTRY).removeObjectFromRegistry(blockName); | ||
129 | + Block.REGISTRY.register(blockId, blockName, block); | ||
130 | + } | ||
124 | } | 131 | } |
125 | 132 | ||
126 | - if (existingBlock != null) | 133 | + if (exists) |
127 | { | 134 | { |
128 | try | 135 | try |
129 | { | 136 | { |
@@ -154,24 +161,32 @@ public abstract class ModUtilities | @@ -154,24 +161,32 @@ public abstract class ModUtilities | ||
154 | * @param itemName Item identifier | 161 | * @param itemName Item identifier |
155 | * @param item Item to register | 162 | * @param item Item to register |
156 | * @param force Force insertion even if the operation is blocked by FMl | 163 | * @param force Force insertion even if the operation is blocked by FMl |
164 | + * | ||
165 | + * @deprecated Register items directly with the registry | ||
157 | */ | 166 | */ |
167 | + @SuppressWarnings("unchecked") | ||
168 | + @Deprecated | ||
158 | public static void addItem(int itemId, ResourceLocation itemName, Item item, boolean force) | 169 | public static void addItem(int itemId, ResourceLocation itemName, Item item, boolean force) |
159 | { | 170 | { |
160 | - Item existingItem = Item.itemRegistry.getObject(itemName); | ||
161 | - | 171 | + boolean exists = Item.REGISTRY.containsKey(itemName); |
172 | + Item existingItem = Item.REGISTRY.getObject(itemName); | ||
173 | + | ||
162 | try | 174 | try |
163 | { | 175 | { |
164 | - Item.itemRegistry.register(itemId, itemName, item); | 176 | + Item.REGISTRY.register(itemId, itemName, item); |
165 | } | 177 | } |
166 | catch (IllegalArgumentException ex) | 178 | catch (IllegalArgumentException ex) |
167 | { | 179 | { |
168 | if (!force) throw new IllegalArgumentException("Could not register item '" + itemName + "', the operation was blocked by FML.", ex); | 180 | if (!force) throw new IllegalArgumentException("Could not register item '" + itemName + "', the operation was blocked by FML.", ex); |
169 | 181 | ||
170 | - ModUtilities.removeObjectFromRegistry(Block.blockRegistry, itemName); | ||
171 | - Item.itemRegistry.register(itemId, itemName, item); | 182 | + if (Block.REGISTRY instanceof IMutableRegistry) |
183 | + { | ||
184 | + ((IMutableRegistry<ResourceLocation, Block>)Item.REGISTRY).removeObjectFromRegistry(itemName); | ||
185 | + Item.REGISTRY.register(itemId, itemName, item); | ||
186 | + } | ||
172 | } | 187 | } |
173 | 188 | ||
174 | - if (existingItem != null) | 189 | + if (exists) |
175 | { | 190 | { |
176 | try | 191 | try |
177 | { | 192 | { |
@@ -208,41 +223,6 @@ public abstract class ModUtilities | @@ -208,41 +223,6 @@ public abstract class ModUtilities | ||
208 | } | 223 | } |
209 | } | 224 | } |
210 | 225 | ||
211 | - private static <K, V> V removeObjectFromRegistry(RegistrySimple<K, V> registry, K key) | ||
212 | - { | ||
213 | - if (registry == null) return null; | ||
214 | - | ||
215 | - IObjectIntIdentityMap underlyingIntegerMap = null; | ||
216 | - | ||
217 | - if (registry instanceof INamespacedRegistry) | ||
218 | - { | ||
219 | - underlyingIntegerMap = ((INamespacedRegistry)registry).getUnderlyingMap(); | ||
220 | - } | ||
221 | - | ||
222 | - @SuppressWarnings("unchecked") | ||
223 | - Map<K, V> registryObjects = ((IRegistrySimple<K, V>)registry).getRegistryObjects(); | ||
224 | - if (registryObjects != null) | ||
225 | - { | ||
226 | - V existingValue = registryObjects.get(key); | ||
227 | - if (existingValue != null) | ||
228 | - { | ||
229 | - registryObjects.remove(key); | ||
230 | - | ||
231 | - if (underlyingIntegerMap != null) | ||
232 | - { | ||
233 | - IdentityHashMap<V, Integer> identityMap = underlyingIntegerMap.<V>getIdentityMap(); | ||
234 | - List<V> objectList = underlyingIntegerMap.<V>getObjectList(); | ||
235 | - if (identityMap != null) identityMap.remove(existingValue); | ||
236 | - if (objectList != null) objectList.remove(existingValue); | ||
237 | - } | ||
238 | - | ||
239 | - return existingValue; | ||
240 | - } | ||
241 | - } | ||
242 | - | ||
243 | - return null; | ||
244 | - } | ||
245 | - | ||
246 | private static void setFinalStaticField(Field field, Object value) | 226 | private static void setFinalStaticField(Field field, Object value) |
247 | throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException | 227 | throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException |
248 | { | 228 | { |
src/client/resources/mixins.liteloader.client.json
@@ -20,7 +20,8 @@ | @@ -20,7 +20,8 @@ | ||
20 | "MixinTileEntityRendererDispatcher", | 20 | "MixinTileEntityRendererDispatcher", |
21 | "MixinSimpleReloadableResourceManager", | 21 | "MixinSimpleReloadableResourceManager", |
22 | "MixinSoundHandler", | 22 | "MixinSoundHandler", |
23 | - "MixinGuiTextField" | 23 | + "MixinGuiTextField", |
24 | + "MixinIntIdentityHashBiMap" | ||
24 | ], | 25 | ], |
25 | "injectors": { | 26 | "injectors": { |
26 | "defaultRequire": 1 | 27 | "defaultRequire": 1 |
src/main/java/com/mumfrey/liteloader/PlayerInteractionListener.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | import net.minecraft.entity.player.EntityPlayerMP; | 3 | import net.minecraft.entity.player.EntityPlayerMP; |
4 | -import net.minecraft.util.BlockPos; | 4 | +import net.minecraft.item.ItemStack; |
5 | +import net.minecraft.util.math.BlockPos; | ||
5 | import net.minecraft.util.EnumFacing; | 6 | import net.minecraft.util.EnumFacing; |
6 | -import net.minecraft.util.MovingObjectPosition.MovingObjectType; | 7 | +import net.minecraft.util.EnumHand; |
8 | +import net.minecraft.util.math.RayTraceResult.Type; | ||
7 | 9 | ||
8 | /** | 10 | /** |
9 | * Interface for mods which want to observe the player's "interaction" status | 11 | * Interface for mods which want to observe the player's "interaction" status |
@@ -36,7 +38,7 @@ public interface PlayerInteractionListener extends LiteMod | @@ -36,7 +38,7 @@ public interface PlayerInteractionListener extends LiteMod | ||
36 | * without hitting anything (eg. the player clicked the sky) | 38 | * without hitting anything (eg. the player clicked the sky) |
37 | */ | 39 | */ |
38 | public abstract void onPlayerClickedAir(EntityPlayerMP player, MouseButton button, BlockPos tracePos, EnumFacing traceSideHit, | 40 | public abstract void onPlayerClickedAir(EntityPlayerMP player, MouseButton button, BlockPos tracePos, EnumFacing traceSideHit, |
39 | - MovingObjectType traceHitType); | 41 | + Type traceHitType); |
40 | 42 | ||
41 | /** | 43 | /** |
42 | * Calls when the player clicks and hits a block, usually indicates that the | 44 | * Calls when the player clicks and hits a block, usually indicates that the |
@@ -45,8 +47,17 @@ public interface PlayerInteractionListener extends LiteMod | @@ -45,8 +47,17 @@ public interface PlayerInteractionListener extends LiteMod | ||
45 | * to proceed, or false to cancel the action. Cancelling the action does not | 47 | * to proceed, or false to cancel the action. Cancelling the action does not |
46 | * prevent further handlers from receiving the event. | 48 | * prevent further handlers from receiving the event. |
47 | * | 49 | * |
50 | + * <p><b>Important Note:</b> <em>This event is raised <b>twice</b> for a | ||
51 | + * given click when an <tt>OFF_HAND</tt> item is equipped and use of the | ||
52 | + * <tt>MAIN_HAND</tt> item returns a result of type <tt>PASS</tt>.</em> For | ||
53 | + * example if the player is holding a sword in their main hand, and a block | ||
54 | + * in their off hand, right-clicking on a block may <tt>PASS</tt> (if the | ||
55 | + * block is not usable) which will cause fall-through to the off hand.</p> | ||
56 | + * | ||
48 | * @param player Player | 57 | * @param player Player |
49 | * @param button Mouse button that was pressed, left = dig, right = interact | 58 | * @param button Mouse button that was pressed, left = dig, right = interact |
59 | + * @param hand Hand used for the operation | ||
60 | + * @param stack ItemStack being used for the operation, <b>may be null</b> | ||
50 | * @param hitPos Block which was *hit*. Note that block placement will | 61 | * @param hitPos Block which was *hit*. Note that block placement will |
51 | * normally be at hitPos.offset(sideHit) | 62 | * normally be at hitPos.offset(sideHit) |
52 | * @param sideHit Side of the block which was hit | 63 | * @param sideHit Side of the block which was hit |
@@ -54,5 +65,15 @@ public interface PlayerInteractionListener extends LiteMod | @@ -54,5 +65,15 @@ public interface PlayerInteractionListener extends LiteMod | ||
54 | * still inhibit the action), return false to cancel the action (other | 65 | * still inhibit the action), return false to cancel the action (other |
55 | * listeners will still be notified) | 66 | * listeners will still be notified) |
56 | */ | 67 | */ |
57 | - public abstract boolean onPlayerClickedBlock(EntityPlayerMP player, MouseButton button, BlockPos hitPos, EnumFacing sideHit); | 68 | + public abstract boolean onPlayerClickedBlock(EntityPlayerMP player, MouseButton button, EnumHand hand, ItemStack stack, BlockPos hitPos, |
69 | + EnumFacing sideHit); | ||
70 | + | ||
71 | + /** | ||
72 | + * Called when the player swaps items in hand | ||
73 | + * | ||
74 | + * @param player Player | ||
75 | + * @return true to allow the action to be processed, false to cancel the | ||
76 | + * action | ||
77 | + */ | ||
78 | + public abstract boolean onPlayerSwapItems(EntityPlayerMP player); | ||
58 | } | 79 | } |
src/main/java/com/mumfrey/liteloader/PreJoinGameListener.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | import net.minecraft.network.INetHandler; | 3 | import net.minecraft.network.INetHandler; |
4 | -import net.minecraft.network.play.server.S01PacketJoinGame; | 4 | +import net.minecraft.network.play.server.SPacketJoinGame; |
5 | 5 | ||
6 | 6 | ||
7 | /** | 7 | /** |
@@ -20,5 +20,5 @@ public interface PreJoinGameListener extends LiteMod | @@ -20,5 +20,5 @@ public interface PreJoinGameListener extends LiteMod | ||
20 | * @param joinGamePacket Join game packet | 20 | * @param joinGamePacket Join game packet |
21 | * @return true to allow login to continue, false to cancel login | 21 | * @return true to allow login to continue, false to cancel login |
22 | */ | 22 | */ |
23 | - public abstract boolean onPreJoinGame(INetHandler netHandler, S01PacketJoinGame joinGamePacket); | 23 | + public abstract boolean onPreJoinGame(INetHandler netHandler, SPacketJoinGame joinGamePacket); |
24 | } | 24 | } |
src/main/java/com/mumfrey/liteloader/ServerChatFilter.java
1 | package com.mumfrey.liteloader; | 1 | package com.mumfrey.liteloader; |
2 | 2 | ||
3 | import net.minecraft.entity.player.EntityPlayerMP; | 3 | import net.minecraft.entity.player.EntityPlayerMP; |
4 | -import net.minecraft.network.play.client.C01PacketChatMessage; | 4 | +import net.minecraft.network.play.client.CPacketChatMessage; |
5 | 5 | ||
6 | /** | 6 | /** |
7 | * Interface for mods which can filter inbound chat | 7 | * Interface for mods which can filter inbound chat |
@@ -18,5 +18,5 @@ public interface ServerChatFilter extends LiteMod | @@ -18,5 +18,5 @@ public interface ServerChatFilter extends LiteMod | ||
18 | * @param message Chat message | 18 | * @param message Chat message |
19 | * @return True to keep the packet, false to discard | 19 | * @return True to keep the packet, false to discard |
20 | */ | 20 | */ |
21 | - public abstract boolean onChat(EntityPlayerMP player, C01PacketChatMessage chatPacket, String message); | 21 | + public abstract boolean onChat(EntityPlayerMP player, CPacketChatMessage chatPacket, String message); |
22 | } | 22 | } |
src/main/java/com/mumfrey/liteloader/api/CoreProvider.java
1 | package com.mumfrey.liteloader.api; | 1 | package com.mumfrey.liteloader.api; |
2 | 2 | ||
3 | import net.minecraft.network.INetHandler; | 3 | import net.minecraft.network.INetHandler; |
4 | -import net.minecraft.network.play.server.S01PacketJoinGame; | 4 | +import net.minecraft.network.play.server.SPacketJoinGame; |
5 | 5 | ||
6 | import com.mumfrey.liteloader.common.GameEngine; | 6 | import com.mumfrey.liteloader.common.GameEngine; |
7 | import com.mumfrey.liteloader.core.LiteLoaderMods; | 7 | import com.mumfrey.liteloader.core.LiteLoaderMods; |
@@ -59,5 +59,5 @@ public interface CoreProvider extends TickObserver, WorldObserver, ShutdownObser | @@ -59,5 +59,5 @@ public interface CoreProvider extends TickObserver, WorldObserver, ShutdownObser | ||
59 | * @param netHandler | 59 | * @param netHandler |
60 | * @param loginPacket | 60 | * @param loginPacket |
61 | */ | 61 | */ |
62 | - public abstract void onJoinGame(INetHandler netHandler, S01PacketJoinGame loginPacket); | 62 | + public abstract void onJoinGame(INetHandler netHandler, SPacketJoinGame loginPacket); |
63 | } | 63 | } |
src/main/java/com/mumfrey/liteloader/common/ducks/IChatPacket.java
1 | package com.mumfrey.liteloader.common.ducks; | 1 | package com.mumfrey.liteloader.common.ducks; |
2 | 2 | ||
3 | -import net.minecraft.util.IChatComponent; | 3 | +import net.minecraft.util.text.ITextComponent; |
4 | 4 | ||
5 | public interface IChatPacket | 5 | public interface IChatPacket |
6 | { | 6 | { |
7 | - public abstract IChatComponent getChatComponent(); | 7 | + public abstract ITextComponent getChatComponent(); |
8 | 8 | ||
9 | - public abstract void setChatComponent(IChatComponent chatComponent); | 9 | + public abstract void setChatComponent(ITextComponent chatComponent); |
10 | } | 10 | } |
src/main/java/com/mumfrey/liteloader/common/ducks/ITeleportHandler.java
0 โ 100644
1 | +/* | ||
2 | + * This file is part of LiteLoader. | ||
3 | + * Copyright (C) 2012-16 Adam Mummery-Smith | ||
4 | + * All Rights Reserved. | ||
5 | + */ | ||
6 | +package com.mumfrey.liteloader.common.ducks; | ||
7 | + | ||
8 | +import net.minecraft.util.math.Vec3d; | ||
9 | + | ||
10 | +public interface ITeleportHandler | ||
11 | +{ | ||
12 | + public abstract int beginTeleport(Vec3d location); | ||
13 | +} |
src/main/java/com/mumfrey/liteloader/common/mixin/MixinC15PacketClientSettings.java
@@ -5,9 +5,9 @@ import org.spongepowered.asm.mixin.Shadow; | @@ -5,9 +5,9 @@ import org.spongepowered.asm.mixin.Shadow; | ||
5 | 5 | ||
6 | import com.mumfrey.liteloader.common.ducks.IPacketClientSettings; | 6 | import com.mumfrey.liteloader.common.ducks.IPacketClientSettings; |
7 | 7 | ||
8 | -import net.minecraft.network.play.client.C15PacketClientSettings; | 8 | +import net.minecraft.network.play.client.CPacketClientSettings; |
9 | 9 | ||
10 | -@Mixin(C15PacketClientSettings.class) | 10 | +@Mixin(CPacketClientSettings.class) |
11 | public abstract class MixinC15PacketClientSettings implements IPacketClientSettings | 11 | public abstract class MixinC15PacketClientSettings implements IPacketClientSettings |
12 | { | 12 | { |
13 | @Shadow private int view; | 13 | @Shadow private int view; |
src/main/java/com/mumfrey/liteloader/common/mixin/MixinItemInWorldManager.java deleted
100644 โ 0
1 | -package com.mumfrey.liteloader.common.mixin; | ||
2 | - | ||
3 | -import org.spongepowered.asm.mixin.Mixin; | ||
4 | -import org.spongepowered.asm.mixin.injection.At; | ||
5 | -import org.spongepowered.asm.mixin.injection.Inject; | ||
6 | -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
7 | -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
8 | - | ||
9 | -import com.mumfrey.liteloader.core.Proxy; | ||
10 | - | ||
11 | -import net.minecraft.entity.player.EntityPlayer; | ||
12 | -import net.minecraft.item.ItemStack; | ||
13 | -import net.minecraft.server.management.ItemInWorldManager; | ||
14 | -import net.minecraft.util.BlockPos; | ||
15 | -import net.minecraft.util.EnumFacing; | ||
16 | -import net.minecraft.world.World; | ||
17 | - | ||
18 | -@Mixin(ItemInWorldManager.class) | ||
19 | -public abstract class MixinItemInWorldManager | ||
20 | -{ | ||
21 | - @Inject( | ||
22 | - method = "onBlockClicked(Lnet/minecraft/util/BlockPos;Lnet/minecraft/util/EnumFacing;)V", | ||
23 | - cancellable = true, | ||
24 | - at = @At("HEAD") | ||
25 | - ) | ||
26 | - private void onBlockClicked(BlockPos pos, EnumFacing side, CallbackInfo ci) | ||
27 | - { | ||
28 | - Proxy.onBlockClicked(ci, (ItemInWorldManager)(Object)this, pos, side); | ||
29 | - } | ||
30 | - | ||
31 | - @Inject( | ||
32 | - method = "activateBlockOrUseItem(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/world/World;Lnet/minecraft/item/ItemStack;" | ||
33 | - + "Lnet/minecraft/util/BlockPos;Lnet/minecraft/util/EnumFacing;FFF)Z", | ||
34 | - cancellable = true, | ||
35 | - at = @At("HEAD") | ||
36 | - ) | ||
37 | - private void onUseItem(EntityPlayer player, World worldIn, ItemStack stack, BlockPos pos, EnumFacing side, float offsetX, float offsetY, | ||
38 | - float offsetZ, CallbackInfoReturnable<Boolean> cir) | ||
39 | - { | ||
40 | - Proxy.onUseItem(cir, player, worldIn, stack, pos, side, offsetX, offsetY, offsetZ); | ||
41 | - } | ||
42 | -} |
src/main/java/com/mumfrey/liteloader/common/mixin/MixinNetHandlerPlayServer.java
@@ -2,27 +2,32 @@ package com.mumfrey.liteloader.common.mixin; | @@ -2,27 +2,32 @@ package com.mumfrey.liteloader.common.mixin; | ||
2 | 2 | ||
3 | import org.objectweb.asm.Opcodes; | 3 | import org.objectweb.asm.Opcodes; |
4 | import org.spongepowered.asm.mixin.Mixin; | 4 | import org.spongepowered.asm.mixin.Mixin; |
5 | +import org.spongepowered.asm.mixin.Shadow; | ||
5 | import org.spongepowered.asm.mixin.injection.At; | 6 | import org.spongepowered.asm.mixin.injection.At; |
6 | import org.spongepowered.asm.mixin.injection.At.Shift; | 7 | import org.spongepowered.asm.mixin.injection.At.Shift; |
7 | import org.spongepowered.asm.mixin.injection.Inject; | 8 | import org.spongepowered.asm.mixin.injection.Inject; |
8 | -import org.spongepowered.asm.mixin.injection.Surrogate; | ||
9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
10 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; | 10 | import org.spongepowered.asm.mixin.injection.callback.LocalCapture; |
11 | 11 | ||
12 | +import com.mumfrey.liteloader.common.ducks.ITeleportHandler; | ||
12 | import com.mumfrey.liteloader.core.Proxy; | 13 | import com.mumfrey.liteloader.core.Proxy; |
13 | 14 | ||
14 | import net.minecraft.network.NetHandlerPlayServer; | 15 | import net.minecraft.network.NetHandlerPlayServer; |
15 | -import net.minecraft.network.play.client.C03PacketPlayer; | ||
16 | -import net.minecraft.network.play.client.C07PacketPlayerDigging; | ||
17 | -import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; | ||
18 | -import net.minecraft.network.play.client.C0APacketAnimation; | 16 | +import net.minecraft.network.play.client.CPacketAnimation; |
17 | +import net.minecraft.network.play.client.CPacketPlayer; | ||
18 | +import net.minecraft.network.play.client.CPacketPlayerBlockPlacement; | ||
19 | +import net.minecraft.network.play.client.CPacketPlayerDigging; | ||
20 | +import net.minecraft.util.math.Vec3d; | ||
19 | import net.minecraft.world.WorldServer; | 21 | import net.minecraft.world.WorldServer; |
20 | 22 | ||
21 | @Mixin(NetHandlerPlayServer.class) | 23 | @Mixin(NetHandlerPlayServer.class) |
22 | -public abstract class MixinNetHandlerPlayServer | 24 | +public abstract class MixinNetHandlerPlayServer implements ITeleportHandler |
23 | { | 25 | { |
26 | + @Shadow private int teleportId; | ||
27 | + @Shadow private Vec3d field_184362_y; | ||
28 | + | ||
24 | @Inject( | 29 | @Inject( |
25 | - method = "processPlayerBlockPlacement(Lnet/minecraft/network/play/client/C08PacketPlayerBlockPlacement;)V", | 30 | + method = "processPlayerBlockPlacement(Lnet/minecraft/network/play/client/CPacketPlayerBlockPlacement;)V", |
26 | cancellable = true, | 31 | cancellable = true, |
27 | at = @At( | 32 | at = @At( |
28 | value = "INVOKE", | 33 | value = "INVOKE", |
@@ -31,13 +36,13 @@ public abstract class MixinNetHandlerPlayServer | @@ -31,13 +36,13 @@ public abstract class MixinNetHandlerPlayServer | ||
31 | + "(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V" | 36 | + "(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V" |
32 | ) | 37 | ) |
33 | ) | 38 | ) |
34 | - private void onPlaceBlock(C08PacketPlayerBlockPlacement packetIn, CallbackInfo ci) | 39 | + private void onPlaceBlock(CPacketPlayerBlockPlacement packetIn, CallbackInfo ci) |
35 | { | 40 | { |
36 | Proxy.onPlaceBlock(ci, (NetHandlerPlayServer)(Object)this, packetIn); | 41 | Proxy.onPlaceBlock(ci, (NetHandlerPlayServer)(Object)this, packetIn); |
37 | } | 42 | } |
38 | 43 | ||
39 | @Inject( | 44 | @Inject( |
40 | - method = "handleAnimation(Lnet/minecraft/network/play/client/C0APacketAnimation;)V", | 45 | + method = "handleAnimation(Lnet/minecraft/network/play/client/CPacketAnimation;)V", |
41 | cancellable = true, | 46 | cancellable = true, |
42 | at = @At( | 47 | at = @At( |
43 | value = "INVOKE", | 48 | value = "INVOKE", |
@@ -46,13 +51,13 @@ public abstract class MixinNetHandlerPlayServer | @@ -46,13 +51,13 @@ public abstract class MixinNetHandlerPlayServer | ||
46 | + "(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V" | 51 | + "(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V" |
47 | ) | 52 | ) |
48 | ) | 53 | ) |
49 | - private void onClickedAir(C0APacketAnimation packetIn, CallbackInfo ci) | 54 | + private void onClickedAir(CPacketAnimation packetIn, CallbackInfo ci) |
50 | { | 55 | { |
51 | Proxy.onClickedAir(ci, (NetHandlerPlayServer)(Object)this, packetIn); | 56 | Proxy.onClickedAir(ci, (NetHandlerPlayServer)(Object)this, packetIn); |
52 | } | 57 | } |
53 | 58 | ||
54 | @Inject( | 59 | @Inject( |
55 | - method = "processPlayerDigging(Lnet/minecraft/network/play/client/C07PacketPlayerDigging;)V", | 60 | + method = "processPlayerDigging(Lnet/minecraft/network/play/client/CPacketPlayerDigging;)V", |
56 | cancellable = true, | 61 | cancellable = true, |
57 | at = @At( | 62 | at = @At( |
58 | value = "INVOKE", | 63 | value = "INVOKE", |
@@ -61,31 +66,37 @@ public abstract class MixinNetHandlerPlayServer | @@ -61,31 +66,37 @@ public abstract class MixinNetHandlerPlayServer | ||
61 | + "(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V" | 66 | + "(Lnet/minecraft/network/Packet;Lnet/minecraft/network/INetHandler;Lnet/minecraft/util/IThreadListener;)V" |
62 | ) | 67 | ) |
63 | ) | 68 | ) |
64 | - private void onPlayerDigging(C07PacketPlayerDigging packetIn, CallbackInfo ci) | 69 | + private void onPlayerDigging(CPacketPlayerDigging packetIn, CallbackInfo ci) |
65 | { | 70 | { |
66 | Proxy.onPlayerDigging(ci, (NetHandlerPlayServer)(Object)this, packetIn); | 71 | Proxy.onPlayerDigging(ci, (NetHandlerPlayServer)(Object)this, packetIn); |
67 | } | 72 | } |
68 | 73 | ||
69 | @Inject( | 74 | @Inject( |
70 | - method = "processPlayer(Lnet/minecraft/network/play/client/C03PacketPlayer;)V", | 75 | + method = "processPlayer(Lnet/minecraft/network/play/client/CPacketPlayer;)V", |
71 | cancellable = true, | 76 | cancellable = true, |
72 | locals = LocalCapture.CAPTURE_FAILHARD, | 77 | locals = LocalCapture.CAPTURE_FAILHARD, |
73 | at = @At( | 78 | at = @At( |
74 | value = "FIELD", | 79 | value = "FIELD", |
75 | opcode = Opcodes.GETFIELD, | 80 | opcode = Opcodes.GETFIELD, |
76 | target = "Lnet/minecraft/entity/player/EntityPlayerMP;posY:D", | 81 | target = "Lnet/minecraft/entity/player/EntityPlayerMP;posY:D", |
77 | - ordinal = 4 | 82 | + ordinal = 3 |
78 | ) | 83 | ) |
79 | ) | 84 | ) |
80 | - private void onPlayerMoved(C03PacketPlayer packetIn, CallbackInfo ci, WorldServer world, double oldPosX, double oldPosY, double oldPosZ, | ||
81 | - double deltaMoveSq, double deltaX, double deltaY, double deltaZ) | 85 | + private void onPlayerMoved(CPacketPlayer packetIn, CallbackInfo ci, WorldServer world) |
82 | { | 86 | { |
83 | - Proxy.onPlayerMoved(ci, (NetHandlerPlayServer)(Object)this, packetIn, world, oldPosX, oldPosY, oldPosZ, deltaMoveSq, deltaX, deltaY, deltaZ); | 87 | + Proxy.onPlayerMoved(ci, (NetHandlerPlayServer)(Object)this, packetIn, world); |
84 | } | 88 | } |
85 | 89 | ||
86 | - @Surrogate | ||
87 | - private void onPlayerMoved(C03PacketPlayer packetIn, CallbackInfo ci, WorldServer world, double oldPosX, double oldPosY, double oldPosZ) | 90 | + @Override |
91 | + public int beginTeleport(Vec3d location) | ||
88 | { | 92 | { |
89 | - Proxy.onPlayerMoved(ci, (NetHandlerPlayServer)(Object)this, packetIn, world, oldPosX, oldPosY, oldPosZ); | 93 | + this.field_184362_y = location; |
94 | + | ||
95 | + if (++this.teleportId == Integer.MAX_VALUE) | ||
96 | + { | ||
97 | + this.teleportId = 0; | ||
98 | + } | ||
99 | + | ||
100 | + return this.teleportId; | ||
90 | } | 101 | } |
91 | } | 102 | } |
src/main/java/com/mumfrey/liteloader/common/mixin/MixinPlayerInteractionManager.java
0 โ 100644
1 | +package com.mumfrey.liteloader.common.mixin; | ||
2 | + | ||
3 | +import org.spongepowered.asm.mixin.Mixin; | ||
4 | +import org.spongepowered.asm.mixin.injection.At; | ||
5 | +import org.spongepowered.asm.mixin.injection.Inject; | ||
6 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
7 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
8 | + | ||
9 | +import com.mumfrey.liteloader.core.Proxy; | ||
10 | + | ||
11 | +import net.minecraft.entity.player.EntityPlayer; | ||
12 | +import net.minecraft.item.ItemStack; | ||
13 | +import net.minecraft.server.management.PlayerInteractionManager; | ||
14 | +import net.minecraft.util.math.BlockPos; | ||
15 | +import net.minecraft.util.EnumActionResult; | ||
16 | +import net.minecraft.util.EnumFacing; | ||
17 | +import net.minecraft.util.EnumHand; | ||
18 | +import net.minecraft.world.World; | ||
19 | + | ||
20 | +@Mixin(PlayerInteractionManager.class) | ||
21 | +public abstract class MixinPlayerInteractionManager | ||
22 | +{ | ||
23 | + @Inject( | ||
24 | + method = "onBlockClicked(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;)V", | ||
25 | + cancellable = true, | ||
26 | + at = @At("HEAD") | ||
27 | + ) | ||
28 | + private void onBlockClicked(BlockPos pos, EnumFacing side, CallbackInfo ci) | ||
29 | + { | ||
30 | + Proxy.onBlockClicked(ci, (PlayerInteractionManager)(Object)this, pos, side); | ||
31 | + } | ||
32 | + | ||
33 | + @Inject( | ||
34 | + method = "processRightClickBlock(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/world/World;Lnet/minecraft/item/ItemStack;" | ||
35 | + + "Lnet/minecraft/util/EnumHand;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;FFF)" | ||
36 | + + "Lnet/minecraft/util/EnumActionResult;", | ||
37 | + cancellable = true, | ||
38 | + at = @At("HEAD") | ||
39 | + ) | ||
40 | + private void onRightClickBlock(EntityPlayer player, World worldIn, ItemStack stack, EnumHand hand, BlockPos pos, EnumFacing side, | ||
41 | + float offsetX, float offsetY, float offsetZ, CallbackInfoReturnable<EnumActionResult> cir) | ||
42 | + { | ||
43 | + Proxy.onRightClickBlock(cir, player, worldIn, stack, hand, pos, side, offsetX, offsetY, offsetZ); | ||
44 | + } | ||
45 | + | ||
46 | +// @Inject( | ||
47 | +// method = "processRightClickBlock(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/world/World;Lnet/minecraft/item/ItemStack;" | ||
48 | +// + "Lnet/minecraft/util/EnumHand;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;FFF)" | ||
49 | +// + "Lnet/minecraft/util/EnumActionResult;", | ||
50 | +// cancellable = true, | ||
51 | +// at = @At("RETURN") | ||
52 | +// ) | ||
53 | +// private void postRightClickBlock(EntityPlayer player, World worldIn, ItemStack stack, EnumHand hand, BlockPos pos, EnumFacing side, | ||
54 | +// float offsetX, float offsetY, float offsetZ, CallbackInfoReturnable<EnumActionResult> cir) | ||
55 | +// { | ||
56 | +// Proxy.postRightClickBlock(cir, player, worldIn, stack, hand, pos, side, offsetX, offsetY, offsetZ); | ||
57 | +// } | ||
58 | + | ||
59 | + @Inject( | ||
60 | + method = "processRightClick(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/world/World;Lnet/minecraft/item/ItemStack;" | ||
61 | + + "Lnet/minecraft/util/EnumHand;)Lnet/minecraft/util/EnumActionResult;", | ||
62 | + cancellable = true, | ||
63 | + at = @At("HEAD") | ||
64 | + ) | ||
65 | + private void onRightClick(EntityPlayer player, World worldIn, ItemStack stack, EnumHand hand, CallbackInfoReturnable<EnumActionResult> cir) | ||
66 | + { | ||
67 | + Proxy.onRightClick(cir, player, worldIn, stack, hand); | ||
68 | + } | ||
69 | +} |
src/main/java/com/mumfrey/liteloader/common/mixin/MixinServerConfigurationManager.java renamed to src/main/java/com/mumfrey/liteloader/common/mixin/MixinPlayerList.java
@@ -13,10 +13,10 @@ import com.mumfrey.liteloader.core.Proxy; | @@ -13,10 +13,10 @@ import com.mumfrey.liteloader.core.Proxy; | ||
13 | import net.minecraft.entity.player.EntityPlayerMP; | 13 | import net.minecraft.entity.player.EntityPlayerMP; |
14 | import net.minecraft.network.NetHandlerPlayServer; | 14 | import net.minecraft.network.NetHandlerPlayServer; |
15 | import net.minecraft.network.NetworkManager; | 15 | import net.minecraft.network.NetworkManager; |
16 | -import net.minecraft.server.management.ServerConfigurationManager; | 16 | +import net.minecraft.server.management.PlayerList; |
17 | 17 | ||
18 | -@Mixin(ServerConfigurationManager.class) | ||
19 | -public abstract class MixinServerConfigurationManager | 18 | +@Mixin(PlayerList.class) |
19 | +public abstract class MixinPlayerList | ||
20 | { | 20 | { |
21 | @Inject( | 21 | @Inject( |
22 | method = "initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;)V", | 22 | method = "initializeConnectionToPlayer(Lnet/minecraft/network/NetworkManager;Lnet/minecraft/entity/player/EntityPlayerMP;)V", |
@@ -24,26 +24,26 @@ public abstract class MixinServerConfigurationManager | @@ -24,26 +24,26 @@ public abstract class MixinServerConfigurationManager | ||
24 | ) | 24 | ) |
25 | private void onInitializePlayerConnection(NetworkManager netManager, EntityPlayerMP player, CallbackInfo ci) | 25 | private void onInitializePlayerConnection(NetworkManager netManager, EntityPlayerMP player, CallbackInfo ci) |
26 | { | 26 | { |
27 | - Proxy.onInitializePlayerConnection((ServerConfigurationManager)(Object)this, netManager, player); | 27 | + Proxy.onInitializePlayerConnection((PlayerList)(Object)this, netManager, player); |
28 | } | 28 | } |
29 | 29 | ||
30 | // Because, forge | 30 | // Because, forge |
31 | @Surrogate | 31 | @Surrogate |
32 | private void onInitializePlayerConnection(NetworkManager netManager, EntityPlayerMP player, NetHandlerPlayServer nhps, CallbackInfo ci) | 32 | private void onInitializePlayerConnection(NetworkManager netManager, EntityPlayerMP player, NetHandlerPlayServer nhps, CallbackInfo ci) |
33 | { | 33 | { |
34 | - Proxy.onInitializePlayerConnection((ServerConfigurationManager)(Object)this, netManager, player); | 34 | + Proxy.onInitializePlayerConnection((PlayerList)(Object)this, netManager, player); |
35 | } | 35 | } |
36 | 36 | ||
37 | @Inject(method = "playerLoggedIn(Lnet/minecraft/entity/player/EntityPlayerMP;)V", at = @At("RETURN")) | 37 | @Inject(method = "playerLoggedIn(Lnet/minecraft/entity/player/EntityPlayerMP;)V", at = @At("RETURN")) |
38 | private void onPlayerLogin(EntityPlayerMP player, CallbackInfo ci) | 38 | private void onPlayerLogin(EntityPlayerMP player, CallbackInfo ci) |
39 | { | 39 | { |
40 | - Proxy.onPlayerLogin((ServerConfigurationManager)(Object)this, player); | 40 | + Proxy.onPlayerLogin((PlayerList)(Object)this, player); |
41 | } | 41 | } |
42 | 42 | ||
43 | @Inject(method = "playerLoggedOut(Lnet/minecraft/entity/player/EntityPlayerMP;)V", at = @At("RETURN")) | 43 | @Inject(method = "playerLoggedOut(Lnet/minecraft/entity/player/EntityPlayerMP;)V", at = @At("RETURN")) |
44 | private void onPlayerLogout(EntityPlayerMP player, CallbackInfo ci) | 44 | private void onPlayerLogout(EntityPlayerMP player, CallbackInfo ci) |
45 | { | 45 | { |
46 | - Proxy.onPlayerLogout((ServerConfigurationManager)(Object)this, player); | 46 | + Proxy.onPlayerLogout((PlayerList)(Object)this, player); |
47 | } | 47 | } |
48 | 48 | ||
49 | @Inject( | 49 | @Inject( |
@@ -53,7 +53,7 @@ public abstract class MixinServerConfigurationManager | @@ -53,7 +53,7 @@ public abstract class MixinServerConfigurationManager | ||
53 | ) | 53 | ) |
54 | private void onSpawnPlayer(GameProfile profile, CallbackInfoReturnable<EntityPlayerMP> cir) | 54 | private void onSpawnPlayer(GameProfile profile, CallbackInfoReturnable<EntityPlayerMP> cir) |
55 | { | 55 | { |
56 | - Proxy.onSpawnPlayer(cir, (ServerConfigurationManager)(Object)this, profile); | 56 | + Proxy.onSpawnPlayer(cir, (PlayerList)(Object)this, profile); |
57 | } | 57 | } |
58 | 58 | ||
59 | @Inject( | 59 | @Inject( |
@@ -63,6 +63,6 @@ public abstract class MixinServerConfigurationManager | @@ -63,6 +63,6 @@ public abstract class MixinServerConfigurationManager | ||
63 | ) | 63 | ) |
64 | private void onRespawnPlayer(EntityPlayerMP player, int dimension, boolean conqueredEnd, CallbackInfoReturnable<EntityPlayerMP> cir) | 64 | private void onRespawnPlayer(EntityPlayerMP player, int dimension, boolean conqueredEnd, CallbackInfoReturnable<EntityPlayerMP> cir) |
65 | { | 65 | { |
66 | - Proxy.onRespawnPlayer(cir, (ServerConfigurationManager)(Object)this, player, dimension, conqueredEnd); | 66 | + Proxy.onRespawnPlayer(cir, (PlayerList)(Object)this, player, dimension, conqueredEnd); |
67 | } | 67 | } |
68 | } | 68 | } |
src/main/java/com/mumfrey/liteloader/common/mixin/MixinS02PacketChat.java
@@ -5,22 +5,22 @@ import org.spongepowered.asm.mixin.Shadow; | @@ -5,22 +5,22 @@ import org.spongepowered.asm.mixin.Shadow; | ||
5 | 5 | ||
6 | import com.mumfrey.liteloader.common.ducks.IChatPacket; | 6 | import com.mumfrey.liteloader.common.ducks.IChatPacket; |
7 | 7 | ||
8 | -import net.minecraft.network.play.server.S02PacketChat; | ||
9 | -import net.minecraft.util.IChatComponent; | 8 | +import net.minecraft.network.play.server.SPacketChat; |
9 | +import net.minecraft.util.text.ITextComponent; | ||
10 | 10 | ||
11 | -@Mixin(S02PacketChat.class) | 11 | +@Mixin(SPacketChat.class) |
12 | public abstract class MixinS02PacketChat implements IChatPacket | 12 | public abstract class MixinS02PacketChat implements IChatPacket |
13 | { | 13 | { |
14 | - @Shadow private IChatComponent chatComponent; | 14 | + @Shadow private ITextComponent chatComponent; |
15 | 15 | ||
16 | @Override | 16 | @Override |
17 | - public IChatComponent getChatComponent() | 17 | + public ITextComponent getChatComponent() |
18 | { | 18 | { |
19 | return this.chatComponent; | 19 | return this.chatComponent; |
20 | } | 20 | } |
21 | 21 | ||
22 | @Override | 22 | @Override |
23 | - public void setChatComponent(IChatComponent chatComponent) | 23 | + public void setChatComponent(ITextComponent chatComponent) |
24 | { | 24 | { |
25 | this.chatComponent = chatComponent; | 25 | this.chatComponent = chatComponent; |
26 | } | 26 | } |
src/main/java/com/mumfrey/liteloader/common/transformers/PacketEvent.java
1 | package com.mumfrey.liteloader.common.transformers; | 1 | package com.mumfrey.liteloader.common.transformers; |
2 | 2 | ||
3 | +import java.util.HashSet; | ||
4 | +import java.util.Set; | ||
5 | + | ||
3 | import org.objectweb.asm.Opcodes; | 6 | import org.objectweb.asm.Opcodes; |
4 | import org.objectweb.asm.tree.InsnList; | 7 | import org.objectweb.asm.tree.InsnList; |
5 | import org.objectweb.asm.tree.InsnNode; | 8 | import org.objectweb.asm.tree.InsnNode; |
@@ -20,6 +23,8 @@ import com.mumfrey.liteloader.transformers.event.EventInfo; | @@ -20,6 +23,8 @@ import com.mumfrey.liteloader.transformers.event.EventInfo; | ||
20 | */ | 23 | */ |
21 | public class PacketEvent extends Event | 24 | public class PacketEvent extends Event |
22 | { | 25 | { |
26 | + private static Set<String> names = new HashSet<String>(); | ||
27 | + | ||
23 | /** | 28 | /** |
24 | * Soft index for this packet, used as a lookup for speed when determining | 29 | * Soft index for this packet, used as a lookup for speed when determining |
25 | * handlers. | 30 | * handlers. |
@@ -28,7 +33,7 @@ public class PacketEvent extends Event | @@ -28,7 +33,7 @@ public class PacketEvent extends Event | ||
28 | 33 | ||
29 | PacketEvent(Packets packet) | 34 | PacketEvent(Packets packet) |
30 | { | 35 | { |
31 | - super("on" + packet.getShortName(), true, 1000); | 36 | + super(PacketEvent.getPacketEventName(packet), true, 1000); |
32 | this.packetIndex = packet.getIndex(); | 37 | this.packetIndex = packet.getIndex(); |
33 | this.verbose = false; | 38 | this.verbose = false; |
34 | } | 39 | } |
@@ -62,4 +67,26 @@ public class PacketEvent extends Event | @@ -62,4 +67,26 @@ public class PacketEvent extends Event | ||
62 | 67 | ||
63 | return ctorMAXS; | 68 | return ctorMAXS; |
64 | } | 69 | } |
70 | + | ||
71 | + private static String getPacketEventName(Packets packet) | ||
72 | + { | ||
73 | + String baseName = "on" + packet.getShortName(); | ||
74 | + if (!PacketEvent.names.contains(baseName)) | ||
75 | + { | ||
76 | + PacketEvent.names.add(baseName); | ||
77 | + return baseName; | ||
78 | + } | ||
79 | + | ||
80 | + for (int ordinal = 1; ordinal < 33; ordinal++) | ||
81 | + { | ||
82 | + String offsetName = String.format("%s#%d", baseName, ordinal); | ||
83 | + if (!PacketEvent.names.contains(offsetName)) | ||
84 | + { | ||
85 | + PacketEvent.names.add(offsetName); | ||
86 | + return offsetName; | ||
87 | + } | ||
88 | + } | ||
89 | + | ||
90 | + throw new IllegalArgumentException("Too many packet events with the same name: " + baseName); | ||
91 | + } | ||
65 | } | 92 | } |
src/main/java/com/mumfrey/liteloader/core/ClientPluginChannels.java
@@ -2,7 +2,7 @@ package com.mumfrey.liteloader.core; | @@ -2,7 +2,7 @@ package com.mumfrey.liteloader.core; | ||
2 | 2 | ||
3 | import net.minecraft.network.INetHandler; | 3 | import net.minecraft.network.INetHandler; |
4 | import net.minecraft.network.PacketBuffer; | 4 | import net.minecraft.network.PacketBuffer; |
5 | -import net.minecraft.network.play.server.S3FPacketCustomPayload; | 5 | +import net.minecraft.network.play.server.SPacketCustomPayload; |
6 | 6 | ||
7 | import com.mumfrey.liteloader.PluginChannelListener; | 7 | import com.mumfrey.liteloader.PluginChannelListener; |
8 | import com.mumfrey.liteloader.api.Listener; | 8 | import com.mumfrey.liteloader.api.Listener; |
@@ -76,7 +76,7 @@ public abstract class ClientPluginChannels extends PluginChannels<PluginChannelL | @@ -76,7 +76,7 @@ public abstract class ClientPluginChannels extends PluginChannels<PluginChannelL | ||
76 | * | 76 | * |
77 | * @param customPayload | 77 | * @param customPayload |
78 | */ | 78 | */ |
79 | - public abstract void onPluginChannelMessage(S3FPacketCustomPayload customPayload); | 79 | + public abstract void onPluginChannelMessage(SPacketCustomPayload customPayload); |
80 | 80 | ||
81 | /** | 81 | /** |
82 | * @param channel | 82 | * @param channel |
src/main/java/com/mumfrey/liteloader/core/LiteLoader.java
@@ -40,7 +40,7 @@ import net.minecraft.crash.CrashReportCategory; | @@ -40,7 +40,7 @@ import net.minecraft.crash.CrashReportCategory; | ||
40 | import net.minecraft.launchwrapper.LaunchClassLoader; | 40 | import net.minecraft.launchwrapper.LaunchClassLoader; |
41 | import net.minecraft.network.EnumConnectionState; | 41 | import net.minecraft.network.EnumConnectionState; |
42 | import net.minecraft.network.INetHandler; | 42 | import net.minecraft.network.INetHandler; |
43 | -import net.minecraft.network.play.server.S01PacketJoinGame; | 43 | +import net.minecraft.network.play.server.SPacketJoinGame; |
44 | import net.minecraft.profiler.Profiler; | 44 | import net.minecraft.profiler.Profiler; |
45 | import net.minecraft.world.World; | 45 | import net.minecraft.world.World; |
46 | 46 | ||
@@ -880,7 +880,7 @@ public final class LiteLoader | @@ -880,7 +880,7 @@ public final class LiteLoader | ||
880 | * @param netHandler | 880 | * @param netHandler |
881 | * @param loginPacket | 881 | * @param loginPacket |
882 | */ | 882 | */ |
883 | - void onJoinGame(INetHandler netHandler, S01PacketJoinGame loginPacket) | 883 | + void onJoinGame(INetHandler netHandler, SPacketJoinGame loginPacket) |
884 | { | 884 | { |
885 | if (this.permissionsManagerClient != null) | 885 | if (this.permissionsManagerClient != null) |
886 | { | 886 | { |
src/main/java/com/mumfrey/liteloader/core/LiteLoaderEventBroker.java
@@ -14,6 +14,7 @@ import com.mumfrey.liteloader.api.ShutdownObserver; | @@ -14,6 +14,7 @@ import com.mumfrey.liteloader.api.ShutdownObserver; | ||
14 | import com.mumfrey.liteloader.common.GameEngine; | 14 | import com.mumfrey.liteloader.common.GameEngine; |
15 | import com.mumfrey.liteloader.common.LoadingProgress; | 15 | import com.mumfrey.liteloader.common.LoadingProgress; |
16 | import com.mumfrey.liteloader.common.ducks.IPacketClientSettings; | 16 | import com.mumfrey.liteloader.common.ducks.IPacketClientSettings; |
17 | +import com.mumfrey.liteloader.common.ducks.ITeleportHandler; | ||
17 | import com.mumfrey.liteloader.core.event.HandlerList; | 18 | import com.mumfrey.liteloader.core.event.HandlerList; |
18 | import com.mumfrey.liteloader.core.event.HandlerList.ReturnLogicOp; | 19 | import com.mumfrey.liteloader.core.event.HandlerList.ReturnLogicOp; |
19 | import com.mumfrey.liteloader.interfaces.FastIterable; | 20 | import com.mumfrey.liteloader.interfaces.FastIterable; |
@@ -25,20 +26,22 @@ import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | @@ -25,20 +26,22 @@ import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | ||
25 | import net.minecraft.command.ICommandManager; | 26 | import net.minecraft.command.ICommandManager; |
26 | import net.minecraft.command.ServerCommandManager; | 27 | import net.minecraft.command.ServerCommandManager; |
27 | import net.minecraft.entity.player.EntityPlayerMP; | 28 | import net.minecraft.entity.player.EntityPlayerMP; |
29 | +import net.minecraft.item.ItemStack; | ||
28 | import net.minecraft.network.NetHandlerPlayServer; | 30 | import net.minecraft.network.NetHandlerPlayServer; |
29 | import net.minecraft.network.NetworkManager; | 31 | import net.minecraft.network.NetworkManager; |
30 | -import net.minecraft.network.play.client.C03PacketPlayer; | ||
31 | -import net.minecraft.network.play.client.C15PacketClientSettings; | ||
32 | -import net.minecraft.network.play.server.S08PacketPlayerPosLook; | ||
33 | -import net.minecraft.network.play.server.S08PacketPlayerPosLook.EnumFlags; | ||
34 | -import net.minecraft.network.play.server.S23PacketBlockChange; | 32 | +import net.minecraft.network.play.client.CPacketPlayer; |
33 | +import net.minecraft.network.play.client.CPacketClientSettings; | ||
34 | +import net.minecraft.network.play.server.SPacketPlayerPosLook; | ||
35 | +import net.minecraft.network.play.server.SPacketPlayerPosLook.EnumFlags; | ||
36 | +import net.minecraft.network.play.server.SPacketBlockChange; | ||
35 | import net.minecraft.profiler.Profiler; | 37 | import net.minecraft.profiler.Profiler; |
36 | import net.minecraft.server.MinecraftServer; | 38 | import net.minecraft.server.MinecraftServer; |
37 | -import net.minecraft.server.management.ItemInWorldManager; | ||
38 | -import net.minecraft.server.management.ServerConfigurationManager; | ||
39 | -import net.minecraft.util.BlockPos; | 39 | +import net.minecraft.server.management.PlayerInteractionManager; |
40 | +import net.minecraft.server.management.PlayerList; | ||
41 | +import net.minecraft.util.math.BlockPos; | ||
40 | import net.minecraft.util.EnumFacing; | 42 | import net.minecraft.util.EnumFacing; |
41 | -import net.minecraft.util.MovingObjectPosition.MovingObjectType; | 43 | +import net.minecraft.util.EnumHand; |
44 | +import net.minecraft.util.math.RayTraceResult.Type; | ||
42 | import net.minecraft.world.World; | 45 | import net.minecraft.world.World; |
43 | import net.minecraft.world.WorldServer; | 46 | import net.minecraft.world.WorldServer; |
44 | import net.minecraft.world.WorldSettings; | 47 | import net.minecraft.world.WorldSettings; |
@@ -95,7 +98,8 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -95,7 +98,8 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
95 | LEFT_CLICK, | 98 | LEFT_CLICK, |
96 | LEFT_CLICK_BLOCK, | 99 | LEFT_CLICK_BLOCK, |
97 | PLACE_BLOCK_MAYBE, | 100 | PLACE_BLOCK_MAYBE, |
98 | - DIG_BLOCK_MAYBE | 101 | + DIG_BLOCK_MAYBE, |
102 | + DIG_BLOCK_END | ||
99 | } | 103 | } |
100 | 104 | ||
101 | /** | 105 | /** |
@@ -310,7 +314,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -310,7 +314,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
310 | * @param player | 314 | * @param player |
311 | * @param profile | 315 | * @param profile |
312 | */ | 316 | */ |
313 | - public void onSpawnPlayer(ServerConfigurationManager scm, EntityPlayerMP player, GameProfile profile) | 317 | + public void onSpawnPlayer(PlayerList scm, EntityPlayerMP player, GameProfile profile) |
314 | { | 318 | { |
315 | this.serverPlayerListeners.all().onPlayerConnect(player, profile); | 319 | this.serverPlayerListeners.all().onPlayerConnect(player, profile); |
316 | PlayerEventState playerState = this.getPlayerState(player); | 320 | PlayerEventState playerState = this.getPlayerState(player); |
@@ -321,7 +325,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -321,7 +325,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
321 | * @param scm | 325 | * @param scm |
322 | * @param player | 326 | * @param player |
323 | */ | 327 | */ |
324 | - public void onPlayerLogin(ServerConfigurationManager scm, EntityPlayerMP player) | 328 | + public void onPlayerLogin(PlayerList scm, EntityPlayerMP player) |
325 | { | 329 | { |
326 | LiteLoader.getServerPluginChannels().onPlayerJoined(player); | 330 | LiteLoader.getServerPluginChannels().onPlayerJoined(player); |
327 | } | 331 | } |
@@ -331,7 +335,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -331,7 +335,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
331 | * @param netManager | 335 | * @param netManager |
332 | * @param player | 336 | * @param player |
333 | */ | 337 | */ |
334 | - public void onInitializePlayerConnection(ServerConfigurationManager scm, NetworkManager netManager, EntityPlayerMP player) | 338 | + public void onInitializePlayerConnection(PlayerList scm, NetworkManager netManager, EntityPlayerMP player) |
335 | { | 339 | { |
336 | this.serverPlayerListeners.all().onPlayerLoggedIn(player); | 340 | this.serverPlayerListeners.all().onPlayerLoggedIn(player); |
337 | } | 341 | } |
@@ -343,7 +347,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -343,7 +347,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
343 | * @param dimension | 347 | * @param dimension |
344 | * @param won | 348 | * @param won |
345 | */ | 349 | */ |
346 | - public void onRespawnPlayer(ServerConfigurationManager scm, EntityPlayerMP player, EntityPlayerMP oldPlayer, int dimension, boolean won) | 350 | + public void onRespawnPlayer(PlayerList scm, EntityPlayerMP player, EntityPlayerMP oldPlayer, int dimension, boolean won) |
347 | { | 351 | { |
348 | this.serverPlayerListeners.all().onPlayerRespawn(player, oldPlayer, dimension, won); | 352 | this.serverPlayerListeners.all().onPlayerRespawn(player, oldPlayer, dimension, won); |
349 | } | 353 | } |
@@ -352,7 +356,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -352,7 +356,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
352 | * @param scm | 356 | * @param scm |
353 | * @param player | 357 | * @param player |
354 | */ | 358 | */ |
355 | - public void onPlayerLogout(ServerConfigurationManager scm, EntityPlayerMP player) | 359 | + public void onPlayerLogout(PlayerList scm, EntityPlayerMP player) |
356 | { | 360 | { |
357 | this.serverPlayerListeners.all().onPlayerLogout(player); | 361 | this.serverPlayerListeners.all().onPlayerLogout(player); |
358 | this.removePlayer(player); | 362 | this.removePlayer(player); |
@@ -389,29 +393,29 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -389,29 +393,29 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
389 | this.serverTickListeners.all().onTick(server); | 393 | this.serverTickListeners.all().onTick(server); |
390 | } | 394 | } |
391 | 395 | ||
392 | - public boolean onPlaceBlock(NetHandlerPlayServer netHandler, EntityPlayerMP playerMP, BlockPos pos, EnumFacing facing) | 396 | + public boolean onPlaceBlock(NetHandlerPlayServer netHandler, EntityPlayerMP player, EnumHand hand, BlockPos pos, EnumFacing facing) |
393 | { | 397 | { |
394 | - if (!this.onPlayerInteract(InteractType.PLACE_BLOCK_MAYBE, playerMP, pos, facing)) | 398 | + if (!this.onPlayerInteract(InteractType.PLACE_BLOCK_MAYBE, player, hand, player.getHeldItem(hand), pos, facing)) |
395 | { | 399 | { |
396 | - S23PacketBlockChange cancellation = new S23PacketBlockChange(playerMP.worldObj, pos.offset(facing)); | 400 | + SPacketBlockChange cancellation = new SPacketBlockChange(player.worldObj, pos.offset(facing)); |
397 | netHandler.playerEntity.playerNetServerHandler.sendPacket(cancellation); | 401 | netHandler.playerEntity.playerNetServerHandler.sendPacket(cancellation); |
398 | - playerMP.sendContainerToPlayer(playerMP.inventoryContainer); | 402 | + player.sendContainerToPlayer(player.inventoryContainer); |
399 | return false; | 403 | return false; |
400 | } | 404 | } |
401 | 405 | ||
402 | return true; | 406 | return true; |
403 | } | 407 | } |
404 | 408 | ||
405 | - public boolean onClickedAir(NetHandlerPlayServer netHandler) | 409 | + public boolean onClickedAir(InteractType action, EntityPlayerMP player, EnumHand hand) |
406 | { | 410 | { |
407 | - return this.onPlayerInteract(InteractType.LEFT_CLICK, netHandler.playerEntity, null, EnumFacing.SOUTH); | 411 | + return this.onPlayerInteract(action, player, hand, player.getHeldItem(hand), null, EnumFacing.SOUTH); |
408 | } | 412 | } |
409 | 413 | ||
410 | - public boolean onPlayerDigging(NetHandlerPlayServer netHandler, BlockPos pos, EntityPlayerMP playerMP) | 414 | + public boolean onPlayerDigging(InteractType action, EntityPlayerMP player, NetHandlerPlayServer netHandler, BlockPos pos) |
411 | { | 415 | { |
412 | - if (!this.onPlayerInteract(InteractType.DIG_BLOCK_MAYBE, playerMP, pos, EnumFacing.SOUTH)) | 416 | + if (!this.onPlayerInteract(action, player, EnumHand.MAIN_HAND, player.getHeldItemMainhand(), pos, EnumFacing.SOUTH)) |
413 | { | 417 | { |
414 | - S23PacketBlockChange cancellation = new S23PacketBlockChange(playerMP.worldObj, pos); | 418 | + SPacketBlockChange cancellation = new SPacketBlockChange(player.worldObj, pos); |
415 | netHandler.playerEntity.playerNetServerHandler.sendPacket(cancellation); | 419 | netHandler.playerEntity.playerNetServerHandler.sendPacket(cancellation); |
416 | return false; | 420 | return false; |
417 | } | 421 | } |
@@ -419,80 +423,68 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -419,80 +423,68 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
419 | return true; | 423 | return true; |
420 | } | 424 | } |
421 | 425 | ||
422 | - public boolean onUseItem(BlockPos pos, EnumFacing side, EntityPlayerMP playerMP) | 426 | + public boolean onUseItem(EntityPlayerMP player, EnumHand hand, ItemStack stack, BlockPos pos, EnumFacing side) |
423 | { | 427 | { |
424 | - if (!this.onPlayerInteract(InteractType.PLACE_BLOCK_MAYBE, playerMP, pos, side)) | 428 | + if (!this.onPlayerInteract(InteractType.PLACE_BLOCK_MAYBE, player, hand, stack, pos, side)) |
425 | { | 429 | { |
426 | - S23PacketBlockChange cancellation = new S23PacketBlockChange(playerMP.worldObj, pos); | ||
427 | - playerMP.playerNetServerHandler.sendPacket(cancellation); | 430 | + SPacketBlockChange cancellation = new SPacketBlockChange(player.worldObj, pos); |
431 | + player.playerNetServerHandler.sendPacket(cancellation); | ||
428 | return false; | 432 | return false; |
429 | } | 433 | } |
430 | 434 | ||
431 | return true; | 435 | return true; |
432 | } | 436 | } |
433 | 437 | ||
434 | - public boolean onBlockClicked(BlockPos pos, EnumFacing side, ItemInWorldManager manager) | 438 | + public boolean onBlockClicked(BlockPos pos, EnumFacing side, PlayerInteractionManager manager) |
435 | { | 439 | { |
436 | - if (!this.onPlayerInteract(InteractType.LEFT_CLICK_BLOCK, manager.thisPlayerMP, pos, side)) | 440 | + EntityPlayerMP player = manager.thisPlayerMP; |
441 | + if (!this.onPlayerInteract(InteractType.LEFT_CLICK_BLOCK, player, EnumHand.MAIN_HAND, player.getHeldItemMainhand(), pos, side)) | ||
437 | { | 442 | { |
438 | - S23PacketBlockChange cancellation = new S23PacketBlockChange(manager.theWorld, pos); | ||
439 | - manager.thisPlayerMP.playerNetServerHandler.sendPacket(cancellation); | 443 | + SPacketBlockChange cancellation = new SPacketBlockChange(manager.theWorld, pos); |
444 | + player.playerNetServerHandler.sendPacket(cancellation); | ||
440 | return false; | 445 | return false; |
441 | } | 446 | } |
442 | 447 | ||
443 | return true; | 448 | return true; |
444 | } | 449 | } |
450 | + | ||
451 | + public boolean onPlayerInteract(InteractType action, EntityPlayerMP player, EnumHand hand, ItemStack stack, BlockPos position, EnumFacing side) | ||
452 | + { | ||
453 | + return this.getPlayerState(player).onPlayerInteract(action, player, hand, stack, position, side); | ||
454 | + } | ||
445 | 455 | ||
446 | - public boolean onPlayerInteract(InteractType action, EntityPlayerMP player, BlockPos position, EnumFacing side) | 456 | + public boolean onPlayerSwapItems(EntityPlayerMP player) |
447 | { | 457 | { |
448 | - PlayerEventState eventState = this.getPlayerState(player); | ||
449 | - return eventState.onPlayerInteract(action, player, position, side); | 458 | + return this.playerInteractionListeners.all().onPlayerSwapItems(player); |
450 | } | 459 | } |
451 | 460 | ||
452 | - void onPlayerClickedAir(EntityPlayerMP player, MouseButton button, BlockPos tracePos, EnumFacing traceSideHit, MovingObjectType traceHitType) | 461 | + void onPlayerClickedAir(EntityPlayerMP player, MouseButton button, EnumHand hand, BlockPos tracePos, EnumFacing traceSideHit, Type traceHitType) |
453 | { | 462 | { |
454 | this.playerInteractionListeners.all().onPlayerClickedAir(player, button, tracePos, traceSideHit, traceHitType); | 463 | this.playerInteractionListeners.all().onPlayerClickedAir(player, button, tracePos, traceSideHit, traceHitType); |
455 | } | 464 | } |
456 | 465 | ||
457 | - boolean onPlayerClickedBlock(EntityPlayerMP player, MouseButton button, BlockPos hitPos, EnumFacing sideHit) | 466 | + boolean onPlayerClickedBlock(EntityPlayerMP player, MouseButton button, EnumHand hand, ItemStack stack, BlockPos hitPos, EnumFacing sideHit) |
458 | { | 467 | { |
459 | - return this.playerInteractionListeners.all().onPlayerClickedBlock(player, button, hitPos, sideHit); | 468 | + return this.playerInteractionListeners.all().onPlayerClickedBlock(player, button, hand, stack, hitPos, sideHit); |
460 | } | 469 | } |
461 | 470 | ||
462 | - public boolean onPlayerMove(NetHandlerPlayServer netHandler, C03PacketPlayer packet, EntityPlayerMP playerMP, WorldServer world) | 471 | + public boolean onPlayerMove(NetHandlerPlayServer netHandler, CPacketPlayer packet, EntityPlayerMP player, WorldServer world) |
463 | { | 472 | { |
464 | - Position from = new Position(playerMP, true); | ||
465 | - | ||
466 | - double toX = playerMP.posX; | ||
467 | - double toY = playerMP.posY; | ||
468 | - double toZ = playerMP.posZ; | ||
469 | - float toYaw = playerMP.rotationYaw; | ||
470 | - float toPitch = playerMP.rotationPitch; | ||
471 | - | ||
472 | - if (packet.isMoving()) | ||
473 | - { | ||
474 | - toX = packet.getPositionX(); | ||
475 | - toY = packet.getPositionY(); | ||
476 | - toZ = packet.getPositionZ(); | ||
477 | - } | ||
478 | - | ||
479 | - if (packet.getRotating()) | ||
480 | - { | ||
481 | - toYaw = packet.getYaw(); | ||
482 | - toPitch = packet.getPitch(); | ||
483 | - } | ||
484 | - | ||
485 | - Position to = new Position(toX, toY, toZ, toYaw, toPitch); | 473 | + Position from = new Position(player, true); |
474 | + Position to = new Position(packet.getX(player.posX), packet.getY(player.posY), packet.getZ(player.posZ), | ||
475 | + packet.getYaw(player.rotationYaw), packet.getPitch(player.rotationPitch)); | ||
476 | + | ||
486 | ReturnValue<Position> pos = new ReturnValue<Position>(to); | 477 | ReturnValue<Position> pos = new ReturnValue<Position>(to); |
487 | 478 | ||
488 | - if (!this.playerMoveListeners.all().onPlayerMove(playerMP, from, to, pos)) | 479 | + if (!this.playerMoveListeners.all().onPlayerMove(player, from, to, pos)) |
489 | { | 480 | { |
490 | - playerMP.setPositionAndRotation(from.xCoord, from.yCoord, from.zCoord, playerMP.prevRotationYaw, playerMP.prevRotationPitch); | ||
491 | - playerMP.playerNetServerHandler.sendPacket(new S08PacketPlayerPosLook(from.xCoord, from.yCoord, from.zCoord, | ||
492 | - playerMP.prevRotationYaw, playerMP.prevRotationPitch, Collections.<EnumFlags>emptySet())); | 481 | + int teleportId = ((ITeleportHandler)player.playerNetServerHandler).beginTeleport(from); |
482 | + player.setPositionAndRotation(from.xCoord, from.yCoord, from.zCoord, player.prevRotationYaw, player.prevRotationPitch); | ||
483 | + player.playerNetServerHandler.sendPacket(new SPacketPlayerPosLook(from.xCoord, from.yCoord, from.zCoord, | ||
484 | + player.prevRotationYaw, player.prevRotationPitch, Collections.<EnumFlags>emptySet(), teleportId)); | ||
493 | return false; | 485 | return false; |
494 | } | 486 | } |
495 | - | 487 | + |
496 | if (pos.isSet()) | 488 | if (pos.isSet()) |
497 | { | 489 | { |
498 | Position newPos = pos.get(); | 490 | Position newPos = pos.get(); |
@@ -503,7 +495,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | @@ -503,7 +495,7 @@ public abstract class LiteLoaderEventBroker<TClient, TServer extends MinecraftSe | ||
503 | return true; | 495 | return true; |
504 | } | 496 | } |
505 | 497 | ||
506 | - void onPlayerSettingsReceived(EntityPlayerMP player, C15PacketClientSettings packet) | 498 | + void onPlayerSettingsReceived(EntityPlayerMP player, CPacketClientSettings packet) |
507 | { | 499 | { |
508 | PlayerEventState playerState = this.getPlayerState(player); | 500 | PlayerEventState playerState = this.getPlayerState(player); |
509 | playerState.setTraceDistance(((IPacketClientSettings)packet).getViewDistance()); | 501 | playerState.setTraceDistance(((IPacketClientSettings)packet).getViewDistance()); |
src/main/java/com/mumfrey/liteloader/core/LiteLoaderVersion.java
@@ -7,7 +7,7 @@ import java.util.Set; | @@ -7,7 +7,7 @@ import java.util.Set; | ||
7 | * LiteLoader version table | 7 | * LiteLoader version table |
8 | * | 8 | * |
9 | * @author Adam Mummery-Smith | 9 | * @author Adam Mummery-Smith |
10 | - * @version 1.8.0_00 | 10 | + * @version 1.9.0_00 |
11 | */ | 11 | */ |
12 | public enum LiteLoaderVersion | 12 | public enum LiteLoaderVersion |
13 | { | 13 | { |
@@ -39,12 +39,13 @@ public enum LiteLoaderVersion | @@ -39,12 +39,13 @@ public enum LiteLoaderVersion | ||
39 | MC_1_7_10_R3(30, 1407687918, "1.7.10", "1.7.10_03", "1.7.10", "1.7.10_03"), | 39 | MC_1_7_10_R3(30, 1407687918, "1.7.10", "1.7.10_03", "1.7.10", "1.7.10_03"), |
40 | MC_1_7_10_R4(31, 1414368553, "1.7.10", "1.7.10_04", "1.7.10", "1.7.10_03", "1.7.10_04"), | 40 | MC_1_7_10_R4(31, 1414368553, "1.7.10", "1.7.10_04", "1.7.10", "1.7.10_03", "1.7.10_04"), |
41 | MC_1_8_0_R0(32, 0, "1.8", "1.8.0", "1.8", "1.8.0"), | 41 | MC_1_8_0_R0(32, 0, "1.8", "1.8.0", "1.8", "1.8.0"), |
42 | - MC_1_8_9_R0(34, 0, "1.8.9", "1.8.9", "1.8.9", "1.8.9"); | 42 | + MC_1_8_9_R0(34, 0, "1.8.9", "1.8.9", "1.8.9"), |
43 | + MC_1_9_0_R0(35, 0, "1.9", "1.9.0", "1.9.0"); | ||
43 | 44 | ||
44 | /** | 45 | /** |
45 | * Current loader version | 46 | * Current loader version |
46 | */ | 47 | */ |
47 | - public static final LiteLoaderVersion CURRENT = LiteLoaderVersion.MC_1_8_9_R0; | 48 | + public static final LiteLoaderVersion CURRENT = LiteLoaderVersion.MC_1_9_0_R0; |
48 | 49 | ||
49 | private static final LiteLoaderUpdateSite updateSite = new LiteLoaderUpdateSite(LiteLoaderVersion.CURRENT.getMinecraftVersion(), | 50 | private static final LiteLoaderUpdateSite updateSite = new LiteLoaderUpdateSite(LiteLoaderVersion.CURRENT.getMinecraftVersion(), |
50 | LiteLoaderVersion.CURRENT.getReleaseTimestamp()); | 51 | LiteLoaderVersion.CURRENT.getReleaseTimestamp()); |
@@ -67,7 +68,9 @@ public enum LiteLoaderVersion | @@ -67,7 +68,9 @@ public enum LiteLoaderVersion | ||
67 | this.loaderVersion = loaderVersion; | 68 | this.loaderVersion = loaderVersion; |
68 | 69 | ||
69 | for (String supportedVersion : supportedVersions) | 70 | for (String supportedVersion : supportedVersions) |
71 | + { | ||
70 | this.supportedVersions.add(supportedVersion); | 72 | this.supportedVersions.add(supportedVersion); |
73 | + } | ||
71 | } | 74 | } |
72 | 75 | ||
73 | public int getLoaderRevision() | 76 | public int getLoaderRevision() |
src/main/java/com/mumfrey/liteloader/core/PacketEvents.java
@@ -6,13 +6,13 @@ import net.minecraft.entity.player.EntityPlayerMP; | @@ -6,13 +6,13 @@ import net.minecraft.entity.player.EntityPlayerMP; | ||
6 | import net.minecraft.network.INetHandler; | 6 | import net.minecraft.network.INetHandler; |
7 | import net.minecraft.network.NetHandlerPlayServer; | 7 | import net.minecraft.network.NetHandlerPlayServer; |
8 | import net.minecraft.network.Packet; | 8 | import net.minecraft.network.Packet; |
9 | -import net.minecraft.network.login.server.S02PacketLoginSuccess; | ||
10 | -import net.minecraft.network.play.client.C01PacketChatMessage; | ||
11 | -import net.minecraft.network.play.client.C15PacketClientSettings; | ||
12 | -import net.minecraft.network.play.client.C17PacketCustomPayload; | ||
13 | -import net.minecraft.network.play.server.S01PacketJoinGame; | ||
14 | -import net.minecraft.network.play.server.S02PacketChat; | ||
15 | -import net.minecraft.network.play.server.S3FPacketCustomPayload; | 9 | +import net.minecraft.network.login.server.SPacketLoginSuccess; |
10 | +import net.minecraft.network.play.client.CPacketChatMessage; | ||
11 | +import net.minecraft.network.play.client.CPacketClientSettings; | ||
12 | +import net.minecraft.network.play.client.CPacketCustomPayload; | ||
13 | +import net.minecraft.network.play.server.SPacketJoinGame; | ||
14 | +import net.minecraft.network.play.server.SPacketChat; | ||
15 | +import net.minecraft.network.play.server.SPacketCustomPayload; | ||
16 | import net.minecraft.util.IThreadListener; | 16 | import net.minecraft.util.IThreadListener; |
17 | 17 | ||
18 | import com.mumfrey.liteloader.PacketHandler; | 18 | import com.mumfrey.liteloader.PacketHandler; |
@@ -58,13 +58,13 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -58,13 +58,13 @@ public abstract class PacketEvents implements InterfaceProvider | ||
58 | private FastIterable<ServerChatFilter> serverChatFilters = new HandlerList<ServerChatFilter>(ServerChatFilter.class, | 58 | private FastIterable<ServerChatFilter> serverChatFilters = new HandlerList<ServerChatFilter>(ServerChatFilter.class, |
59 | ReturnLogicOp.AND_BREAK_ON_FALSE); | 59 | ReturnLogicOp.AND_BREAK_ON_FALSE); |
60 | 60 | ||
61 | - private final int loginSuccessPacketId = Packets.S02PacketLoginSuccess.getIndex(); | ||
62 | - private final int serverChatPacketId = Packets.S02PacketChat.getIndex(); | ||
63 | - private final int clientChatPacketId = Packets.C01PacketChatMessage.getIndex(); | ||
64 | - private final int joinGamePacketId = Packets.S01PacketJoinGame.getIndex(); | ||
65 | - private final int serverPayloadPacketId = Packets.S3FPacketCustomPayload.getIndex(); | ||
66 | - private final int clientPayloadPacketId = Packets.C17PacketCustomPayload.getIndex(); | ||
67 | - private final int clientSettingsPacketId = Packets.C15PacketClientSettings.getIndex(); | 61 | + private final int loginSuccessPacketId = Packets.SPacketLoginSuccess.getIndex(); |
62 | + private final int serverChatPacketId = Packets.SPacketChat.getIndex(); | ||
63 | + private final int clientChatPacketId = Packets.CPacketChatMessage.getIndex(); | ||
64 | + private final int joinGamePacketId = Packets.SPacketJoinGame.getIndex(); | ||
65 | + private final int serverPayloadPacketId = Packets.SPacketCustomPayload.getIndex(); | ||
66 | + private final int clientPayloadPacketId = Packets.CPacketCustomPayload.getIndex(); | ||
67 | + private final int clientSettingsPacketId = Packets.CPacketClientSettings.getIndex(); | ||
68 | 68 | ||
69 | /** | 69 | /** |
70 | * ctor | 70 | * ctor |
@@ -182,7 +182,7 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -182,7 +182,7 @@ public abstract class PacketEvents implements InterfaceProvider | ||
182 | 182 | ||
183 | if (packetId == this.loginSuccessPacketId) | 183 | if (packetId == this.loginSuccessPacketId) |
184 | { | 184 | { |
185 | - this.handlePacket(e, netHandler, (S02PacketLoginSuccess)packet); | 185 | + this.handlePacket(e, netHandler, (SPacketLoginSuccess)packet); |
186 | } | 186 | } |
187 | } | 187 | } |
188 | 188 | ||
@@ -196,40 +196,40 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -196,40 +196,40 @@ public abstract class PacketEvents implements InterfaceProvider | ||
196 | protected boolean handlePacketEvent(PacketEventInfo<Packet<?>> e, INetHandler netHandler, int packetId) | 196 | protected boolean handlePacketEvent(PacketEventInfo<Packet<?>> e, INetHandler netHandler, int packetId) |
197 | { | 197 | { |
198 | Packet<?> packet = e.getSource(); | 198 | Packet<?> packet = e.getSource(); |
199 | - | 199 | + |
200 | if (packetId == this.serverChatPacketId) | 200 | if (packetId == this.serverChatPacketId) |
201 | { | 201 | { |
202 | - this.handlePacket(e, netHandler, (S02PacketChat)packet); | 202 | + this.handlePacket(e, netHandler, (SPacketChat)packet); |
203 | return true; | 203 | return true; |
204 | } | 204 | } |
205 | 205 | ||
206 | if (packetId == this.clientChatPacketId) | 206 | if (packetId == this.clientChatPacketId) |
207 | { | 207 | { |
208 | - this.handlePacket(e, netHandler, (C01PacketChatMessage)packet); | 208 | + this.handlePacket(e, netHandler, (CPacketChatMessage)packet); |
209 | return true; | 209 | return true; |
210 | } | 210 | } |
211 | 211 | ||
212 | if (packetId == this.joinGamePacketId) | 212 | if (packetId == this.joinGamePacketId) |
213 | { | 213 | { |
214 | - this.handlePacket(e, netHandler, (S01PacketJoinGame)packet); | 214 | + this.handlePacket(e, netHandler, (SPacketJoinGame)packet); |
215 | return true; | 215 | return true; |
216 | } | 216 | } |
217 | 217 | ||
218 | if (packetId == this.serverPayloadPacketId) | 218 | if (packetId == this.serverPayloadPacketId) |
219 | { | 219 | { |
220 | - this.handlePacket(e, netHandler, (S3FPacketCustomPayload)packet); | 220 | + this.handlePacket(e, netHandler, (SPacketCustomPayload)packet); |
221 | return true; | 221 | return true; |
222 | } | 222 | } |
223 | 223 | ||
224 | if (packetId == this.clientPayloadPacketId) | 224 | if (packetId == this.clientPayloadPacketId) |
225 | { | 225 | { |
226 | - this.handlePacket(e, netHandler, (C17PacketCustomPayload)packet); | 226 | + this.handlePacket(e, netHandler, (CPacketCustomPayload)packet); |
227 | return true; | 227 | return true; |
228 | } | 228 | } |
229 | 229 | ||
230 | if (packetId == this.clientSettingsPacketId) | 230 | if (packetId == this.clientSettingsPacketId) |
231 | { | 231 | { |
232 | - this.handlePacket(e, netHandler, (C15PacketClientSettings)packet); | 232 | + this.handlePacket(e, netHandler, (CPacketClientSettings)packet); |
233 | return true; | 233 | return true; |
234 | } | 234 | } |
235 | 235 | ||
@@ -241,7 +241,7 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -241,7 +241,7 @@ public abstract class PacketEvents implements InterfaceProvider | ||
241 | * @param netHandler | 241 | * @param netHandler |
242 | * @param packet | 242 | * @param packet |
243 | */ | 243 | */ |
244 | - protected abstract void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S02PacketLoginSuccess packet); | 244 | + protected abstract void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketLoginSuccess packet); |
245 | 245 | ||
246 | /** | 246 | /** |
247 | * S02PacketChat::processPacket() | 247 | * S02PacketChat::processPacket() |
@@ -249,7 +249,7 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -249,7 +249,7 @@ public abstract class PacketEvents implements InterfaceProvider | ||
249 | * @param netHandler | 249 | * @param netHandler |
250 | * @param packet | 250 | * @param packet |
251 | */ | 251 | */ |
252 | - protected abstract void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S02PacketChat packet); | 252 | + protected abstract void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketChat packet); |
253 | 253 | ||
254 | /** | 254 | /** |
255 | * S02PacketChat::processPacket() | 255 | * S02PacketChat::processPacket() |
@@ -257,7 +257,7 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -257,7 +257,7 @@ public abstract class PacketEvents implements InterfaceProvider | ||
257 | * @param netHandler | 257 | * @param netHandler |
258 | * @param packet | 258 | * @param packet |
259 | */ | 259 | */ |
260 | - protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, C01PacketChatMessage packet) | 260 | + protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, CPacketChatMessage packet) |
261 | { | 261 | { |
262 | EntityPlayerMP player = netHandler instanceof NetHandlerPlayServer ? ((NetHandlerPlayServer)netHandler).playerEntity : null; | 262 | EntityPlayerMP player = netHandler instanceof NetHandlerPlayServer ? ((NetHandlerPlayServer)netHandler).playerEntity : null; |
263 | 263 | ||
@@ -268,12 +268,12 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -268,12 +268,12 @@ public abstract class PacketEvents implements InterfaceProvider | ||
268 | } | 268 | } |
269 | 269 | ||
270 | /** | 270 | /** |
271 | - * S01PacketJoinGame::processPacket() | 271 | + * SPacketJoinGame::processPacket() |
272 | * | 272 | * |
273 | * @param netHandler | 273 | * @param netHandler |
274 | * @param packet | 274 | * @param packet |
275 | */ | 275 | */ |
276 | - protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S01PacketJoinGame packet) | 276 | + protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketJoinGame packet) |
277 | { | 277 | { |
278 | this.loader.onJoinGame(netHandler, packet); | 278 | this.loader.onJoinGame(netHandler, packet); |
279 | } | 279 | } |
@@ -284,7 +284,7 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -284,7 +284,7 @@ public abstract class PacketEvents implements InterfaceProvider | ||
284 | * @param netHandler | 284 | * @param netHandler |
285 | * @param packet | 285 | * @param packet |
286 | */ | 286 | */ |
287 | - protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, S3FPacketCustomPayload packet) | 287 | + protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, SPacketCustomPayload packet) |
288 | { | 288 | { |
289 | LiteLoader.getClientPluginChannels().onPluginChannelMessage(packet); | 289 | LiteLoader.getClientPluginChannels().onPluginChannelMessage(packet); |
290 | } | 290 | } |
@@ -295,7 +295,7 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -295,7 +295,7 @@ public abstract class PacketEvents implements InterfaceProvider | ||
295 | * @param netHandler | 295 | * @param netHandler |
296 | * @param packet | 296 | * @param packet |
297 | */ | 297 | */ |
298 | - protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, C17PacketCustomPayload packet) | 298 | + protected void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, CPacketCustomPayload packet) |
299 | { | 299 | { |
300 | LiteLoader.getServerPluginChannels().onPluginChannelMessage(netHandler, packet); | 300 | LiteLoader.getServerPluginChannels().onPluginChannelMessage(netHandler, packet); |
301 | } | 301 | } |
@@ -307,7 +307,7 @@ public abstract class PacketEvents implements InterfaceProvider | @@ -307,7 +307,7 @@ public abstract class PacketEvents implements InterfaceProvider | ||
307 | * @param netHandler | 307 | * @param netHandler |
308 | * @param packet | 308 | * @param packet |
309 | */ | 309 | */ |
310 | - private void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, C15PacketClientSettings packet) | 310 | + private void handlePacket(PacketEventInfo<Packet<?>> e, INetHandler netHandler, CPacketClientSettings packet) |
311 | { | 311 | { |
312 | if (netHandler instanceof NetHandlerPlayServer) | 312 | if (netHandler instanceof NetHandlerPlayServer) |
313 | { | 313 | { |
src/main/java/com/mumfrey/liteloader/core/PlayerEventState.java
@@ -3,11 +3,13 @@ package com.mumfrey.liteloader.core; | @@ -3,11 +3,13 @@ package com.mumfrey.liteloader.core; | ||
3 | import java.lang.ref.WeakReference; | 3 | import java.lang.ref.WeakReference; |
4 | 4 | ||
5 | import net.minecraft.entity.player.EntityPlayerMP; | 5 | import net.minecraft.entity.player.EntityPlayerMP; |
6 | +import net.minecraft.item.ItemStack; | ||
6 | import net.minecraft.server.MinecraftServer; | 7 | import net.minecraft.server.MinecraftServer; |
7 | -import net.minecraft.util.BlockPos; | 8 | +import net.minecraft.util.math.BlockPos; |
8 | import net.minecraft.util.EnumFacing; | 9 | import net.minecraft.util.EnumFacing; |
9 | -import net.minecraft.util.MovingObjectPosition; | ||
10 | -import net.minecraft.util.MovingObjectPosition.MovingObjectType; | 10 | +import net.minecraft.util.EnumHand; |
11 | +import net.minecraft.util.math.RayTraceResult; | ||
12 | +import net.minecraft.util.math.RayTraceResult.Type; | ||
11 | 13 | ||
12 | import com.mumfrey.liteloader.PlayerInteractionListener.MouseButton; | 14 | import com.mumfrey.liteloader.PlayerInteractionListener.MouseButton; |
13 | import com.mumfrey.liteloader.core.LiteLoaderEventBroker.InteractType; | 15 | import com.mumfrey.liteloader.core.LiteLoaderEventBroker.InteractType; |
@@ -27,8 +29,11 @@ public class PlayerEventState implements IEventState | @@ -27,8 +29,11 @@ public class PlayerEventState implements IEventState | ||
27 | private int suppressRightTicks; | 29 | private int suppressRightTicks; |
28 | private boolean leftClick; | 30 | private boolean leftClick; |
29 | private boolean rightClick; | 31 | private boolean rightClick; |
32 | + private boolean digging; | ||
33 | + | ||
34 | + private EnumHand hand = EnumHand.MAIN_HAND; | ||
30 | 35 | ||
31 | - private MovingObjectPosition hit; | 36 | + private RayTraceResult hit; |
32 | 37 | ||
33 | private String locale = "en_US"; | 38 | private String locale = "en_US"; |
34 | 39 | ||
@@ -73,14 +78,16 @@ public class PlayerEventState implements IEventState | @@ -73,14 +78,16 @@ public class PlayerEventState implements IEventState | ||
73 | @Override | 78 | @Override |
74 | public void onTick(MinecraftServer server) | 79 | public void onTick(MinecraftServer server) |
75 | { | 80 | { |
76 | - if (this.leftClick && this.suppressLeftTicks == 0) | 81 | + if (this.leftClick && this.suppressLeftTicks == 0 && !this.digging) |
77 | { | 82 | { |
78 | - this.broker.onPlayerClickedAir(this.getPlayer(), MouseButton.LEFT, this.hit.getBlockPos(), this.hit.sideHit, this.hit.typeOfHit); | 83 | + this.broker.onPlayerClickedAir(this.getPlayer(), MouseButton.LEFT, this.hand, |
84 | + this.hit.getBlockPos(), this.hit.sideHit, this.hit.typeOfHit); | ||
79 | } | 85 | } |
80 | 86 | ||
81 | if (this.rightClick && this.suppressRightTicks == 0) | 87 | if (this.rightClick && this.suppressRightTicks == 0) |
82 | { | 88 | { |
83 | - this.broker.onPlayerClickedAir(this.getPlayer(), MouseButton.RIGHT, this.hit.getBlockPos(), this.hit.sideHit, this.hit.typeOfHit); | 89 | + this.broker.onPlayerClickedAir(this.getPlayer(), MouseButton.RIGHT, this.hand, |
90 | + this.hit.getBlockPos(), this.hit.sideHit, this.hit.typeOfHit); | ||
84 | } | 91 | } |
85 | 92 | ||
86 | if (this.suppressLeftTicks > 0) this.suppressLeftTicks--; | 93 | if (this.suppressLeftTicks > 0) this.suppressLeftTicks--; |
@@ -90,18 +97,33 @@ public class PlayerEventState implements IEventState | @@ -90,18 +97,33 @@ public class PlayerEventState implements IEventState | ||
90 | this.rightClick = false; | 97 | this.rightClick = false; |
91 | } | 98 | } |
92 | 99 | ||
93 | - public boolean onPlayerInteract(InteractType action, EntityPlayerMP player, BlockPos position, EnumFacing side) | 100 | + public boolean onPlayerInteract(InteractType action, EntityPlayerMP player, EnumHand hand, ItemStack stack, BlockPos position, EnumFacing side) |
94 | { | 101 | { |
102 | + if (action == InteractType.DIG_BLOCK_MAYBE && !player.isCreative()) | ||
103 | + { | ||
104 | + this.digging = true; | ||
105 | + } | ||
106 | + | ||
107 | + if (action == InteractType.DIG_BLOCK_END) | ||
108 | + { | ||
109 | + this.digging = false; | ||
110 | + this.suppressLeftTicks++; | ||
111 | + return true; | ||
112 | + } | ||
113 | + | ||
95 | this.hit = EntityUtilities.rayTraceFromEntity(player, this.traceDistance, 0.0F); | 114 | this.hit = EntityUtilities.rayTraceFromEntity(player, this.traceDistance, 0.0F); |
96 | 115 | ||
97 | if (action == InteractType.LEFT_CLICK) | 116 | if (action == InteractType.LEFT_CLICK) |
98 | { | 117 | { |
99 | this.leftClick = true; | 118 | this.leftClick = true; |
119 | + this.hand = hand; | ||
100 | return true; | 120 | return true; |
101 | } | 121 | } |
102 | 122 | ||
103 | if (action == InteractType.RIGHT_CLICK) | 123 | if (action == InteractType.RIGHT_CLICK) |
104 | { | 124 | { |
125 | + this.digging = false; | ||
126 | + this.hand = hand; | ||
105 | this.rightClick = true; | 127 | this.rightClick = true; |
106 | return true; | 128 | return true; |
107 | } | 129 | } |
@@ -109,29 +131,34 @@ public class PlayerEventState implements IEventState | @@ -109,29 +131,34 @@ public class PlayerEventState implements IEventState | ||
109 | if ((action == InteractType.LEFT_CLICK_BLOCK || action == InteractType.DIG_BLOCK_MAYBE) && this.suppressLeftTicks == 0) | 131 | if ((action == InteractType.LEFT_CLICK_BLOCK || action == InteractType.DIG_BLOCK_MAYBE) && this.suppressLeftTicks == 0) |
110 | { | 132 | { |
111 | this.suppressLeftTicks += 2; | 133 | this.suppressLeftTicks += 2; |
112 | - return this.broker.onPlayerClickedBlock(player, MouseButton.LEFT, position, side); | 134 | + return this.broker.onPlayerClickedBlock(player, MouseButton.LEFT, hand, stack, position, side); |
113 | } | 135 | } |
114 | 136 | ||
115 | if (action == InteractType.PLACE_BLOCK_MAYBE) | 137 | if (action == InteractType.PLACE_BLOCK_MAYBE) |
116 | { | 138 | { |
117 | - if (this.suppressRightTicks > 0) | 139 | + this.digging = false; |
140 | + | ||
141 | + if (this.suppressRightTicks > 0 && (this.suppressRightTicks != 1 && hand != this.hand)) | ||
118 | { | 142 | { |
119 | return true; | 143 | return true; |
120 | } | 144 | } |
121 | 145 | ||
122 | if (position.toLong() == PlayerEventState.MISS) | 146 | if (position.toLong() == PlayerEventState.MISS) |
123 | { | 147 | { |
124 | - MovingObjectPosition actualHit = EntityUtilities.rayTraceFromEntity(player, player.capabilities.isCreativeMode ? 5.0 : 4.5, 0.0F); | ||
125 | - if (actualHit.typeOfHit == MovingObjectType.MISS) | 148 | + RayTraceResult actualHit = EntityUtilities.rayTraceFromEntity(player, player.capabilities.isCreativeMode ? 5.0 : 4.5, 0.0F); |
149 | + if (actualHit.typeOfHit == Type.MISS) | ||
126 | { | 150 | { |
151 | + this.digging = false; | ||
152 | + this.hand = hand; | ||
127 | this.rightClick = true; | 153 | this.rightClick = true; |
128 | return true; | 154 | return true; |
129 | } | 155 | } |
130 | } | 156 | } |
131 | 157 | ||
158 | + this.hand = hand; | ||
132 | this.suppressRightTicks++; | 159 | this.suppressRightTicks++; |
133 | this.suppressLeftTicks++; | 160 | this.suppressLeftTicks++; |
134 | - return this.broker.onPlayerClickedBlock(player, MouseButton.RIGHT, position, side); | 161 | + return this.broker.onPlayerClickedBlock(player, MouseButton.RIGHT, hand, stack, position, side); |
135 | } | 162 | } |
136 | 163 | ||
137 | return true; | 164 | return true; |
src/main/java/com/mumfrey/liteloader/core/Proxy.java
@@ -4,21 +4,25 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | @@ -4,21 +4,25 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
4 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | 4 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
5 | 5 | ||
6 | import com.mojang.authlib.GameProfile; | 6 | import com.mojang.authlib.GameProfile; |
7 | +import com.mumfrey.liteloader.core.LiteLoaderEventBroker.InteractType; | ||
7 | 8 | ||
8 | import net.minecraft.entity.player.EntityPlayer; | 9 | import net.minecraft.entity.player.EntityPlayer; |
9 | import net.minecraft.entity.player.EntityPlayerMP; | 10 | import net.minecraft.entity.player.EntityPlayerMP; |
10 | import net.minecraft.item.ItemStack; | 11 | import net.minecraft.item.ItemStack; |
11 | import net.minecraft.network.NetHandlerPlayServer; | 12 | import net.minecraft.network.NetHandlerPlayServer; |
12 | import net.minecraft.network.NetworkManager; | 13 | import net.minecraft.network.NetworkManager; |
13 | -import net.minecraft.network.play.client.C03PacketPlayer; | ||
14 | -import net.minecraft.network.play.client.C07PacketPlayerDigging; | ||
15 | -import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; | ||
16 | -import net.minecraft.network.play.client.C0APacketAnimation; | 14 | +import net.minecraft.network.play.client.CPacketAnimation; |
15 | +import net.minecraft.network.play.client.CPacketPlayer; | ||
16 | +import net.minecraft.network.play.client.CPacketPlayerBlockPlacement; | ||
17 | +import net.minecraft.network.play.client.CPacketPlayerDigging; | ||
18 | +import net.minecraft.network.play.client.CPacketPlayerDigging.Action; | ||
17 | import net.minecraft.server.MinecraftServer; | 19 | import net.minecraft.server.MinecraftServer; |
18 | -import net.minecraft.server.management.ItemInWorldManager; | ||
19 | -import net.minecraft.server.management.ServerConfigurationManager; | ||
20 | -import net.minecraft.util.BlockPos; | 20 | +import net.minecraft.server.management.PlayerInteractionManager; |
21 | +import net.minecraft.server.management.PlayerList; | ||
22 | +import net.minecraft.util.EnumActionResult; | ||
21 | import net.minecraft.util.EnumFacing; | 23 | import net.minecraft.util.EnumFacing; |
24 | +import net.minecraft.util.EnumHand; | ||
25 | +import net.minecraft.util.math.BlockPos; | ||
22 | import net.minecraft.world.World; | 26 | import net.minecraft.world.World; |
23 | import net.minecraft.world.WorldServer; | 27 | import net.minecraft.world.WorldServer; |
24 | 28 | ||
@@ -39,27 +43,27 @@ public abstract class Proxy | @@ -39,27 +43,27 @@ public abstract class Proxy | ||
39 | } | 43 | } |
40 | } | 44 | } |
41 | 45 | ||
42 | - public static void onInitializePlayerConnection(ServerConfigurationManager source, NetworkManager netManager, EntityPlayerMP player) | 46 | + public static void onInitializePlayerConnection(PlayerList source, NetworkManager netManager, EntityPlayerMP player) |
43 | { | 47 | { |
44 | Proxy.broker.onInitializePlayerConnection(source, netManager, player); | 48 | Proxy.broker.onInitializePlayerConnection(source, netManager, player); |
45 | } | 49 | } |
46 | 50 | ||
47 | - public static void onPlayerLogin(ServerConfigurationManager source, EntityPlayerMP player) | 51 | + public static void onPlayerLogin(PlayerList source, EntityPlayerMP player) |
48 | { | 52 | { |
49 | Proxy.broker.onPlayerLogin(source, player); | 53 | Proxy.broker.onPlayerLogin(source, player); |
50 | } | 54 | } |
51 | 55 | ||
52 | - public static void onPlayerLogout(ServerConfigurationManager source, EntityPlayerMP player) | 56 | + public static void onPlayerLogout(PlayerList source, EntityPlayerMP player) |
53 | { | 57 | { |
54 | Proxy.broker.onPlayerLogout(source, player); | 58 | Proxy.broker.onPlayerLogout(source, player); |
55 | } | 59 | } |
56 | 60 | ||
57 | - public static void onSpawnPlayer(CallbackInfoReturnable<EntityPlayerMP> cir, ServerConfigurationManager source, GameProfile profile) | 61 | + public static void onSpawnPlayer(CallbackInfoReturnable<EntityPlayerMP> cir, PlayerList source, GameProfile profile) |
58 | { | 62 | { |
59 | Proxy.broker.onSpawnPlayer(source, cir.getReturnValue(), profile); | 63 | Proxy.broker.onSpawnPlayer(source, cir.getReturnValue(), profile); |
60 | } | 64 | } |
61 | 65 | ||
62 | - public static void onRespawnPlayer(CallbackInfoReturnable<EntityPlayerMP> cir, ServerConfigurationManager source, EntityPlayerMP oldPlayer, | 66 | + public static void onRespawnPlayer(CallbackInfoReturnable<EntityPlayerMP> cir, PlayerList source, EntityPlayerMP oldPlayer, |
63 | int dimension, boolean won) | 67 | int dimension, boolean won) |
64 | { | 68 | { |
65 | Proxy.broker.onRespawnPlayer(source, cir.getReturnValue(), oldPlayer, dimension, won); | 69 | Proxy.broker.onRespawnPlayer(source, cir.getReturnValue(), oldPlayer, dimension, won); |
@@ -70,49 +74,87 @@ public abstract class Proxy | @@ -70,49 +74,87 @@ public abstract class Proxy | ||
70 | Proxy.broker.onServerTick(mcServer); | 74 | Proxy.broker.onServerTick(mcServer); |
71 | } | 75 | } |
72 | 76 | ||
73 | - public static void onPlaceBlock(CallbackInfo ci, NetHandlerPlayServer netHandler, C08PacketPlayerBlockPlacement packet) | 77 | + public static void onPlaceBlock(CallbackInfo ci, NetHandlerPlayServer netHandler, CPacketPlayerBlockPlacement packet) |
74 | { | 78 | { |
75 | - if (!Proxy.broker.onPlaceBlock(netHandler, netHandler.playerEntity, packet.getPosition(), | ||
76 | - EnumFacing.getFront(packet.getPlacedBlockDirection()))) | ||
77 | - { | ||
78 | - ci.cancel(); | ||
79 | - } | 79 | + // Potentially not needed any more |
80 | +// if (!Proxy.broker.onPlaceBlock(netHandler, netHandler.playerEntity, packet.getPosition(), | ||
81 | +// EnumFacing.getFront(packet.getPlacedBlockDirection()))) | ||
82 | +// { | ||
83 | +// ci.cancel(); | ||
84 | +// } | ||
80 | } | 85 | } |
81 | 86 | ||
82 | - public static void onClickedAir(CallbackInfo ci, NetHandlerPlayServer netHandler, C0APacketAnimation packet) | 87 | + public static void onClickedAir(CallbackInfo ci, NetHandlerPlayServer netHandler, CPacketAnimation packet) |
83 | { | 88 | { |
84 | - if (!Proxy.broker.onClickedAir(netHandler)) | 89 | + if (!Proxy.broker.onClickedAir(InteractType.LEFT_CLICK, netHandler.playerEntity, packet.getHand())) |
85 | { | 90 | { |
86 | ci.cancel(); | 91 | ci.cancel(); |
87 | } | 92 | } |
88 | } | 93 | } |
89 | 94 | ||
90 | - public static void onPlayerDigging(CallbackInfo ci, NetHandlerPlayServer netHandler, C07PacketPlayerDigging packet) | 95 | + public static void onPlayerDigging(CallbackInfo ci, NetHandlerPlayServer netHandler, CPacketPlayerDigging packet) |
91 | { | 96 | { |
92 | - if (packet.getStatus() == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) | 97 | + Action action = packet.getAction(); |
98 | + EntityPlayerMP player = netHandler.playerEntity; | ||
99 | + if (action == Action.START_DESTROY_BLOCK) | ||
100 | + { | ||
101 | + if (!Proxy.broker.onPlayerDigging(InteractType.DIG_BLOCK_MAYBE, player, netHandler, packet.getPosition())) | ||
102 | + { | ||
103 | + ci.cancel(); | ||
104 | + } | ||
105 | + } | ||
106 | + else if (action == Action.ABORT_DESTROY_BLOCK || action == Action.STOP_DESTROY_BLOCK) | ||
107 | + { | ||
108 | + Proxy.broker.onPlayerDigging(InteractType.DIG_BLOCK_END, player, netHandler, packet.getPosition()); | ||
109 | + } | ||
110 | + else if (action == Action.SWAP_HELD_ITEMS) | ||
93 | { | 111 | { |
94 | - if (!Proxy.broker.onPlayerDigging(netHandler, packet.getPosition(), netHandler.playerEntity)) | 112 | + if (!Proxy.broker.onPlayerSwapItems(player)) |
95 | { | 113 | { |
96 | ci.cancel(); | 114 | ci.cancel(); |
97 | } | 115 | } |
98 | } | 116 | } |
99 | } | 117 | } |
100 | 118 | ||
101 | - public static void onUseItem(CallbackInfoReturnable<Boolean> ci, EntityPlayer player, World world, ItemStack itemStack, BlockPos pos, | ||
102 | - EnumFacing side, float par8, float par9, float par10) | 119 | + public static void onRightClickBlock(CallbackInfoReturnable<EnumActionResult> ci, EntityPlayer player, World world, ItemStack stack, |
120 | + EnumHand hand, BlockPos pos, EnumFacing side, float offsetX, float offsetY, float offsetZ) | ||
121 | + { | ||
122 | + if (!(player instanceof EntityPlayerMP)) | ||
123 | + { | ||
124 | + return; | ||
125 | + } | ||
126 | + | ||
127 | + if (!Proxy.broker.onUseItem((EntityPlayerMP)player, hand, stack, pos, side)) | ||
128 | + { | ||
129 | + ci.setReturnValue(EnumActionResult.FAIL); | ||
130 | + } | ||
131 | + } | ||
132 | + | ||
133 | + public static void postRightClickBlock(CallbackInfoReturnable<EnumActionResult> cir, EntityPlayer player, World world, ItemStack stack, | ||
134 | + EnumHand hand, BlockPos pos, EnumFacing side, float offsetX, float offsetY, float offsetZ) | ||
135 | + { | ||
136 | + if (!(player instanceof EntityPlayerMP)) | ||
137 | + { | ||
138 | + return; | ||
139 | + } | ||
140 | + | ||
141 | + System.err.printf("@@ postRightClickBlock: %s\n", cir.getReturnValue()); | ||
142 | + } | ||
143 | + | ||
144 | + public static void onRightClick(CallbackInfoReturnable<EnumActionResult> cir, EntityPlayer player, World worldIn, ItemStack stack, EnumHand hand) | ||
103 | { | 145 | { |
104 | if (!(player instanceof EntityPlayerMP)) | 146 | if (!(player instanceof EntityPlayerMP)) |
105 | { | 147 | { |
106 | return; | 148 | return; |
107 | } | 149 | } |
108 | 150 | ||
109 | - if (!Proxy.broker.onUseItem(pos, side, (EntityPlayerMP)player)) | 151 | + if (!Proxy.broker.onClickedAir(InteractType.RIGHT_CLICK, (EntityPlayerMP)player, hand)) |
110 | { | 152 | { |
111 | - ci.setReturnValue(false); | 153 | + cir.setReturnValue(EnumActionResult.FAIL); |
112 | } | 154 | } |
113 | } | 155 | } |
114 | 156 | ||
115 | - public static void onBlockClicked(CallbackInfo ci, ItemInWorldManager manager, BlockPos pos, EnumFacing side) | 157 | + public static void onBlockClicked(CallbackInfo ci, PlayerInteractionManager manager, BlockPos pos, EnumFacing side) |
116 | { | 158 | { |
117 | if (!Proxy.broker.onBlockClicked(pos, side, manager)) | 159 | if (!Proxy.broker.onBlockClicked(pos, side, manager)) |
118 | { | 160 | { |
@@ -120,7 +162,7 @@ public abstract class Proxy | @@ -120,7 +162,7 @@ public abstract class Proxy | ||
120 | } | 162 | } |
121 | } | 163 | } |
122 | 164 | ||
123 | - public static void onPlayerMoved(CallbackInfo ci, NetHandlerPlayServer netHandler, C03PacketPlayer packet, WorldServer world, double oldPosX, | 165 | + public static void onPlayerMoved(CallbackInfo ci, NetHandlerPlayServer netHandler, CPacketPlayer packet, WorldServer world, double oldPosX, |
124 | double oldPosY, double oldPosZ) | 166 | double oldPosY, double oldPosZ) |
125 | { | 167 | { |
126 | if (!Proxy.broker.onPlayerMove(netHandler, packet, netHandler.playerEntity, world)) | 168 | if (!Proxy.broker.onPlayerMove(netHandler, packet, netHandler.playerEntity, world)) |
@@ -129,8 +171,7 @@ public abstract class Proxy | @@ -129,8 +171,7 @@ public abstract class Proxy | ||
129 | } | 171 | } |
130 | } | 172 | } |
131 | 173 | ||
132 | - public static void onPlayerMoved(CallbackInfo ci, NetHandlerPlayServer netHandler, C03PacketPlayer packet, WorldServer world, double oldPosX, | ||
133 | - double oldPosY, double oldPosZ, double deltaMoveSq, double deltaX, double deltaY, double deltaZ) | 174 | + public static void onPlayerMoved(CallbackInfo ci, NetHandlerPlayServer netHandler, CPacketPlayer packet, WorldServer world) |
134 | { | 175 | { |
135 | if (!Proxy.broker.onPlayerMove(netHandler, packet, netHandler.playerEntity, world)) | 176 | if (!Proxy.broker.onPlayerMove(netHandler, packet, netHandler.playerEntity, world)) |
136 | { | 177 | { |
src/main/java/com/mumfrey/liteloader/core/ServerPluginChannels.java
@@ -4,8 +4,8 @@ import net.minecraft.entity.player.EntityPlayerMP; | @@ -4,8 +4,8 @@ import net.minecraft.entity.player.EntityPlayerMP; | ||
4 | import net.minecraft.network.INetHandler; | 4 | import net.minecraft.network.INetHandler; |
5 | import net.minecraft.network.NetHandlerPlayServer; | 5 | import net.minecraft.network.NetHandlerPlayServer; |
6 | import net.minecraft.network.PacketBuffer; | 6 | import net.minecraft.network.PacketBuffer; |
7 | -import net.minecraft.network.play.client.C17PacketCustomPayload; | ||
8 | -import net.minecraft.network.play.server.S3FPacketCustomPayload; | 7 | +import net.minecraft.network.play.client.CPacketCustomPayload; |
8 | +import net.minecraft.network.play.server.SPacketCustomPayload; | ||
9 | 9 | ||
10 | import com.mumfrey.liteloader.ServerPluginChannelListener; | 10 | import com.mumfrey.liteloader.ServerPluginChannelListener; |
11 | import com.mumfrey.liteloader.api.Listener; | 11 | import com.mumfrey.liteloader.api.Listener; |
@@ -99,7 +99,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | @@ -99,7 +99,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | ||
99 | * @param netHandler | 99 | * @param netHandler |
100 | * @param customPayload | 100 | * @param customPayload |
101 | */ | 101 | */ |
102 | - public void onPluginChannelMessage(INetHandler netHandler, C17PacketCustomPayload customPayload) | 102 | + public void onPluginChannelMessage(INetHandler netHandler, CPacketCustomPayload customPayload) |
103 | { | 103 | { |
104 | if (customPayload != null && customPayload.getChannelName() != null) | 104 | if (customPayload != null && customPayload.getChannelName() != null) |
105 | { | 105 | { |
@@ -195,7 +195,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | @@ -195,7 +195,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | ||
195 | */ | 195 | */ |
196 | private void sendRegistrationData(EntityPlayerMP recipient, PacketBuffer registrationData) | 196 | private void sendRegistrationData(EntityPlayerMP recipient, PacketBuffer registrationData) |
197 | { | 197 | { |
198 | - ServerPluginChannels.dispatch(recipient, new S3FPacketCustomPayload(CHANNEL_REGISTER, registrationData)); | 198 | + ServerPluginChannels.dispatch(recipient, new SPacketCustomPayload(CHANNEL_REGISTER, registrationData)); |
199 | } | 199 | } |
200 | 200 | ||
201 | /** | 201 | /** |
@@ -237,7 +237,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | @@ -237,7 +237,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | ||
237 | throw new UnregisteredChannelException(channel); | 237 | throw new UnregisteredChannelException(channel); |
238 | } | 238 | } |
239 | 239 | ||
240 | - S3FPacketCustomPayload payload = new S3FPacketCustomPayload(channel, data); | 240 | + SPacketCustomPayload payload = new SPacketCustomPayload(channel, data); |
241 | return ServerPluginChannels.dispatch(recipient, payload); | 241 | return ServerPluginChannels.dispatch(recipient, payload); |
242 | } | 242 | } |
243 | 243 | ||
@@ -245,7 +245,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | @@ -245,7 +245,7 @@ public class ServerPluginChannels extends PluginChannels<ServerPluginChannelList | ||
245 | * @param recipient | 245 | * @param recipient |
246 | * @param payload | 246 | * @param payload |
247 | */ | 247 | */ |
248 | - static boolean dispatch(EntityPlayerMP recipient, S3FPacketCustomPayload payload) | 248 | + static boolean dispatch(EntityPlayerMP recipient, SPacketCustomPayload payload) |
249 | { | 249 | { |
250 | try | 250 | try |
251 | { | 251 | { |
src/main/java/com/mumfrey/liteloader/core/runtime/Obf.java
@@ -12,7 +12,7 @@ import org.spongepowered.asm.obfuscation.SrgMethod; | @@ -12,7 +12,7 @@ import org.spongepowered.asm.obfuscation.SrgMethod; | ||
12 | * Centralised obfuscation table for LiteLoader | 12 | * Centralised obfuscation table for LiteLoader |
13 | * | 13 | * |
14 | * @author Adam Mummery-Smith | 14 | * @author Adam Mummery-Smith |
15 | - * TODO Obfuscation 1.8.9 | 15 | + * TODO Obfuscation 1.9 |
16 | */ | 16 | */ |
17 | public class Obf | 17 | public class Obf |
18 | { | 18 | { |
@@ -38,14 +38,14 @@ public class Obf | @@ -38,14 +38,14 @@ public class Obf | ||
38 | 38 | ||
39 | // Classes | 39 | // Classes |
40 | // ----------------------------------------------------------------------------------------- | 40 | // ----------------------------------------------------------------------------------------- |
41 | - public static final Obf Minecraft = new Obf("net.minecraft.client.Minecraft", "ave" ); | ||
42 | - public static final Obf EntityRenderer = new Obf("net.minecraft.client.renderer.EntityRenderer", "bfk" ); | ||
43 | - public static final Obf Blocks = new Obf("net.minecraft.init.Blocks", "afi" ); | 41 | + public static final Obf Minecraft = new Obf("net.minecraft.client.Minecraft", "bcf" ); |
42 | + public static final Obf EntityRenderer = new Obf("net.minecraft.client.renderer.EntityRenderer", "bng" ); | ||
43 | + public static final Obf Blocks = new Obf("net.minecraft.init.Blocks", "aju" ); | ||
44 | public static final Obf CrashReport$6 = new Obf("net.minecraft.crash.CrashReport$6", "b$6" ); | 44 | public static final Obf CrashReport$6 = new Obf("net.minecraft.crash.CrashReport$6", "b$6" ); |
45 | public static final Obf INetHandler = new Obf("net.minecraft.network.INetHandler", "ep" ); | 45 | public static final Obf INetHandler = new Obf("net.minecraft.network.INetHandler", "ep" ); |
46 | - public static final Obf Items = new Obf("net.minecraft.init.Items", "zy" ); | ||
47 | - public static final Obf Profiler = new Obf("net.minecraft.profiler.Profiler", "ny" ); | ||
48 | - public static final Obf TileEntity = new Obf("net.minecraft.tileentity.TileEntity", "akw" ); | 46 | + public static final Obf Items = new Obf("net.minecraft.init.Items", "ads" ); |
47 | + public static final Obf Profiler = new Obf("net.minecraft.profiler.Profiler", "oo" ); | ||
48 | + public static final Obf TileEntity = new Obf("net.minecraft.tileentity.TileEntity", "apw" ); | ||
49 | 49 | ||
50 | // Fields | 50 | // Fields |
51 | // ----------------------------------------------------------------------------------------- | 51 | // ----------------------------------------------------------------------------------------- |
@@ -54,11 +54,11 @@ public class Obf | @@ -54,11 +54,11 @@ public class Obf | ||
54 | 54 | ||
55 | // Methods | 55 | // Methods |
56 | // ----------------------------------------------------------------------------------------- | 56 | // ----------------------------------------------------------------------------------------- |
57 | - public static final Obf startGame = new Obf(Obf.Minecraft, "func_71384_a", "am" ); | 57 | + public static final Obf startGame = new Obf(Obf.Minecraft, "func_71384_a", "an" ); |
58 | public static final Obf startSection = new Obf(Obf.Profiler, "func_76320_a", "a" ); | 58 | public static final Obf startSection = new Obf(Obf.Profiler, "func_76320_a", "a" ); |
59 | public static final Obf endSection = new Obf(Obf.Profiler, "func_76319_b", "b" ); | 59 | public static final Obf endSection = new Obf(Obf.Profiler, "func_76319_b", "b" ); |
60 | public static final Obf endStartSection = new Obf(Obf.Profiler, "func_76318_c", "c" ); | 60 | public static final Obf endStartSection = new Obf(Obf.Profiler, "func_76318_c", "c" ); |
61 | - public static final Obf processPacket = new Obf(Packets.S12PacketEntityVelocity, "func_148833_a", "a" ); | 61 | + public static final Obf processPacket = new Obf(Packets.SPacketEntityVelocity, "func_148833_a", "a" ); |
62 | 62 | ||
63 | // CHECKSTYLE:ON | 63 | // CHECKSTYLE:ON |
64 | 64 |
src/main/java/com/mumfrey/liteloader/core/runtime/Packets.java
@@ -7,7 +7,7 @@ import java.util.Map; | @@ -7,7 +7,7 @@ import java.util.Map; | ||
7 | * Packet obfuscation table | 7 | * Packet obfuscation table |
8 | * | 8 | * |
9 | * @author Adam Mummery-Smith | 9 | * @author Adam Mummery-Smith |
10 | - * TODO Obfuscation 1.8.9 | 10 | + * TODO Obfuscation 1.9 |
11 | */ | 11 | */ |
12 | public final class Packets extends Obf | 12 | public final class Packets extends Obf |
13 | { | 13 | { |
@@ -32,232 +32,246 @@ public final class Packets extends Obf | @@ -32,232 +32,246 @@ public final class Packets extends Obf | ||
32 | 32 | ||
33 | private static Map<String, Packets> packetMap = new HashMap<String, Packets>(); | 33 | private static Map<String, Packets> packetMap = new HashMap<String, Packets>(); |
34 | 34 | ||
35 | - public static Packets S08PacketPlayerPosLook = new Packets("net.minecraft.network.play.server.S08PacketPlayerPosLook", "fi", Context.CLIENT); | ||
36 | - public static Packets S0EPacketSpawnObject = new Packets("net.minecraft.network.play.server.S0EPacketSpawnObject", "fk", Context.CLIENT); | ||
37 | - public static Packets S11PacketSpawnExperienceOrb = new Packets("net.minecraft.network.play.server.S11PacketSpawnExperienceOrb", "fl", Context.CLIENT); | ||
38 | - public static Packets S2CPacketSpawnGlobalEntity = new Packets("net.minecraft.network.play.server.S2CPacketSpawnGlobalEntity", "fm", Context.CLIENT); | ||
39 | - public static Packets S0FPacketSpawnMob = new Packets("net.minecraft.network.play.server.S0FPacketSpawnMob", "fn", Context.CLIENT); | ||
40 | - public static Packets S10PacketSpawnPainting = new Packets("net.minecraft.network.play.server.S10PacketSpawnPainting", "fo", Context.CLIENT); | ||
41 | - public static Packets S0CPacketSpawnPlayer = new Packets("net.minecraft.network.play.server.S0CPacketSpawnPlayer", "fp", Context.CLIENT); | ||
42 | - public static Packets S0BPacketAnimation = new Packets("net.minecraft.network.play.server.S0BPacketAnimation", "fq", Context.CLIENT); | ||
43 | - public static Packets S37PacketStatistics = new Packets("net.minecraft.network.play.server.S37PacketStatistics", "fr", Context.CLIENT); | ||
44 | - public static Packets S25PacketBlockBreakAnim = new Packets("net.minecraft.network.play.server.S25PacketBlockBreakAnim", "fs", Context.CLIENT); | ||
45 | - public static Packets S35PacketUpdateTileEntity = new Packets("net.minecraft.network.play.server.S35PacketUpdateTileEntity", "ft", Context.CLIENT); | ||
46 | - public static Packets S24PacketBlockAction = new Packets("net.minecraft.network.play.server.S24PacketBlockAction", "fu", Context.CLIENT); | ||
47 | - public static Packets S23PacketBlockChange = new Packets("net.minecraft.network.play.server.S23PacketBlockChange", "fv", Context.CLIENT); | ||
48 | - public static Packets S41PacketServerDifficulty = new Packets("net.minecraft.network.play.server.S41PacketServerDifficulty", "fw", Context.CLIENT); | ||
49 | - public static Packets S3APacketTabComplete = new Packets("net.minecraft.network.play.server.S3APacketTabComplete", "fx", Context.CLIENT); | ||
50 | - public static Packets S02PacketChat = new Packets("net.minecraft.network.play.server.S02PacketChat", "fy", Context.CLIENT); | ||
51 | - public static Packets S22PacketMultiBlockChange = new Packets("net.minecraft.network.play.server.S22PacketMultiBlockChange", "fz", Context.CLIENT); | ||
52 | - public static Packets S32PacketConfirmTransaction = new Packets("net.minecraft.network.play.server.S32PacketConfirmTransaction", "ga", Context.CLIENT); | ||
53 | - public static Packets S2EPacketCloseWindow = new Packets("net.minecraft.network.play.server.S2EPacketCloseWindow", "gb", Context.CLIENT); | ||
54 | - public static Packets S2DPacketOpenWindow = new Packets("net.minecraft.network.play.server.S2DPacketOpenWindow", "gc", Context.CLIENT); | ||
55 | - public static Packets S30PacketWindowItems = new Packets("net.minecraft.network.play.server.S30PacketWindowItems", "gd", Context.CLIENT); | ||
56 | - public static Packets S31PacketWindowProperty = new Packets("net.minecraft.network.play.server.S31PacketWindowProperty", "ge", Context.CLIENT); | ||
57 | - public static Packets S2FPacketSetSlot = new Packets("net.minecraft.network.play.server.S2FPacketSetSlot", "gf", Context.CLIENT); | ||
58 | - public static Packets S3FPacketCustomPayload = new Packets("net.minecraft.network.play.server.S3FPacketCustomPayload", "gg", Context.CLIENT); | ||
59 | - public static Packets S40PacketDisconnect = new Packets("net.minecraft.network.play.server.S40PacketDisconnect", "gh", Context.CLIENT); | ||
60 | - public static Packets S19PacketEntityStatus = new Packets("net.minecraft.network.play.server.S19PacketEntityStatus", "gi", Context.CLIENT); | ||
61 | - public static Packets S49PacketUpdateEntityNBT = new Packets("net.minecraft.network.play.server.S49PacketUpdateEntityNBT", "gj", Context.CLIENT); | ||
62 | - public static Packets S27PacketExplosion = new Packets("net.minecraft.network.play.server.S27PacketExplosion", "gk", Context.CLIENT); | ||
63 | - public static Packets S46PacketSetCompressionLevel = new Packets("net.minecraft.network.play.server.S46PacketSetCompressionLevel", "gl", Context.CLIENT); | ||
64 | - public static Packets S2BPacketChangeGameState = new Packets("net.minecraft.network.play.server.S2BPacketChangeGameState", "gm", Context.CLIENT); | ||
65 | - public static Packets S00PacketKeepAlive = new Packets("net.minecraft.network.play.server.S00PacketKeepAlive", "gn", Context.CLIENT); | ||
66 | - public static Packets S21PacketChunkData = new Packets("net.minecraft.network.play.server.S21PacketChunkData", "go", Context.CLIENT); | ||
67 | - public static Packets S26PacketMapChunkBulk = new Packets("net.minecraft.network.play.server.S26PacketMapChunkBulk", "gp", Context.CLIENT); | ||
68 | - public static Packets S28PacketEffect = new Packets("net.minecraft.network.play.server.S28PacketEffect", "gq", Context.CLIENT); | ||
69 | - public static Packets S2APacketParticles = new Packets("net.minecraft.network.play.server.S2APacketParticles", "gr", Context.CLIENT); | ||
70 | - public static Packets S29PacketSoundEffect = new Packets("net.minecraft.network.play.server.S29PacketSoundEffect", "gs", Context.CLIENT); | ||
71 | - public static Packets S01PacketJoinGame = new Packets("net.minecraft.network.play.server.S01PacketJoinGame", "gt", Context.CLIENT); | ||
72 | - public static Packets S34PacketMaps = new Packets("net.minecraft.network.play.server.S34PacketMaps", "gu", Context.CLIENT); | ||
73 | - public static Packets S14PacketEntity = new Packets("net.minecraft.network.play.server.S14PacketEntity", "gv", Context.CLIENT); | ||
74 | - public static Packets S15PacketEntityRelMove = new Packets("net.minecraft.network.play.server.S14PacketEntity$S15PacketEntityRelMove", "gv$a", Context.CLIENT); | ||
75 | - public static Packets S17PacketEntityLookMove = new Packets("net.minecraft.network.play.server.S14PacketEntity$S17PacketEntityLookMove", "gv$b", Context.CLIENT); | ||
76 | - public static Packets S16PacketEntityLook = new Packets("net.minecraft.network.play.server.S14PacketEntity$S16PacketEntityLook", "gv$c", Context.CLIENT); | ||
77 | - public static Packets S36PacketSignEditorOpen = new Packets("net.minecraft.network.play.server.S36PacketSignEditorOpen", "gw", Context.CLIENT); | ||
78 | - public static Packets S39PacketPlayerAbilities = new Packets("net.minecraft.network.play.server.S39PacketPlayerAbilities", "gx", Context.CLIENT); | ||
79 | - public static Packets S42PacketCombatEvent = new Packets("net.minecraft.network.play.server.S42PacketCombatEvent", "gy", Context.CLIENT); | ||
80 | - public static Packets S38PacketPlayerListItem = new Packets("net.minecraft.network.play.server.S38PacketPlayerListItem", "gz", Context.CLIENT); | ||
81 | - public static Packets S0APacketUseBed = new Packets("net.minecraft.network.play.server.S0APacketUseBed", "ha", Context.CLIENT); | ||
82 | - public static Packets S13PacketDestroyEntities = new Packets("net.minecraft.network.play.server.S13PacketDestroyEntities", "hb", Context.CLIENT); | ||
83 | - public static Packets S1EPacketRemoveEntityEffect = new Packets("net.minecraft.network.play.server.S1EPacketRemoveEntityEffect", "hc", Context.CLIENT); | ||
84 | - public static Packets S48PacketResourcePackSend = new Packets("net.minecraft.network.play.server.S48PacketResourcePackSend", "hd", Context.CLIENT); | ||
85 | - public static Packets S07PacketRespawn = new Packets("net.minecraft.network.play.server.S07PacketRespawn", "he", Context.CLIENT); | ||
86 | - public static Packets S19PacketEntityHeadLook = new Packets("net.minecraft.network.play.server.S19PacketEntityHeadLook", "hf", Context.CLIENT); | ||
87 | - public static Packets S44PacketWorldBorder = new Packets("net.minecraft.network.play.server.S44PacketWorldBorder", "hg", Context.CLIENT); | ||
88 | - public static Packets S43PacketCamera = new Packets("net.minecraft.network.play.server.S43PacketCamera", "hh", Context.CLIENT); | ||
89 | - public static Packets S09PacketHeldItemChange = new Packets("net.minecraft.network.play.server.S09PacketHeldItemChange", "hi", Context.CLIENT); | ||
90 | - public static Packets S3DPacketDisplayScoreboard = new Packets("net.minecraft.network.play.server.S3DPacketDisplayScoreboard", "hj", Context.CLIENT); | ||
91 | - public static Packets S1CPacketEntityMetadata = new Packets("net.minecraft.network.play.server.S1CPacketEntityMetadata", "hk", Context.CLIENT); | ||
92 | - public static Packets S1BPacketEntityAttach = new Packets("net.minecraft.network.play.server.S1BPacketEntityAttach", "hl", Context.CLIENT); | ||
93 | - public static Packets S12PacketEntityVelocity = new Packets("net.minecraft.network.play.server.S12PacketEntityVelocity", "hm", Context.CLIENT); | ||
94 | - public static Packets S04PacketEntityEquipment = new Packets("net.minecraft.network.play.server.S04PacketEntityEquipment", "hn", Context.CLIENT); | ||
95 | - public static Packets S1FPacketSetExperience = new Packets("net.minecraft.network.play.server.S1FPacketSetExperience", "ho", Context.CLIENT); | ||
96 | - public static Packets S06PacketUpdateHealth = new Packets("net.minecraft.network.play.server.S06PacketUpdateHealth", "hp", Context.CLIENT); | ||
97 | - public static Packets S3BPacketScoreboardObjective = new Packets("net.minecraft.network.play.server.S3BPacketScoreboardObjective", "hq", Context.CLIENT); | ||
98 | - public static Packets S3EPacketTeams = new Packets("net.minecraft.network.play.server.S3EPacketTeams", "hr", Context.CLIENT); | ||
99 | - public static Packets S3CPacketUpdateScore = new Packets("net.minecraft.network.play.server.S3CPacketUpdateScore", "hs", Context.CLIENT); | ||
100 | - public static Packets S05PacketSpawnPosition = new Packets("net.minecraft.network.play.server.S05PacketSpawnPosition", "ht", Context.CLIENT); | ||
101 | - public static Packets S03PacketTimeUpdate = new Packets("net.minecraft.network.play.server.S03PacketTimeUpdate", "hu", Context.CLIENT); | ||
102 | - public static Packets S45PacketTitle = new Packets("net.minecraft.network.play.server.S45PacketTitle", "hv", Context.CLIENT); | ||
103 | - public static Packets S33PacketUpdateSign = new Packets("net.minecraft.network.play.server.S33PacketUpdateSign", "hw", Context.CLIENT); | ||
104 | - public static Packets S47PacketPlayerListHeaderFooter = new Packets("net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter", "hx", Context.CLIENT); | ||
105 | - public static Packets S0DPacketCollectItem = new Packets("net.minecraft.network.play.server.S0DPacketCollectItem", "hy", Context.CLIENT); | ||
106 | - public static Packets S18PacketEntityTeleport = new Packets("net.minecraft.network.play.server.S18PacketEntityTeleport", "hz", Context.CLIENT); | ||
107 | - public static Packets S20PacketEntityProperties = new Packets("net.minecraft.network.play.server.S20PacketEntityProperties", "ia", Context.CLIENT); | ||
108 | - public static Packets S1DPacketEntityEffect = new Packets("net.minecraft.network.play.server.S1DPacketEntityEffect", "ib", Context.CLIENT); | ||
109 | - public static Packets C14PacketTabComplete = new Packets("net.minecraft.network.play.client.C14PacketTabComplete", "id", Context.SERVER); | ||
110 | - public static Packets C01PacketChatMessage = new Packets("net.minecraft.network.play.client.C01PacketChatMessage", "ie", Context.SERVER); | ||
111 | - public static Packets C16PacketClientStatus = new Packets("net.minecraft.network.play.client.C16PacketClientStatus", "ig", Context.SERVER); | ||
112 | - public static Packets C15PacketClientSettings = new Packets("net.minecraft.network.play.client.C15PacketClientSettings", "ih", Context.SERVER); | ||
113 | - public static Packets C0FPacketConfirmTransaction = new Packets("net.minecraft.network.play.client.C0FPacketConfirmTransaction", "ii", Context.SERVER); | ||
114 | - public static Packets C11PacketEnchantItem = new Packets("net.minecraft.network.play.client.C11PacketEnchantItem", "ij", Context.SERVER); | ||
115 | - public static Packets C0EPacketClickWindow = new Packets("net.minecraft.network.play.client.C0EPacketClickWindow", "ik", Context.SERVER); | ||
116 | - public static Packets C0DPacketCloseWindow = new Packets("net.minecraft.network.play.client.C0DPacketCloseWindow", "il", Context.SERVER); | ||
117 | - public static Packets C17PacketCustomPayload = new Packets("net.minecraft.network.play.client.C17PacketCustomPayload", "im", Context.SERVER); | ||
118 | - public static Packets C02PacketUseEntity = new Packets("net.minecraft.network.play.client.C02PacketUseEntity", "in", Context.SERVER); | ||
119 | - public static Packets C00PacketKeepAlive = new Packets("net.minecraft.network.play.client.C00PacketKeepAlive", "io", Context.SERVER); | ||
120 | - public static Packets C03PacketPlayer = new Packets("net.minecraft.network.play.client.C03PacketPlayer", "ip", Context.SERVER); | ||
121 | - public static Packets C04PacketPlayerPosition = new Packets("net.minecraft.network.play.client.C03PacketPlayer$C04PacketPlayerPosition", "ip$a", Context.SERVER); | ||
122 | - public static Packets C06PacketPlayerPosLook = new Packets("net.minecraft.network.play.client.C03PacketPlayer$C06PacketPlayerPosLook", "ip$b", Context.SERVER); | ||
123 | - public static Packets C05PacketPlayerLook = new Packets("net.minecraft.network.play.client.C03PacketPlayer$C05PacketPlayerLook", "ip$c", Context.SERVER); | ||
124 | - public static Packets C13PacketPlayerAbilities = new Packets("net.minecraft.network.play.client.C13PacketPlayerAbilities", "iq", Context.SERVER); | ||
125 | - public static Packets C07PacketPlayerDigging = new Packets("net.minecraft.network.play.client.C07PacketPlayerDigging", "ir", Context.SERVER); | ||
126 | - public static Packets C0BPacketEntityAction = new Packets("net.minecraft.network.play.client.C0BPacketEntityAction", "is", Context.SERVER); | ||
127 | - public static Packets C0CPacketInput = new Packets("net.minecraft.network.play.client.C0CPacketInput", "it", Context.SERVER); | ||
128 | - public static Packets C19PacketResourcePackStatus = new Packets("net.minecraft.network.play.client.C19PacketResourcePackStatus", "iu", Context.SERVER); | ||
129 | - public static Packets C09PacketHeldItemChange = new Packets("net.minecraft.network.play.client.C09PacketHeldItemChange", "iv", Context.SERVER); | ||
130 | - public static Packets C10PacketCreativeInventoryAction = new Packets("net.minecraft.network.play.client.C10PacketCreativeInventoryAction", "iw", Context.SERVER); | ||
131 | - public static Packets C12PacketUpdateSign = new Packets("net.minecraft.network.play.client.C12PacketUpdateSign", "ix", Context.SERVER); | ||
132 | - public static Packets C0APacketAnimation = new Packets("net.minecraft.network.play.client.C0APacketAnimation", "iy", Context.SERVER); | ||
133 | - public static Packets C18PacketSpectate = new Packets("net.minecraft.network.play.client.C18PacketSpectate", "iz", Context.SERVER); | ||
134 | - public static Packets C08PacketPlayerBlockPlacement = new Packets("net.minecraft.network.play.client.C08PacketPlayerBlockPlacement", "ja", Context.SERVER); | ||
135 | - public static Packets C00Handshake = new Packets("net.minecraft.network.handshake.client.C00Handshake", "jc", Context.SERVER); | ||
136 | - public static Packets S02PacketLoginSuccess = new Packets("net.minecraft.network.login.server.S02PacketLoginSuccess", "jg", Context.CLIENT); | ||
137 | - public static Packets S01PacketEncryptionRequest = new Packets("net.minecraft.network.login.server.S01PacketEncryptionRequest", "jh", Context.CLIENT); | ||
138 | - public static Packets S03PacketEnableCompression = new Packets("net.minecraft.network.login.server.S03PacketEnableCompression", "ji", Context.CLIENT); | ||
139 | - public static Packets S00PacketDisconnect = new Packets("net.minecraft.network.login.server.S00PacketDisconnect", "jj", Context.CLIENT); | ||
140 | - public static Packets C00PacketLoginStart = new Packets("net.minecraft.network.login.client.C00PacketLoginStart", "jl", Context.SERVER); | ||
141 | - public static Packets C01PacketEncryptionResponse = new Packets("net.minecraft.network.login.client.C01PacketEncryptionResponse", "jm", Context.SERVER); | ||
142 | - public static Packets S01PacketPong = new Packets("net.minecraft.network.status.server.S01PacketPong", "jq", Context.CLIENT); | ||
143 | - public static Packets S00PacketServerInfo = new Packets("net.minecraft.network.status.server.S00PacketServerInfo", "jr", Context.CLIENT); | ||
144 | - public static Packets C01PacketPing = new Packets("net.minecraft.network.status.client.C01PacketPing", "ju", Context.SERVER); | ||
145 | - public static Packets C00PacketServerQuery = new Packets("net.minecraft.network.status.client.C00PacketServerQuery", "jv", Context.SERVER); | 35 | + public static Packets SPacketSpawnObject = new Packets("net/minecraft/network/play/server/SPacketSpawnObject", "fj", Context.CLIENT); |
36 | + public static Packets SPacketSpawnExperienceOrb = new Packets("net/minecraft/network/play/server/SPacketSpawnExperienceOrb", "fk", Context.CLIENT); | ||
37 | + public static Packets SPacketSpawnGlobalEntity = new Packets("net/minecraft/network/play/server/SPacketSpawnGlobalEntity", "fl", Context.CLIENT); | ||
38 | + public static Packets SPacketSpawnMob = new Packets("net/minecraft/network/play/server/SPacketSpawnMob", "fm", Context.CLIENT); | ||
39 | + public static Packets SPacketSpawnPainting = new Packets("net/minecraft/network/play/server/SPacketSpawnPainting", "fn", Context.CLIENT); | ||
40 | + public static Packets SPacketSpawnPlayer = new Packets("net/minecraft/network/play/server/SPacketSpawnPlayer", "fo", Context.CLIENT); | ||
41 | + public static Packets SPacketAnimation = new Packets("net/minecraft/network/play/server/SPacketAnimation", "fp", Context.CLIENT); | ||
42 | + public static Packets SPacketStatistics = new Packets("net/minecraft/network/play/server/SPacketStatistics", "fq", Context.CLIENT); | ||
43 | + public static Packets SPacketBlockBreakAnim = new Packets("net/minecraft/network/play/server/SPacketBlockBreakAnim", "fr", Context.CLIENT); | ||
44 | + public static Packets SPacketUpdateTileEntity = new Packets("net/minecraft/network/play/server/SPacketUpdateTileEntity", "fs", Context.CLIENT); | ||
45 | + public static Packets SPacketBlockAction = new Packets("net/minecraft/network/play/server/SPacketBlockAction", "ft", Context.CLIENT); | ||
46 | + public static Packets SPacketBlockChange = new Packets("net/minecraft/network/play/server/SPacketBlockChange", "fu", Context.CLIENT); | ||
47 | + public static Packets SPacketUpdateEntityNBT = new Packets("net/minecraft/network/play/server/SPacketUpdateEntityNBT", "fv", Context.CLIENT); | ||
48 | + public static Packets SPacketServerDifficulty = new Packets("net/minecraft/network/play/server/SPacketServerDifficulty", "fw", Context.CLIENT); | ||
49 | + public static Packets SPacketTabComplete = new Packets("net/minecraft/network/play/server/SPacketTabComplete", "fx", Context.CLIENT); | ||
50 | + public static Packets SPacketChat = new Packets("net/minecraft/network/play/server/SPacketChat", "fy", Context.CLIENT); | ||
51 | + public static Packets SPacketMultiBlockChange = new Packets("net/minecraft/network/play/server/SPacketMultiBlockChange", "fz", Context.CLIENT); | ||
52 | + public static Packets SPacketConfirmTransaction = new Packets("net/minecraft/network/play/server/SPacketConfirmTransaction", "ga", Context.CLIENT); | ||
53 | + public static Packets SPacketCloseWindow = new Packets("net/minecraft/network/play/server/SPacketCloseWindow", "gb", Context.CLIENT); | ||
54 | + public static Packets SPacketOpenWindow = new Packets("net/minecraft/network/play/server/SPacketOpenWindow", "gc", Context.CLIENT); | ||
55 | + public static Packets SPacketWindowItems = new Packets("net/minecraft/network/play/server/SPacketWindowItems", "gd", Context.CLIENT); | ||
56 | + public static Packets SPacketWindowProperty = new Packets("net/minecraft/network/play/server/SPacketWindowProperty", "ge", Context.CLIENT); | ||
57 | + public static Packets SPacketSetSlot = new Packets("net/minecraft/network/play/server/SPacketSetSlot", "gf", Context.CLIENT); | ||
58 | + public static Packets SPacketCooldown = new Packets("net/minecraft/network/play/server/SPacketCooldown", "gg", Context.CLIENT); | ||
59 | + public static Packets SPacketCustomPayload = new Packets("net/minecraft/network/play/server/SPacketCustomPayload", "gh", Context.CLIENT); | ||
60 | + public static Packets SPacketCustomSound = new Packets("net/minecraft/network/play/server/SPacketCustomSound", "gi", Context.CLIENT); | ||
61 | + public static Packets SPacketDisconnectPlay = new Packets("net/minecraft/network/play/server/SPacketDisconnect", "gj", Context.CLIENT); | ||
62 | + public static Packets SPacketEntityStatus = new Packets("net/minecraft/network/play/server/SPacketEntityStatus", "gk", Context.CLIENT); | ||
63 | + public static Packets SPacketExplosion = new Packets("net/minecraft/network/play/server/SPacketExplosion", "gl", Context.CLIENT); | ||
64 | + public static Packets SPacketUnloadChunk = new Packets("net/minecraft/network/play/server/SPacketUnloadChunk", "gm", Context.CLIENT); | ||
65 | + public static Packets SPacketChangeGameState = new Packets("net/minecraft/network/play/server/SPacketChangeGameState", "gn", Context.CLIENT); | ||
66 | + public static Packets SPacketKeepAlive = new Packets("net/minecraft/network/play/server/SPacketKeepAlive", "go", Context.CLIENT); | ||
67 | + public static Packets SPacketChunkData = new Packets("net/minecraft/network/play/server/SPacketChunkData", "gp", Context.CLIENT); | ||
68 | + public static Packets SPacketEffect = new Packets("net/minecraft/network/play/server/SPacketEffect", "gq", Context.CLIENT); | ||
69 | + public static Packets SPacketParticles = new Packets("net/minecraft/network/play/server/SPacketParticles", "gr", Context.CLIENT); | ||
70 | + public static Packets SPacketJoinGame = new Packets("net/minecraft/network/play/server/SPacketJoinGame", "gs", Context.CLIENT); | ||
71 | + public static Packets SPacketMaps = new Packets("net/minecraft/network/play/server/SPacketMaps", "gt", Context.CLIENT); | ||
72 | + public static Packets SPacketEntity = new Packets("net/minecraft/network/play/server/SPacketEntity", "gu", Context.CLIENT); | ||
73 | + public static Packets S15PacketEntityRelMove = new Packets("net/minecraft/network/play/server/SPacketEntity$S15PacketEntityRelMove", "gu$a", Context.CLIENT); | ||
74 | + public static Packets S17PacketEntityLookMove = new Packets("net/minecraft/network/play/server/SPacketEntity$S17PacketEntityLookMove", "gu$b", Context.CLIENT); | ||
75 | + public static Packets S16PacketEntityLook = new Packets("net/minecraft/network/play/server/SPacketEntity$S16PacketEntityLook", "gu$c", Context.CLIENT); | ||
76 | + public static Packets SPacketMoveVehicle = new Packets("net/minecraft/network/play/server/SPacketMoveVehicle", "gv", Context.CLIENT); | ||
77 | + public static Packets SPacketSignEditorOpen = new Packets("net/minecraft/network/play/server/SPacketSignEditorOpen", "gw", Context.CLIENT); | ||
78 | + public static Packets SPacketPlayerAbilities = new Packets("net/minecraft/network/play/server/SPacketPlayerAbilities", "gx", Context.CLIENT); | ||
79 | + public static Packets SPacketCombatEvent = new Packets("net/minecraft/network/play/server/SPacketCombatEvent", "gy", Context.CLIENT); | ||
80 | + public static Packets SPacketPlayerListItem = new Packets("net/minecraft/network/play/server/SPacketPlayerListItem", "gz", Context.CLIENT); | ||
81 | + public static Packets SPacketPlayerPosLook = new Packets("net/minecraft/network/play/server/SPacketPlayerPosLook", "ha", Context.CLIENT); | ||
82 | + public static Packets SPacketUseBed = new Packets("net/minecraft/network/play/server/SPacketUseBed", "hb", Context.CLIENT); | ||
83 | + public static Packets SPacketDestroyEntities = new Packets("net/minecraft/network/play/server/SPacketDestroyEntities", "hc", Context.CLIENT); | ||
84 | + public static Packets SPacketRemoveEntityEffect = new Packets("net/minecraft/network/play/server/SPacketRemoveEntityEffect", "hd", Context.CLIENT); | ||
85 | + public static Packets SPacketResourcePackSend = new Packets("net/minecraft/network/play/server/SPacketResourcePackSend", "he", Context.CLIENT); | ||
86 | + public static Packets SPacketRespawn = new Packets("net/minecraft/network/play/server/SPacketRespawn", "hf", Context.CLIENT); | ||
87 | + public static Packets SPacketEntityHeadLook = new Packets("net/minecraft/network/play/server/SPacketEntityHeadLook", "hg", Context.CLIENT); | ||
88 | + public static Packets SPacketWorldBorder = new Packets("net/minecraft/network/play/server/SPacketWorldBorder", "hh", Context.CLIENT); | ||
89 | + public static Packets SPacketCamera = new Packets("net/minecraft/network/play/server/SPacketCamera", "hi", Context.CLIENT); | ||
90 | + public static Packets SPacketHeldItemChange = new Packets("net/minecraft/network/play/server/SPacketHeldItemChange", "hj", Context.CLIENT); | ||
91 | + public static Packets SPacketDisplayObjective = new Packets("net/minecraft/network/play/server/SPacketDisplayObjective", "hk", Context.CLIENT); | ||
92 | + public static Packets SPacketEntityMetadata = new Packets("net/minecraft/network/play/server/SPacketEntityMetadata", "hl", Context.CLIENT); | ||
93 | + public static Packets SPacketEntityAttach = new Packets("net/minecraft/network/play/server/SPacketEntityAttach", "hm", Context.CLIENT); | ||
94 | + public static Packets SPacketEntityVelocity = new Packets("net/minecraft/network/play/server/SPacketEntityVelocity", "hn", Context.CLIENT); | ||
95 | + public static Packets C00Handshake = new Packets("net/minecraft/network/handshake/client/C00Handshake", "jj", Context.SERVER); | ||
96 | + public static Packets SPacketEntityEquipment = new Packets("net/minecraft/network/play/server/SPacketEntityEquipment", "ho", Context.CLIENT); | ||
97 | + public static Packets SPacketSetExperience = new Packets("net/minecraft/network/play/server/SPacketSetExperience", "hp", Context.CLIENT); | ||
98 | + public static Packets SPacketUpdateHealth = new Packets("net/minecraft/network/play/server/SPacketUpdateHealth", "hq", Context.CLIENT); | ||
99 | + public static Packets SPacketScoreboardObjective = new Packets("net/minecraft/network/play/server/SPacketScoreboardObjective", "hr", Context.CLIENT); | ||
100 | + public static Packets SPacketSetPassengers = new Packets("net/minecraft/network/play/server/SPacketSetPassengers", "hs", Context.CLIENT); | ||
101 | + public static Packets SPacketTeams = new Packets("net/minecraft/network/play/server/SPacketTeams", "ht", Context.CLIENT); | ||
102 | + public static Packets SPacketUpdateScore = new Packets("net/minecraft/network/play/server/SPacketUpdateScore", "hu", Context.CLIENT); | ||
103 | + public static Packets SPacketSpawnPosition = new Packets("net/minecraft/network/play/server/SPacketSpawnPosition", "hv", Context.CLIENT); | ||
104 | + public static Packets SPacketTimeUpdate = new Packets("net/minecraft/network/play/server/SPacketTimeUpdate", "hw", Context.CLIENT); | ||
105 | + public static Packets SPacketTitle = new Packets("net/minecraft/network/play/server/SPacketTitle", "hx", Context.CLIENT); | ||
106 | + public static Packets SPacketUpdateSign = new Packets("net/minecraft/network/play/server/SPacketUpdateSign", "hy", Context.CLIENT); | ||
107 | + public static Packets SPacketSoundEffect = new Packets("net/minecraft/network/play/server/SPacketSoundEffect", "hz", Context.CLIENT); | ||
108 | + public static Packets SPacketPlayerListHeaderFooter = new Packets("net/minecraft/network/play/server/SPacketPlayerListHeaderFooter", "ia", Context.CLIENT); | ||
109 | + public static Packets SPacketCollectItem = new Packets("net/minecraft/network/play/server/SPacketCollectItem", "ib", Context.CLIENT); | ||
110 | + public static Packets SPacketEntityTeleport = new Packets("net/minecraft/network/play/server/SPacketEntityTeleport", "ic", Context.CLIENT); | ||
111 | + public static Packets SPacketEntityProperties = new Packets("net/minecraft/network/play/server/SPacketEntityProperties", "id", Context.CLIENT); | ||
112 | + public static Packets SPacketEntityEffect = new Packets("net/minecraft/network/play/server/SPacketEntityEffect", "ie", Context.CLIENT); | ||
113 | + public static Packets CPacketConfirmTeleport = new Packets("net/minecraft/network/play/client/CPacketConfirmTeleport", "ih", Context.SERVER); | ||
114 | + public static Packets CPacketTabComplete = new Packets("net/minecraft/network/play/client/CPacketTabComplete", "ii", Context.SERVER); | ||
115 | + public static Packets CPacketChatMessage = new Packets("net/minecraft/network/play/client/CPacketChatMessage", "ij", Context.SERVER); | ||
116 | + public static Packets CPacketClientStatus = new Packets("net/minecraft/network/play/client/CPacketClientStatus", "ik", Context.SERVER); | ||
117 | + public static Packets CPacketClientSettings = new Packets("net/minecraft/network/play/client/CPacketClientSettings", "il", Context.SERVER); | ||
118 | + public static Packets CPacketConfirmTransaction = new Packets("net/minecraft/network/play/client/CPacketConfirmTransaction", "im", Context.SERVER); | ||
119 | + public static Packets CPacketEnchantItem = new Packets("net/minecraft/network/play/client/CPacketEnchantItem", "in", Context.SERVER); | ||
120 | + public static Packets CPacketClickWindow = new Packets("net/minecraft/network/play/client/CPacketClickWindow", "io", Context.SERVER); | ||
121 | + public static Packets CPacketCloseWindow = new Packets("net/minecraft/network/play/client/CPacketCloseWindow", "ip", Context.SERVER); | ||
122 | + public static Packets CPacketCustomPayload = new Packets("net/minecraft/network/play/client/CPacketCustomPayload", "iq", Context.SERVER); | ||
123 | + public static Packets CPacketUseEntity = new Packets("net/minecraft/network/play/client/CPacketUseEntity", "ir", Context.SERVER); | ||
124 | + public static Packets CPacketKeepAlive = new Packets("net/minecraft/network/play/client/CPacketKeepAlive", "is", Context.SERVER); | ||
125 | + public static Packets CPacketPlayer = new Packets("net/minecraft/network/play/client/CPacketPlayer", "it", Context.SERVER); | ||
126 | + public static Packets C04PacketPlayerPosition = new Packets("net/minecraft/network/play/client/CPacketPlayer$C04PacketPlayerPosition", "it$a", Context.SERVER); | ||
127 | + public static Packets C06PacketPlayerPosLook = new Packets("net/minecraft/network/play/client/CPacketPlayer$C06PacketPlayerPosLook", "it$b", Context.SERVER); | ||
128 | + public static Packets C05PacketPlayerLook = new Packets("net/minecraft/network/play/client/CPacketPlayer$C05PacketPlayerLook", "it$c", Context.SERVER); | ||
129 | + public static Packets CPacketVehicleMove = new Packets("net/minecraft/network/play/client/CPacketVehicleMove", "iu", Context.SERVER); | ||
130 | + public static Packets CPacketSteerBoat = new Packets("net/minecraft/network/play/client/CPacketSteerBoat", "iv", Context.SERVER); | ||
131 | + public static Packets CPacketPlayerAbilities = new Packets("net/minecraft/network/play/client/CPacketPlayerAbilities", "iw", Context.SERVER); | ||
132 | + public static Packets CPacketPlayerDigging = new Packets("net/minecraft/network/play/client/CPacketPlayerDigging", "ix", Context.SERVER); | ||
133 | + public static Packets CPacketEntityAction = new Packets("net/minecraft/network/play/client/CPacketEntityAction", "iy", Context.SERVER); | ||
134 | + public static Packets CPacketInput = new Packets("net/minecraft/network/play/client/CPacketInput", "iz", Context.SERVER); | ||
135 | + public static Packets CPacketResourcePackStatus = new Packets("net/minecraft/network/play/client/CPacketResourcePackStatus", "ja", Context.SERVER); | ||
136 | + public static Packets CPacketHeldItemChange = new Packets("net/minecraft/network/play/client/CPacketHeldItemChange", "jb", Context.SERVER); | ||
137 | + public static Packets CPacketCreativeInventoryAction = new Packets("net/minecraft/network/play/client/CPacketCreativeInventoryAction", "jc", Context.SERVER); | ||
138 | + public static Packets CPacketUpdateSign = new Packets("net/minecraft/network/play/client/CPacketUpdateSign", "jd", Context.SERVER); | ||
139 | + public static Packets CPacketAnimation = new Packets("net/minecraft/network/play/client/CPacketAnimation", "je", Context.SERVER); | ||
140 | + public static Packets CPacketSpectate = new Packets("net/minecraft/network/play/client/CPacketSpectate", "jf", Context.SERVER); | ||
141 | + public static Packets CPacketPlayerTryUseItem = new Packets("net/minecraft/network/play/client/CPacketPlayerTryUseItem", "jg", Context.SERVER); | ||
142 | + public static Packets CPacketPlayerBlockPlacement = new Packets("net/minecraft/network/play/client/CPacketPlayerBlockPlacement", "jh", Context.SERVER); | ||
143 | + public static Packets SPacketLoginSuccess = new Packets("net/minecraft/network/login/server/SPacketLoginSuccess", "jn", Context.CLIENT); | ||
144 | + public static Packets SPacketEncryptionRequest = new Packets("net/minecraft/network/login/server/SPacketEncryptionRequest", "jo", Context.CLIENT); | ||
145 | + public static Packets SPacketEnableCompression = new Packets("net/minecraft/network/login/server/SPacketEnableCompression", "jp", Context.CLIENT); | ||
146 | + public static Packets SPacketDisconnectLogin = new Packets("net/minecraft/network/login/server/SPacketDisconnect", "jq", Context.CLIENT); | ||
147 | + public static Packets CPacketLoginStart = new Packets("net/minecraft/network/login/client/CPacketLoginStart", "js", Context.SERVER); | ||
148 | + public static Packets CPacketEncryptionResponse = new Packets("net/minecraft/network/login/client/CPacketEncryptionResponse", "jt", Context.SERVER); | ||
149 | + public static Packets SPacketPong = new Packets("net/minecraft/network/status/server/SPacketPong", "jx", Context.CLIENT); | ||
150 | + public static Packets SPacketServerInfo = new Packets("net/minecraft/network/status/server/SPacketServerInfo", "jy", Context.CLIENT); | ||
151 | + public static Packets CPacketPing = new Packets("net/minecraft/network/status/client/CPacketPing", "kb", Context.SERVER); | ||
152 | + public static Packets CPacketServerQuery = new Packets("net/minecraft/network/status/client/CPacketServerQuery", "kc", Context.SERVER); | ||
146 | 153 | ||
147 | // CHECKSTYLE:ON | 154 | // CHECKSTYLE:ON |
148 | 155 | ||
149 | public static final Packets[] packets = new Packets[] { | 156 | public static final Packets[] packets = new Packets[] { |
150 | - S08PacketPlayerPosLook, | ||
151 | - S0EPacketSpawnObject, | ||
152 | - S11PacketSpawnExperienceOrb, | ||
153 | - S2CPacketSpawnGlobalEntity, | ||
154 | - S0FPacketSpawnMob, | ||
155 | - S10PacketSpawnPainting, | ||
156 | - S0CPacketSpawnPlayer, | ||
157 | - S0BPacketAnimation, | ||
158 | - S37PacketStatistics, | ||
159 | - S25PacketBlockBreakAnim, | ||
160 | - S35PacketUpdateTileEntity, | ||
161 | - S24PacketBlockAction, | ||
162 | - S23PacketBlockChange, | ||
163 | - S41PacketServerDifficulty, | ||
164 | - S3APacketTabComplete, | ||
165 | - S02PacketChat, | ||
166 | - S22PacketMultiBlockChange, | ||
167 | - S32PacketConfirmTransaction, | ||
168 | - S2EPacketCloseWindow, | ||
169 | - S2DPacketOpenWindow, | ||
170 | - S30PacketWindowItems, | ||
171 | - S31PacketWindowProperty, | ||
172 | - S2FPacketSetSlot, | ||
173 | - S3FPacketCustomPayload, | ||
174 | - S40PacketDisconnect, | ||
175 | - S19PacketEntityStatus, | ||
176 | - S49PacketUpdateEntityNBT, | ||
177 | - S27PacketExplosion, | ||
178 | - S46PacketSetCompressionLevel, | ||
179 | - S2BPacketChangeGameState, | ||
180 | - S00PacketKeepAlive, | ||
181 | - S21PacketChunkData, | ||
182 | - S26PacketMapChunkBulk, | ||
183 | - S28PacketEffect, | ||
184 | - S2APacketParticles, | ||
185 | - S29PacketSoundEffect, | ||
186 | - S01PacketJoinGame, | ||
187 | - S34PacketMaps, | ||
188 | - S14PacketEntity, | 157 | + SPacketSpawnObject, |
158 | + SPacketSpawnExperienceOrb, | ||
159 | + SPacketSpawnGlobalEntity, | ||
160 | + SPacketSpawnMob, | ||
161 | + SPacketSpawnPainting, | ||
162 | + SPacketSpawnPlayer, | ||
163 | + SPacketAnimation, | ||
164 | + SPacketStatistics, | ||
165 | + SPacketBlockBreakAnim, | ||
166 | + SPacketUpdateTileEntity, | ||
167 | + SPacketBlockAction, | ||
168 | + SPacketBlockChange, | ||
169 | + SPacketUpdateEntityNBT, | ||
170 | + SPacketServerDifficulty, | ||
171 | + SPacketTabComplete, | ||
172 | + SPacketChat, | ||
173 | + SPacketMultiBlockChange, | ||
174 | + SPacketConfirmTransaction, | ||
175 | + SPacketCloseWindow, | ||
176 | + SPacketOpenWindow, | ||
177 | + SPacketWindowItems, | ||
178 | + SPacketWindowProperty, | ||
179 | + SPacketSetSlot, | ||
180 | + SPacketCooldown, | ||
181 | + SPacketCustomPayload, | ||
182 | + SPacketCustomSound, | ||
183 | + SPacketDisconnectPlay, | ||
184 | + SPacketEntityStatus, | ||
185 | + SPacketExplosion, | ||
186 | + SPacketUnloadChunk, | ||
187 | + SPacketChangeGameState, | ||
188 | + SPacketKeepAlive, | ||
189 | + SPacketChunkData, | ||
190 | + SPacketEffect, | ||
191 | + SPacketParticles, | ||
192 | + SPacketJoinGame, | ||
193 | + SPacketMaps, | ||
194 | + SPacketEntity, | ||
189 | S15PacketEntityRelMove, | 195 | S15PacketEntityRelMove, |
190 | S17PacketEntityLookMove, | 196 | S17PacketEntityLookMove, |
191 | S16PacketEntityLook, | 197 | S16PacketEntityLook, |
192 | - S36PacketSignEditorOpen, | ||
193 | - S39PacketPlayerAbilities, | ||
194 | - S42PacketCombatEvent, | ||
195 | - S38PacketPlayerListItem, | ||
196 | - S0APacketUseBed, | ||
197 | - S13PacketDestroyEntities, | ||
198 | - S1EPacketRemoveEntityEffect, | ||
199 | - S48PacketResourcePackSend, | ||
200 | - S07PacketRespawn, | ||
201 | - S19PacketEntityHeadLook, | ||
202 | - S44PacketWorldBorder, | ||
203 | - S43PacketCamera, | ||
204 | - S09PacketHeldItemChange, | ||
205 | - S3DPacketDisplayScoreboard, | ||
206 | - S1CPacketEntityMetadata, | ||
207 | - S1BPacketEntityAttach, | ||
208 | - S12PacketEntityVelocity, | ||
209 | - S04PacketEntityEquipment, | ||
210 | - S1FPacketSetExperience, | ||
211 | - S06PacketUpdateHealth, | ||
212 | - S3BPacketScoreboardObjective, | ||
213 | - S3EPacketTeams, | ||
214 | - S3CPacketUpdateScore, | ||
215 | - S05PacketSpawnPosition, | ||
216 | - S03PacketTimeUpdate, | ||
217 | - S45PacketTitle, | ||
218 | - S33PacketUpdateSign, | ||
219 | - S47PacketPlayerListHeaderFooter, | ||
220 | - S0DPacketCollectItem, | ||
221 | - S18PacketEntityTeleport, | ||
222 | - S20PacketEntityProperties, | ||
223 | - S1DPacketEntityEffect, | ||
224 | - C14PacketTabComplete, | ||
225 | - C01PacketChatMessage, | ||
226 | - C16PacketClientStatus, | ||
227 | - C15PacketClientSettings, | ||
228 | - C0FPacketConfirmTransaction, | ||
229 | - C11PacketEnchantItem, | ||
230 | - C0EPacketClickWindow, | ||
231 | - C0DPacketCloseWindow, | ||
232 | - C17PacketCustomPayload, | ||
233 | - C02PacketUseEntity, | ||
234 | - C00PacketKeepAlive, | ||
235 | - C03PacketPlayer, | 198 | + SPacketMoveVehicle, |
199 | + SPacketSignEditorOpen, | ||
200 | + SPacketPlayerAbilities, | ||
201 | + SPacketCombatEvent, | ||
202 | + SPacketPlayerListItem, | ||
203 | + SPacketPlayerPosLook, | ||
204 | + SPacketUseBed, | ||
205 | + SPacketDestroyEntities, | ||
206 | + SPacketRemoveEntityEffect, | ||
207 | + SPacketResourcePackSend, | ||
208 | + SPacketRespawn, | ||
209 | + SPacketEntityHeadLook, | ||
210 | + SPacketWorldBorder, | ||
211 | + SPacketCamera, | ||
212 | + SPacketHeldItemChange, | ||
213 | + SPacketDisplayObjective, | ||
214 | + SPacketEntityMetadata, | ||
215 | + SPacketEntityAttach, | ||
216 | + SPacketEntityVelocity, | ||
217 | + C00Handshake, | ||
218 | + SPacketEntityEquipment, | ||
219 | + SPacketSetExperience, | ||
220 | + SPacketUpdateHealth, | ||
221 | + SPacketScoreboardObjective, | ||
222 | + SPacketSetPassengers, | ||
223 | + SPacketTeams, | ||
224 | + SPacketUpdateScore, | ||
225 | + SPacketSpawnPosition, | ||
226 | + SPacketTimeUpdate, | ||
227 | + SPacketTitle, | ||
228 | + SPacketUpdateSign, | ||
229 | + SPacketSoundEffect, | ||
230 | + SPacketPlayerListHeaderFooter, | ||
231 | + SPacketCollectItem, | ||
232 | + SPacketEntityTeleport, | ||
233 | + SPacketEntityProperties, | ||
234 | + SPacketEntityEffect, | ||
235 | + CPacketConfirmTeleport, | ||
236 | + CPacketTabComplete, | ||
237 | + CPacketChatMessage, | ||
238 | + CPacketClientStatus, | ||
239 | + CPacketClientSettings, | ||
240 | + CPacketConfirmTransaction, | ||
241 | + CPacketEnchantItem, | ||
242 | + CPacketClickWindow, | ||
243 | + CPacketCloseWindow, | ||
244 | + CPacketCustomPayload, | ||
245 | + CPacketUseEntity, | ||
246 | + CPacketKeepAlive, | ||
247 | + CPacketPlayer, | ||
236 | C04PacketPlayerPosition, | 248 | C04PacketPlayerPosition, |
237 | C06PacketPlayerPosLook, | 249 | C06PacketPlayerPosLook, |
238 | C05PacketPlayerLook, | 250 | C05PacketPlayerLook, |
239 | - C13PacketPlayerAbilities, | ||
240 | - C07PacketPlayerDigging, | ||
241 | - C0BPacketEntityAction, | ||
242 | - C0CPacketInput, | ||
243 | - C19PacketResourcePackStatus, | ||
244 | - C09PacketHeldItemChange, | ||
245 | - C10PacketCreativeInventoryAction, | ||
246 | - C12PacketUpdateSign, | ||
247 | - C0APacketAnimation, | ||
248 | - C18PacketSpectate, | ||
249 | - C08PacketPlayerBlockPlacement, | ||
250 | - C00Handshake, | ||
251 | - S02PacketLoginSuccess, | ||
252 | - S01PacketEncryptionRequest, | ||
253 | - S03PacketEnableCompression, | ||
254 | - S00PacketDisconnect, | ||
255 | - C00PacketLoginStart, | ||
256 | - C01PacketEncryptionResponse, | ||
257 | - S01PacketPong, | ||
258 | - S00PacketServerInfo, | ||
259 | - C01PacketPing, | ||
260 | - C00PacketServerQuery, | 251 | + CPacketVehicleMove, |
252 | + CPacketSteerBoat, | ||
253 | + CPacketPlayerAbilities, | ||
254 | + CPacketPlayerDigging, | ||
255 | + CPacketEntityAction, | ||
256 | + CPacketInput, | ||
257 | + CPacketResourcePackStatus, | ||
258 | + CPacketHeldItemChange, | ||
259 | + CPacketCreativeInventoryAction, | ||
260 | + CPacketUpdateSign, | ||
261 | + CPacketAnimation, | ||
262 | + CPacketSpectate, | ||
263 | + CPacketPlayerTryUseItem, | ||
264 | + CPacketPlayerBlockPlacement, | ||
265 | + SPacketLoginSuccess, | ||
266 | + SPacketEncryptionRequest, | ||
267 | + SPacketEnableCompression, | ||
268 | + SPacketDisconnectLogin, | ||
269 | + CPacketLoginStart, | ||
270 | + CPacketEncryptionResponse, | ||
271 | + SPacketPong, | ||
272 | + SPacketServerInfo, | ||
273 | + CPacketPing, | ||
274 | + CPacketServerQuery, | ||
261 | }; | 275 | }; |
262 | 276 | ||
263 | private static int nextPacketIndex; | 277 | private static int nextPacketIndex; |
@@ -270,9 +284,9 @@ public final class Packets extends Obf | @@ -270,9 +284,9 @@ public final class Packets extends Obf | ||
270 | 284 | ||
271 | private Packets(String seargeName, String obfName, Context context) | 285 | private Packets(String seargeName, String obfName, Context context) |
272 | { | 286 | { |
273 | - super(seargeName, obfName); | ||
274 | - | ||
275 | - this.shortName = seargeName.substring(Math.max(seargeName.lastIndexOf('.'), seargeName.lastIndexOf('$')) + 1); | 287 | + super(seargeName.replace('/', '.'), obfName); |
288 | + | ||
289 | + this.shortName = Packets.getShortName(seargeName); | ||
276 | this.index = Packets.nextPacketIndex++; | 290 | this.index = Packets.nextPacketIndex++; |
277 | Packets.packetMap.put(this.shortName, this); | 291 | Packets.packetMap.put(this.shortName, this); |
278 | this.context = context; | 292 | this.context = context; |
@@ -318,4 +332,11 @@ public final class Packets extends Obf | @@ -318,4 +332,11 @@ public final class Packets extends Obf | ||
318 | { | 332 | { |
319 | return Packets.packetMap.get(name); | 333 | return Packets.packetMap.get(name); |
320 | } | 334 | } |
335 | + | ||
336 | + private static String getShortName(String className) | ||
337 | + { | ||
338 | + String simpleName = className.substring(Math.max(className.lastIndexOf('/'), className.lastIndexOf('$')) + 1); | ||
339 | + String baseName = simpleName.replaceAll("^[CS]([0-9A-F]{2})?Packet", ""); | ||
340 | + return baseName + "Packet"; | ||
341 | + } | ||
321 | } | 342 | } |
src/main/java/com/mumfrey/liteloader/launch/LiteLoaderTweaker.java
@@ -33,8 +33,8 @@ public class LiteLoaderTweaker implements ITweaker | @@ -33,8 +33,8 @@ public class LiteLoaderTweaker implements ITweaker | ||
33 | public static final int ENV_TYPE_CLIENT = 0; | 33 | public static final int ENV_TYPE_CLIENT = 0; |
34 | public static final int ENV_TYPE_DEDICATEDSERVER = 1; | 34 | public static final int ENV_TYPE_DEDICATEDSERVER = 1; |
35 | 35 | ||
36 | - // TODO Version - 1.8.9 | ||
37 | - public static final String VERSION = "1.8.9"; | 36 | + // TODO Version - 1.9 |
37 | + public static final String VERSION = "1.9"; | ||
38 | 38 | ||
39 | protected static final String bootstrapClassName = "com.mumfrey.liteloader.core.LiteLoaderBootstrap"; | 39 | protected static final String bootstrapClassName = "com.mumfrey.liteloader.core.LiteLoaderBootstrap"; |
40 | 40 |
src/main/java/com/mumfrey/liteloader/permissions/PermissionsManagerClient.java
@@ -14,7 +14,7 @@ import java.util.TreeSet; | @@ -14,7 +14,7 @@ import java.util.TreeSet; | ||
14 | import net.eq2online.permissions.ReplicatedPermissionsContainer; | 14 | import net.eq2online.permissions.ReplicatedPermissionsContainer; |
15 | import net.minecraft.network.INetHandler; | 15 | import net.minecraft.network.INetHandler; |
16 | import net.minecraft.network.PacketBuffer; | 16 | import net.minecraft.network.PacketBuffer; |
17 | -import net.minecraft.network.play.server.S01PacketJoinGame; | 17 | +import net.minecraft.network.play.server.SPacketJoinGame; |
18 | 18 | ||
19 | import com.mumfrey.liteloader.LiteMod; | 19 | import com.mumfrey.liteloader.LiteMod; |
20 | import com.mumfrey.liteloader.Permissible; | 20 | import com.mumfrey.liteloader.Permissible; |
@@ -185,7 +185,7 @@ public final class PermissionsManagerClient implements PermissionsManager, Plugi | @@ -185,7 +185,7 @@ public final class PermissionsManagerClient implements PermissionsManager, Plugi | ||
185 | this.registeredClientPermissions.put(mod, new TreeSet<String>()); | 185 | this.registeredClientPermissions.put(mod, new TreeSet<String>()); |
186 | } | 186 | } |
187 | 187 | ||
188 | - public void onJoinGame(INetHandler netHandler, S01PacketJoinGame joinGamePacket) | 188 | + public void onJoinGame(INetHandler netHandler, SPacketJoinGame joinGamePacket) |
189 | { | 189 | { |
190 | this.clearServerPermissions(); | 190 | this.clearServerPermissions(); |
191 | this.scheduleRefresh(); | 191 | this.scheduleRefresh(); |
@@ -207,7 +207,9 @@ public final class PermissionsManagerClient implements PermissionsManager, Plugi | @@ -207,7 +207,9 @@ public final class PermissionsManagerClient implements PermissionsManager, Plugi | ||
207 | this.serverPermissions.clear(); | 207 | this.serverPermissions.clear(); |
208 | 208 | ||
209 | for (Permissible permissible : this.permissibles) | 209 | for (Permissible permissible : this.permissibles) |
210 | + { | ||
210 | permissible.onPermissionsCleared(this); | 211 | permissible.onPermissionsCleared(this); |
212 | + } | ||
211 | } | 213 | } |
212 | 214 | ||
213 | /** | 215 | /** |
@@ -216,7 +218,9 @@ public final class PermissionsManagerClient implements PermissionsManager, Plugi | @@ -216,7 +218,9 @@ public final class PermissionsManagerClient implements PermissionsManager, Plugi | ||
216 | protected void sendPermissionQueries() | 218 | protected void sendPermissionQueries() |
217 | { | 219 | { |
218 | for (Permissible mod : this.registeredClientMods.values()) | 220 | for (Permissible mod : this.registeredClientMods.values()) |
221 | + { | ||
219 | this.sendPermissionQuery(mod); | 222 | this.sendPermissionQuery(mod); |
223 | + } | ||
220 | } | 224 | } |
221 | 225 | ||
222 | /** | 226 | /** |
src/main/java/com/mumfrey/liteloader/transformers/event/EventTransformer.java
@@ -27,7 +27,6 @@ import com.mumfrey.liteloader.transformers.ClassTransformer; | @@ -27,7 +27,6 @@ import com.mumfrey.liteloader.transformers.ClassTransformer; | ||
27 | import com.mumfrey.liteloader.transformers.ObfProvider; | 27 | import com.mumfrey.liteloader.transformers.ObfProvider; |
28 | import com.mumfrey.liteloader.transformers.access.AccessorTransformer; | 28 | import com.mumfrey.liteloader.transformers.access.AccessorTransformer; |
29 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; | 29 | import com.mumfrey.liteloader.util.log.LiteLoaderLogger; |
30 | -import com.mumfrey.liteloader.util.log.LiteLoaderLogger.Verbosity; | ||
31 | 30 | ||
32 | /** | 31 | /** |
33 | * EventTransformer is the spiritual successor to the | 32 | * EventTransformer is the spiritual successor to the |
@@ -379,8 +378,7 @@ public final class EventTransformer extends ClassTransformer | @@ -379,8 +378,7 @@ public final class EventTransformer extends ClassTransformer | ||
379 | { | 378 | { |
380 | Event head = injection.getHead(); | 379 | Event head = injection.getHead(); |
381 | 380 | ||
382 | - Verbosity verbosity = head.isVerbose() ? Verbosity.NORMAL : Verbosity.VERBOSE; | ||
383 | - LiteLoaderLogger.info(verbosity, "Injecting %s[x%d] in %s in %s", head.getName(), injection.size(), method.name, | 381 | + LiteLoaderLogger.debug("Injecting %s[x%d] in %s in %s", head.getName(), injection.size(), method.name, |
384 | ClassTransformer.getSimpleClassName(classNode)); | 382 | ClassTransformer.getSimpleClassName(classNode)); |
385 | 383 | ||
386 | MethodNode handler = head.inject(injectionPoint, injection.isCancellable(), this.globalEventID, injection.captureLocals(), | 384 | MethodNode handler = head.inject(injectionPoint, injection.isCancellable(), this.globalEventID, injection.captureLocals(), |
src/main/java/com/mumfrey/liteloader/util/ChatUtilities.java
@@ -2,10 +2,10 @@ package com.mumfrey.liteloader.util; | @@ -2,10 +2,10 @@ package com.mumfrey.liteloader.util; | ||
2 | 2 | ||
3 | import java.util.List; | 3 | import java.util.List; |
4 | 4 | ||
5 | -import net.minecraft.util.ChatComponentText; | ||
6 | -import net.minecraft.util.ChatStyle; | ||
7 | -import net.minecraft.util.EnumChatFormatting; | ||
8 | -import net.minecraft.util.IChatComponent; | 5 | +import net.minecraft.util.text.ITextComponent; |
6 | +import net.minecraft.util.text.Style; | ||
7 | +import net.minecraft.util.text.TextComponentString; | ||
8 | +import net.minecraft.util.text.TextFormatting; | ||
9 | 9 | ||
10 | /** | 10 | /** |
11 | * Utility functions for chat | 11 | * Utility functions for chat |
@@ -20,7 +20,7 @@ public abstract class ChatUtilities | @@ -20,7 +20,7 @@ public abstract class ChatUtilities | ||
20 | { | 20 | { |
21 | StringBuilder formattingCodes = new StringBuilder(); | 21 | StringBuilder formattingCodes = new StringBuilder(); |
22 | 22 | ||
23 | - for (EnumChatFormatting chatFormat : EnumChatFormatting.values()) | 23 | + for (TextFormatting chatFormat : TextFormatting.values()) |
24 | { | 24 | { |
25 | formattingCodes.append(chatFormat.toString().charAt(1)); | 25 | formattingCodes.append(chatFormat.toString().charAt(1)); |
26 | } | 26 | } |
@@ -36,13 +36,13 @@ public abstract class ChatUtilities | @@ -36,13 +36,13 @@ public abstract class ChatUtilities | ||
36 | * @param code Code | 36 | * @param code Code |
37 | * @return chat style | 37 | * @return chat style |
38 | */ | 38 | */ |
39 | - public static ChatStyle getChatStyleFromCode(char code) | 39 | + public static Style getChatStyleFromCode(char code) |
40 | { | 40 | { |
41 | int pos = ChatUtilities.formattingCodeLookup.indexOf(code); | 41 | int pos = ChatUtilities.formattingCodeLookup.indexOf(code); |
42 | if (pos < 0) return null; | 42 | if (pos < 0) return null; |
43 | - EnumChatFormatting format = EnumChatFormatting.values()[pos]; | 43 | + TextFormatting format = TextFormatting.values()[pos]; |
44 | 44 | ||
45 | - ChatStyle style = new ChatStyle(); | 45 | + Style style = new Style(); |
46 | if (format.isColor()) | 46 | if (format.isColor()) |
47 | { | 47 | { |
48 | style.setColor(format); | 48 | style.setColor(format); |
@@ -67,12 +67,12 @@ public abstract class ChatUtilities | @@ -67,12 +67,12 @@ public abstract class ChatUtilities | ||
67 | * Convert a component containing text formatted with legacy codes to a | 67 | * Convert a component containing text formatted with legacy codes to a |
68 | * native ChatComponent structure. | 68 | * native ChatComponent structure. |
69 | */ | 69 | */ |
70 | - public static IChatComponent convertLegacyCodes(IChatComponent chat) | 70 | + public static ITextComponent convertLegacyCodes(ITextComponent chat) |
71 | { | 71 | { |
72 | return ChatUtilities.covertCodesInPlace(chat); | 72 | return ChatUtilities.covertCodesInPlace(chat); |
73 | } | 73 | } |
74 | 74 | ||
75 | - private static List<IChatComponent> covertCodesInPlace(List<IChatComponent> siblings) | 75 | + private static List<ITextComponent> covertCodesInPlace(List<ITextComponent> siblings) |
76 | { | 76 | { |
77 | for (int index = 0; index < siblings.size(); index++) | 77 | for (int index = 0; index < siblings.size(); index++) |
78 | { | 78 | { |
@@ -82,21 +82,21 @@ public abstract class ChatUtilities | @@ -82,21 +82,21 @@ public abstract class ChatUtilities | ||
82 | return siblings; | 82 | return siblings; |
83 | } | 83 | } |
84 | 84 | ||
85 | - private static IChatComponent covertCodesInPlace(IChatComponent component) | 85 | + private static ITextComponent covertCodesInPlace(ITextComponent component) |
86 | { | 86 | { |
87 | - IChatComponent newComponent = null; | ||
88 | - if (component instanceof ChatComponentText) | 87 | + ITextComponent newComponent = null; |
88 | + if (component instanceof TextComponentString) | ||
89 | { | 89 | { |
90 | - ChatComponentText textComponent = (ChatComponentText)component; | ||
91 | - ChatStyle style = textComponent.getChatStyle(); | ||
92 | - String text = textComponent.getChatComponentText_TextValue(); | 90 | + TextComponentString textComponent = (TextComponentString)component; |
91 | + Style style = textComponent.getStyle(); | ||
92 | + String text = textComponent.getFormattedText(); | ||
93 | 93 | ||
94 | int pos = text.indexOf('\247'); | 94 | int pos = text.indexOf('\247'); |
95 | while (pos > -1 && text != null) | 95 | while (pos > -1 && text != null) |
96 | { | 96 | { |
97 | if (pos < text.length() - 1) | 97 | if (pos < text.length() - 1) |
98 | { | 98 | { |
99 | - IChatComponent head = new ChatComponentText(pos > 0 ? text.substring(0, pos) : "").setChatStyle(style); | 99 | + ITextComponent head = new TextComponentString(pos > 0 ? text.substring(0, pos) : "").setStyle(style); |
100 | style = ChatUtilities.getChatStyleFromCode(text.charAt(pos + 1)); | 100 | style = ChatUtilities.getChatStyleFromCode(text.charAt(pos + 1)); |
101 | text = text.substring(pos + 2); | 101 | text = text.substring(pos + 2); |
102 | newComponent = (newComponent == null) ? head : newComponent.appendSibling(head); | 102 | newComponent = (newComponent == null) ? head : newComponent.appendSibling(head); |
@@ -110,7 +110,7 @@ public abstract class ChatUtilities | @@ -110,7 +110,7 @@ public abstract class ChatUtilities | ||
110 | 110 | ||
111 | if (text != null) | 111 | if (text != null) |
112 | { | 112 | { |
113 | - IChatComponent tail = new ChatComponentText(text).setChatStyle(style); | 113 | + ITextComponent tail = new TextComponentString(text).setStyle(style); |
114 | newComponent = (newComponent == null) ? tail : newComponent.appendSibling(tail); | 114 | newComponent = (newComponent == null) ? tail : newComponent.appendSibling(tail); |
115 | } | 115 | } |
116 | } | 116 | } |
@@ -121,7 +121,7 @@ public abstract class ChatUtilities | @@ -121,7 +121,7 @@ public abstract class ChatUtilities | ||
121 | return component; | 121 | return component; |
122 | } | 122 | } |
123 | 123 | ||
124 | - for (IChatComponent oldSibling : ChatUtilities.covertCodesInPlace((List<IChatComponent>)component.getSiblings())) | 124 | + for (ITextComponent oldSibling : ChatUtilities.covertCodesInPlace((List<ITextComponent>)component.getSiblings())) |
125 | { | 125 | { |
126 | newComponent.appendSibling(oldSibling); | 126 | newComponent.appendSibling(oldSibling); |
127 | } | 127 | } |
src/main/java/com/mumfrey/liteloader/util/EntityUtilities.java
1 | package com.mumfrey.liteloader.util; | 1 | package com.mumfrey.liteloader.util; |
2 | 2 | ||
3 | import net.minecraft.entity.Entity; | 3 | import net.minecraft.entity.Entity; |
4 | -import net.minecraft.util.MovingObjectPosition; | ||
5 | -import net.minecraft.util.Vec3; | 4 | +import net.minecraft.util.math.RayTraceResult; |
5 | +import net.minecraft.util.math.Vec3d; | ||
6 | 6 | ||
7 | public abstract class EntityUtilities | 7 | public abstract class EntityUtilities |
8 | { | 8 | { |
9 | - public static MovingObjectPosition rayTraceFromEntity(Entity entity, double traceDistance, float partialTicks) | 9 | + public static RayTraceResult rayTraceFromEntity(Entity entity, double traceDistance, float partialTicks) |
10 | { | 10 | { |
11 | - Vec3 var4 = EntityUtilities.getPositionEyes(entity, partialTicks); | ||
12 | - Vec3 var5 = entity.getLook(partialTicks); | ||
13 | - Vec3 var6 = var4.addVector(var5.xCoord * traceDistance, var5.yCoord * traceDistance, var5.zCoord * traceDistance); | 11 | + Vec3d var4 = EntityUtilities.getPositionEyes(entity, partialTicks); |
12 | + Vec3d var5 = entity.getLook(partialTicks); | ||
13 | + Vec3d var6 = var4.addVector(var5.xCoord * traceDistance, var5.yCoord * traceDistance, var5.zCoord * traceDistance); | ||
14 | return entity.worldObj.rayTraceBlocks(var4, var6, false, false, true); | 14 | return entity.worldObj.rayTraceBlocks(var4, var6, false, false, true); |
15 | } | 15 | } |
16 | 16 | ||
17 | - public static Vec3 getPositionEyes(Entity entity, float partialTicks) | 17 | + public static Vec3d getPositionEyes(Entity entity, float partialTicks) |
18 | { | 18 | { |
19 | if (partialTicks == 1.0F) | 19 | if (partialTicks == 1.0F) |
20 | { | 20 | { |
21 | - return new Vec3(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ); | 21 | + return new Vec3d(entity.posX, entity.posY + entity.getEyeHeight(), entity.posZ); |
22 | } | 22 | } |
23 | 23 | ||
24 | double interpX = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks; | 24 | double interpX = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks; |
25 | double interpY = entity.prevPosY + (entity.posY - entity.prevPosY) * partialTicks + entity.getEyeHeight(); | 25 | double interpY = entity.prevPosY + (entity.posY - entity.prevPosY) * partialTicks + entity.getEyeHeight(); |
26 | double interpZ = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks; | 26 | double interpZ = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks; |
27 | - return new Vec3(interpX, interpY, interpZ); | 27 | + return new Vec3d(interpX, interpY, interpZ); |
28 | } | 28 | } |
29 | } | 29 | } |
src/main/java/com/mumfrey/liteloader/util/Input.java
@@ -2,7 +2,7 @@ package com.mumfrey.liteloader.util; | @@ -2,7 +2,7 @@ package com.mumfrey.liteloader.util; | ||
2 | 2 | ||
3 | import net.minecraft.client.settings.KeyBinding; | 3 | import net.minecraft.client.settings.KeyBinding; |
4 | import net.minecraft.network.INetHandler; | 4 | import net.minecraft.network.INetHandler; |
5 | -import net.minecraft.network.play.server.S01PacketJoinGame; | 5 | +import net.minecraft.network.play.server.SPacketJoinGame; |
6 | import net.minecraft.world.World; | 6 | import net.minecraft.world.World; |
7 | 7 | ||
8 | import com.mumfrey.liteloader.api.CoreProvider; | 8 | import com.mumfrey.liteloader.api.CoreProvider; |
@@ -77,7 +77,7 @@ public abstract class Input implements CoreProvider | @@ -77,7 +77,7 @@ public abstract class Input implements CoreProvider | ||
77 | } | 77 | } |
78 | 78 | ||
79 | @Override | 79 | @Override |
80 | - public void onJoinGame(INetHandler netHandler, S01PacketJoinGame loginPacket) | 80 | + public void onJoinGame(INetHandler netHandler, SPacketJoinGame loginPacket) |
81 | { | 81 | { |
82 | } | 82 | } |
83 | 83 |
src/main/java/com/mumfrey/liteloader/util/ObfuscationUtilities.java
@@ -3,7 +3,7 @@ package com.mumfrey.liteloader.util; | @@ -3,7 +3,7 @@ package com.mumfrey.liteloader.util; | ||
3 | import net.minecraft.launchwrapper.IClassTransformer; | 3 | import net.minecraft.launchwrapper.IClassTransformer; |
4 | import net.minecraft.launchwrapper.Launch; | 4 | import net.minecraft.launchwrapper.Launch; |
5 | import net.minecraft.server.MinecraftServer; | 5 | import net.minecraft.server.MinecraftServer; |
6 | -import net.minecraft.util.BlockPos; | 6 | +import net.minecraft.util.math.BlockPos; |
7 | 7 | ||
8 | import com.mumfrey.liteloader.core.runtime.Obf; | 8 | import com.mumfrey.liteloader.core.runtime.Obf; |
9 | 9 |
src/main/java/com/mumfrey/liteloader/util/Position.java
1 | package com.mumfrey.liteloader.util; | 1 | package com.mumfrey.liteloader.util; |
2 | 2 | ||
3 | import net.minecraft.entity.Entity; | 3 | import net.minecraft.entity.Entity; |
4 | -import net.minecraft.util.Vec3; | 4 | +import net.minecraft.util.math.Vec3d; |
5 | 5 | ||
6 | /** | 6 | /** |
7 | * A 3D vector position with rotation as well | 7 | * A 3D vector position with rotation as well |
8 | * | 8 | * |
9 | * @author Adam Mummery-Smith | 9 | * @author Adam Mummery-Smith |
10 | */ | 10 | */ |
11 | -public class Position extends Vec3 | 11 | +public class Position extends Vec3d |
12 | { | 12 | { |
13 | public final float yaw; | 13 | public final float yaw; |
14 | 14 |
src/main/resources/mixins.liteloader.core.json
@@ -5,9 +5,9 @@ | @@ -5,9 +5,9 @@ | ||
5 | "refmap": "mixins.liteloader.core.refmap.json", | 5 | "refmap": "mixins.liteloader.core.refmap.json", |
6 | "mixins": [ | 6 | "mixins": [ |
7 | "MixinMinecraftServer", | 7 | "MixinMinecraftServer", |
8 | - "MixinServerConfigurationManager", | 8 | + "MixinPlayerList", |
9 | "MixinNetHandlerPlayServer", | 9 | "MixinNetHandlerPlayServer", |
10 | - "MixinItemInWorldManager", | 10 | + "MixinPlayerInteractionManager", |
11 | "MixinC15PacketClientSettings", | 11 | "MixinC15PacketClientSettings", |
12 | "MixinS02PacketChat" | 12 | "MixinS02PacketChat" |
13 | ], | 13 | ], |