diff --git a/patches/server/0014-Fixes-crash-exploit-related-to-out-of-bounds-Axolotl.patch b/patches/server/0014-Fixes-crash-exploit-related-to-out-of-bounds-Axolotl.patch new file mode 100644 index 0000000..bba6256 --- /dev/null +++ b/patches/server/0014-Fixes-crash-exploit-related-to-out-of-bounds-Axolotl.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Video +Date: Sun, 20 Mar 2022 04:39:09 -0600 +Subject: [PATCH] Fixes crash exploit related to out of bounds Axolotl variants + + +diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +index 2b8725087fd3bfeca7162bda2783fdacd13a8390..802c9c87df190dce09f9e703cedcb06874c58389 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java ++++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +@@ -118,7 +118,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable { + @Override + public void readAdditionalSaveData(CompoundTag nbt) { + super.readAdditionalSaveData(nbt); +- this.setVariant(Axolotl.Variant.BY_ID[nbt.getInt("Variant")]); ++ this.setVariant(Axolotl.Variant.BY_ID[Math.min(Math.abs(nbt.getInt("Variant")), 4)]); // Scissors - Fixes out of bounds Axolotl variant exploit + this.setFromBucket(nbt.getBoolean("FromBucket")); + } + +@@ -361,7 +361,7 @@ public class Axolotl extends Animal implements LerpingModel, Bucketable { + @Override + public void loadFromBucketTag(CompoundTag nbt) { + Bucketable.loadDefaultDataFromBucketTag(this, nbt); +- this.setVariant(Axolotl.Variant.BY_ID[nbt.getInt("Variant")]); ++ this.setVariant(Axolotl.Variant.BY_ID[Math.min(Math.abs(nbt.getInt("Variant")), 4)]); // Scissors - Fix out-of-bounds Axolotl variant exploit + if (nbt.contains("Age")) { + this.setAge(nbt.getInt("Age")); + }