File tree Expand file tree Collapse file tree 4 files changed +62
-0
lines changed
java/com/ishland/c2me/base Expand file tree Collapse file tree 4 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .ishland .c2me .base .common .theinterface ;
2+
3+ public interface PlayerEntityExtension {
4+
5+ void c2me$onForcedLoaded ();
6+
7+ }
Original file line number Diff line number Diff line change 1+ package com .ishland .c2me .base .mixin .client_movement ;
2+
3+ import com .ishland .c2me .base .common .theinterface .PlayerEntityExtension ;
4+ import net .minecraft .client .network .ClientPlayNetworkHandler ;
5+ import net .minecraft .client .network .ClientPlayerEntity ;
6+ import net .minecraft .network .packet .c2s .play .PlayerLoadedC2SPacket ;
7+ import org .spongepowered .asm .mixin .Final ;
8+ import org .spongepowered .asm .mixin .Mixin ;
9+ import org .spongepowered .asm .mixin .Shadow ;
10+
11+ @ Mixin (ClientPlayerEntity .class )
12+ public class MixinClientPlayerEntity implements PlayerEntityExtension {
13+
14+ @ Shadow @ Final public ClientPlayNetworkHandler networkHandler ;
15+
16+ @ Override
17+ public void c2me$onForcedLoaded () {
18+ this .networkHandler .sendPacket (new PlayerLoadedC2SPacket ());
19+ }
20+
21+ }
Original file line number Diff line number Diff line change 1+ package com .ishland .c2me .base .mixin .client_movement ;
2+
3+ import com .ishland .c2me .base .common .theinterface .PlayerEntityExtension ;
4+ import net .minecraft .entity .player .PlayerEntity ;
5+ import org .spongepowered .asm .mixin .Mixin ;
6+ import org .spongepowered .asm .mixin .Shadow ;
7+ import org .spongepowered .asm .mixin .injection .At ;
8+ import org .spongepowered .asm .mixin .injection .Inject ;
9+ import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
10+
11+ @ Mixin (PlayerEntity .class )
12+ public class MixinPlayerEntity implements PlayerEntityExtension {
13+
14+ @ Shadow private boolean loaded ;
15+
16+ @ Shadow protected int remainingLoadTicks ;
17+
18+ @ Override
19+ public void c2me$onForcedLoaded () {
20+ // no-op, intended to be overridden
21+ }
22+
23+ @ Inject (method = "tickLoaded" , at = @ At ("RETURN" ))
24+ private void onForcedLoaded (CallbackInfo ci ) {
25+ if (!this .loaded && this .remainingLoadTicks == 0 ) {
26+ this .c2me$onForcedLoaded ();
27+ }
28+ }
29+
30+ }
Original file line number Diff line number Diff line change 5151 " access.IXoroshiro128PlusPlusRandom" ,
5252 " access.IXoroshiro128PlusPlusRandomDeriver" ,
5353 " access.IXoroshiro128PlusPlusRandomImpl" ,
54+ " client_movement.MixinPlayerEntity" ,
5455 " instrumentation.MixinServerChunkManager" ,
5556 " report.MixinDedicatedServerWatchdog" ,
5657 " scheduler.MixinThreadedAnvilChunkStorage" ,
5758 " theinterface.MixinStorageIoWorker" ,
5859 " util.log4j2shutdownhookisnomore.MixinMain" ,
5960 " util.log4j2shutdownhookisnomore.MixinMinecraftDedicatedServer"
61+ ],
62+ "client" : [
63+ " client_movement.MixinClientPlayerEntity"
6064 ]
6165}
You can’t perform that action at this time.
0 commit comments