From 486e5211054391c8672f0325a27d3cf9eb5bf0cb Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Sun, 5 Jan 2025 10:07:35 -0800 Subject: [PATCH] Re-add droped MapLike spam fix (#11917) --- .../gameevent/vibrations/VibrationSystem.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paper-server/patches/sources/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch b/paper-server/patches/sources/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch index 36b61e1dd6..a69e5d7e94 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java +++ b/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java +@@ -123,7 +_,7 @@ + public static Codec CODEC = RecordCodecBuilder.create( + instance -> instance.group( + VibrationInfo.CODEC.lenientOptionalFieldOf("event").forGetter(data -> Optional.ofNullable(data.currentVibration)), +- VibrationSelector.CODEC.fieldOf("selector").forGetter(VibrationSystem.Data::getSelectionStrategy), ++ VibrationSelector.CODEC.optionalFieldOf("selector").xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), // Paper - fix MapLike spam for missing "selector" in 1.19.2 + ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks) + ) + .apply( @@ -214,7 +_,14 @@ return false; } else {