Skip to content

Commit

Permalink
consistent naming for contextSupplier
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamDman committed Jun 25, 2024
1 parent 007bafc commit d5077db
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public static ServerboundLabelGunClearPacket decode(
}

public static void handle(
ServerboundLabelGunClearPacket msg, Supplier<NetworkEvent.Context> ctx
ServerboundLabelGunClearPacket msg, Supplier<NetworkEvent.Context> contextSupplier
) {
ctx.get().enqueueWork(() -> {
var sender = ctx.get().getSender();
contextSupplier.get().enqueueWork(() -> {
var sender = contextSupplier.get().getSender();
if (sender == null) {
return;
}
Expand All @@ -34,6 +34,6 @@ public static void handle(
LabelPositionHolder.empty().save(stack);
}
});
ctx.get().setPacketHandled(true);
contextSupplier.get().setPacketHandled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public static ServerboundLabelGunPrunePacket decode(
}

public static void handle(
ServerboundLabelGunPrunePacket msg, Supplier<NetworkEvent.Context> ctx
ServerboundLabelGunPrunePacket msg, Supplier<NetworkEvent.Context> contextSupplier
) {
ctx.get().enqueueWork(() -> {
var sender = ctx.get().getSender();
contextSupplier.get().enqueueWork(() -> {
var sender = contextSupplier.get().getSender();
if (sender == null) {
return;
}
Expand All @@ -34,6 +34,6 @@ public static void handle(
LabelPositionHolder.from(stack).prune().save(stack);
}
});
ctx.get().setPacketHandled(true);
contextSupplier.get().setPacketHandled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public static ca.teamdman.sfm.common.net.ServerboundLabelGunUpdatePacket decode(
}

public static void handle(
ca.teamdman.sfm.common.net.ServerboundLabelGunUpdatePacket msg, Supplier<NetworkEvent.Context> ctx
ca.teamdman.sfm.common.net.ServerboundLabelGunUpdatePacket msg, Supplier<NetworkEvent.Context> contextSupplier
) {
ctx.get().enqueueWork(() -> {
var sender = ctx.get().getSender();
contextSupplier.get().enqueueWork(() -> {
var sender = contextSupplier.get().getSender();
if (sender == null) {
return;
}
Expand All @@ -37,6 +37,6 @@ public static void handle(
LabelGunItem.setActiveLabel(stack, msg.label);
}
});
ctx.get().setPacketHandled(true);
contextSupplier.get().setPacketHandled(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public static ServerboundLabelGunUsePacket decode(
}

public static void handle(
ServerboundLabelGunUsePacket msg, Supplier<NetworkEvent.Context> ctx
ServerboundLabelGunUsePacket msg, Supplier<NetworkEvent.Context> contextSupplier
) {
ctx.get().enqueueWork(() -> {
var sender = ctx.get().getSender();
contextSupplier.get().enqueueWork(() -> {
var sender = contextSupplier.get().getSender();
if (sender == null) {
return;
}
Expand Down Expand Up @@ -145,6 +145,6 @@ public static void handle(
// write changes to label gun stack
gunLabels.save(stack);
});
ctx.get().setPacketHandled(true);
contextSupplier.get().setPacketHandled(true);
}
}

0 comments on commit d5077db

Please sign in to comment.