mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 03:43:30 +01:00
parent
16582e6d25
commit
3ae1246ec6
2 changed files with 20 additions and 16 deletions
|
@ -42,8 +42,11 @@ public class PacketClient implements CustomPacketPayload {
|
|||
return PacketClient.ID;
|
||||
}
|
||||
|
||||
@SuppressWarnings("Convert2Lambda")
|
||||
public static void onMessage(PacketClient message, PlayPayloadContext ctx) {
|
||||
ctx.workHandler().execute(() -> {
|
||||
ctx.workHandler().execute(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
var mc = Minecraft.getInstance();
|
||||
if (mc.level != null) {
|
||||
switch (message.type) {
|
||||
|
@ -60,6 +63,7 @@ public class PacketClient implements CustomPacketPayload {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ public class PacketParticles implements CustomPacketPayload {
|
|||
|
||||
public static void onMessage(PacketParticles message, PlayPayloadContext ctx) {
|
||||
ctx.workHandler().execute(() -> {
|
||||
Level level = Minecraft.getInstance().level;
|
||||
var level = ctx.level().orElseThrow();
|
||||
if (level != null)
|
||||
message.type.action.accept(message, level);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue