From 719a5f19837064a0e58b4b1999cdbb309b7b47ac Mon Sep 17 00:00:00 2001 From: ktpatient <167013520+ktpatient@users.noreply.github.com> Date: Sun, 8 Sep 2024 22:09:14 +0100 Subject: [PATCH] SetPlayer Data in packet --- .../portingdeadmods/modjam/content/augments/AugmentHelper.java | 2 +- .../java/com/portingdeadmods/modjam/network/PayloadActions.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/portingdeadmods/modjam/content/augments/AugmentHelper.java b/src/main/java/com/portingdeadmods/modjam/content/augments/AugmentHelper.java index 787aaebe..c38089d5 100644 --- a/src/main/java/com/portingdeadmods/modjam/content/augments/AugmentHelper.java +++ b/src/main/java/com/portingdeadmods/modjam/content/augments/AugmentHelper.java @@ -25,7 +25,7 @@ public static StaticAugment getAugment(Player player, Slot slot){ int id = getId(player, slot); return augmentHashMap.get(id); } - private static Supplier> getAttachment(Slot slot){ + public static Supplier> getAttachment(Slot slot){ switch (slot){ case HEAD -> { return MJDataAttachments.HEAD_AUGMENTATION; diff --git a/src/main/java/com/portingdeadmods/modjam/network/PayloadActions.java b/src/main/java/com/portingdeadmods/modjam/network/PayloadActions.java index 589db2ff..54d6614a 100644 --- a/src/main/java/com/portingdeadmods/modjam/network/PayloadActions.java +++ b/src/main/java/com/portingdeadmods/modjam/network/PayloadActions.java @@ -24,6 +24,7 @@ public static void keyPressedAction(KeyPressedPayload payload, IPayloadContext c public static void setAugmentDataAction(SetAugmentDataPayload payload, IPayloadContext context){ context.enqueueWork(()->{ // Whoops, recursive packets bring sent + context.player().setData(AugmentHelper.getAttachment(Slot.GetValue(payload.slot())), payload.augmentId()); // AugmentHelper.setId(context.player(), Slot.GetValue(payload.slot()), payload.augmentId()); ModJam.LOGGER.info("Syncing data {}", payload.slot()); });