Skip to content

Commit

Permalink
πŸ€“πŸ€“πŸ€“
Browse files Browse the repository at this point in the history
  • Loading branch information
Leclowndu93150 committed Jul 18, 2024
1 parent cb5ffde commit 973cdf0
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,18 @@ public static void clientTick(ClientTickEvent.Post event) {
Minecraft mc = Minecraft.getInstance();
Options opt = mc.options;
Player player = mc.player;
Optional<SlotResult> slotResult = CuriosApi.getCuriosInventory(player).flatMap(handler -> handler.findFirstCurio(ItemRegistry.ANGEL_RING.get()));
if (mc.level != null) {
if (mc.level.isClientSide()) {
CompoundTag persistentData = player.getPersistentData();
if (opt.keyUp.isDown() || opt.keyDown.isDown() || opt.keyLeft.isDown() || opt.keyRight.isDown()) {
PacketDistributor.sendToServer(new NoKeyPressedPayload(false));
persistentData.putBoolean(PayloadActions.NO_KEYS_PRESSED, false);
} else {
PacketDistributor.sendToServer(new NoKeyPressedPayload(true));
persistentData.putBoolean(PayloadActions.NO_KEYS_PRESSED, true);
if (slotResult.isPresent() && slotResult.get().stack().has(DataComponentRegistry.INERTIA_MODIFIER)){
CompoundTag persistentData = player.getPersistentData();
if (opt.keyUp.isDown() || opt.keyDown.isDown() || opt.keyLeft.isDown() || opt.keyRight.isDown()) {
PacketDistributor.sendToServer(new NoKeyPressedPayload(false));
persistentData.putBoolean(PayloadActions.NO_KEYS_PRESSED, false);
} else {
PacketDistributor.sendToServer(new NoKeyPressedPayload(true));
persistentData.putBoolean(PayloadActions.NO_KEYS_PRESSED, true);
}
}
}
}
Expand Down

0 comments on commit 973cdf0

Please sign in to comment.