1
1
package org .samo_lego .healthcare .mixin ;
2
2
3
- import io .netty .util .concurrent .Future ;
4
- import io .netty .util .concurrent .GenericFutureListener ;
5
3
import net .minecraft .core .Registry ;
6
- import net .minecraft .network .Connection ;
4
+ import net .minecraft .network .PacketSendListener ;
7
5
import net .minecraft .network .chat .Component ;
8
6
import net .minecraft .network .chat .MutableComponent ;
9
7
import net .minecraft .network .protocol .Packet ;
16
14
import net .minecraft .world .entity .player .Player ;
17
15
import org .jetbrains .annotations .Nullable ;
18
16
import org .samo_lego .healthcare .healthbar .HealthbarPreferences ;
19
- import org .spongepowered .asm .mixin .Final ;
20
17
import org .spongepowered .asm .mixin .Mixin ;
21
18
import org .spongepowered .asm .mixin .Shadow ;
22
19
import org .spongepowered .asm .mixin .Unique ;
@@ -36,15 +33,11 @@ public abstract class ServerPlayNetworkHandlerMixin_HealthTag {
36
33
public ServerPlayer player ;
37
34
38
35
@ Shadow
39
- @ Final
40
- public Connection connection ;
36
+ public abstract void send (Packet <?> packet , @ Nullable PacketSendListener packetSendListener );
41
37
42
38
@ Unique
43
39
private boolean hc_skipCheck ;
44
40
45
- @ Shadow
46
- public abstract void send (Packet <?> packet , @ Nullable GenericFutureListener <? extends Future <? super Void >> genericFutureListener );
47
-
48
41
/**
49
42
* Dummy handler used for creating modified
50
43
* packets with health.
@@ -65,14 +58,14 @@ public abstract class ServerPlayNetworkHandlerMixin_HealthTag {
65
58
* @param ci
66
59
*/
67
60
@ Inject (
68
- method = "send(Lnet/minecraft/network/protocol/Packet;Lio/netty/util/concurrent/GenericFutureListener ;)V" ,
61
+ method = "send(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/PacketSendListener ;)V" ,
69
62
at = @ At (
70
63
value = "INVOKE" ,
71
- target = "Lnet/minecraft/network/Connection;send(Lnet/minecraft/network/protocol/Packet;Lio/netty/util/concurrent/GenericFutureListener ;)V"
64
+ target = "Lnet/minecraft/network/Connection;send(Lnet/minecraft/network/protocol/Packet;Lnet/minecraft/network/PacketSendListener ;)V"
72
65
),
73
66
cancellable = true
74
67
)
75
- private void onPacketSend (Packet <?> packet , GenericFutureListener <? extends Future <? super Void >> listener , CallbackInfo ci ) {
68
+ private void onPacketSend (Packet <?> packet , PacketSendListener listener , CallbackInfo ci ) {
76
69
if (packet instanceof ClientboundSetEntityDataPacket && !this .hc_skipCheck ) {
77
70
int id = ((EntityTrackerUpdateS2CPacketAccessor ) packet ).getId ();
78
71
Entity entity = this .player .getLevel ().getEntity (id );
0 commit comments