From 56e39bc0725143902835ae7234d99cbb47fd231d Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Wed, 14 Jun 2023 17:52:28 -0700 Subject: [PATCH] Re-add dropped patch during 1.20 update (#9344) --- ...apLike-spam-for-missing-key-selector.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 patches/server/fix-MapLike-spam-for-missing-key-selector.patch diff --git a/patches/server/fix-MapLike-spam-for-missing-key-selector.patch b/patches/server/fix-MapLike-spam-for-missing-key-selector.patch new file mode 100644 index 0000000000..34b6b8addc --- /dev/null +++ b/patches/server/fix-MapLike-spam-for-missing-key-selector.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Wed, 14 Jun 2023 13:17:40 -0700 +Subject: [PATCH] fix MapLike spam for missing key 'selector' + + +diff --git a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java ++++ b/src/main/java/net/minecraft/world/level/gameevent/vibrations/VibrationSystem.java +@@ -0,0 +0,0 @@ public interface VibrationSystem { + public static Codec CODEC = RecordCodecBuilder.create((instance) -> { + return instance.group(VibrationInfo.CODEC.optionalFieldOf("event").forGetter((vibrationsystem_a) -> { + return Optional.ofNullable(vibrationsystem_a.currentVibration); +- }), VibrationSelector.CODEC.fieldOf("selector").forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { ++ }), Codec.optionalField("selector", VibrationSelector.CODEC).xmap(o -> o.orElseGet(VibrationSelector::new), Optional::of).forGetter(VibrationSystem.Data::getSelectionStrategy), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("event_delay").orElse(0).forGetter(VibrationSystem.Data::getTravelTimeInTicks)).apply(instance, (optional, vibrationselector, integer) -> { // Paper - fix MapLike spam for missing "selector" in 1.19.2 + return new VibrationSystem.Data((VibrationInfo) optional.orElse(null), vibrationselector, integer, true); // CraftBukkit - decompile error + }); + });