From e5f9241d1511c2e20e3a6cdc3b611052815a5b17 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Tue, 19 Oct 2021 20:46:52 -0700 Subject: [PATCH] Left handed API (#6775) --- patches/api/0339-Left-handed-API.patch | 31 +++++++++++++++++++++++ patches/server/0829-Left-handed-API.patch | 26 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 patches/api/0339-Left-handed-API.patch create mode 100644 patches/server/0829-Left-handed-API.patch diff --git a/patches/api/0339-Left-handed-API.patch b/patches/api/0339-Left-handed-API.patch new file mode 100644 index 0000000000..c6c9f1b39f --- /dev/null +++ b/patches/api/0339-Left-handed-API.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +Date: Thu, 14 Oct 2021 12:36:46 -0500 +Subject: [PATCH] Left handed API + + +diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java +index 07bedbc15ba2463d3c629ae68d229286d4033f79..984ad873f36c3dcc73703eb6902c4eab5f1e72b6 100644 +--- a/src/main/java/org/bukkit/entity/Mob.java ++++ b/src/main/java/org/bukkit/entity/Mob.java +@@ -148,4 +148,20 @@ public interface Mob extends LivingEntity, Lootable { + * @return whether the mob is aware + */ + public boolean isAware(); ++ ++ // Paper start ++ /** ++ * Check if Mob is left-handed ++ * ++ * @return True if left-handed ++ */ ++ public boolean isLeftHanded(); ++ ++ /** ++ * Set if Mob is left-handed ++ * ++ * @param leftHanded True if left-handed ++ */ ++ public void setLeftHanded(boolean leftHanded); ++ // Paper end + } diff --git a/patches/server/0829-Left-handed-API.patch b/patches/server/0829-Left-handed-API.patch new file mode 100644 index 0000000000..099fa6769c --- /dev/null +++ b/patches/server/0829-Left-handed-API.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +Date: Thu, 14 Oct 2021 12:36:58 -0500 +Subject: [PATCH] Left handed API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +index 2386edf499cb292241f6ba60c1cdb46f2fe704ff..5a43e420f14fa52d71d41ff3694a179e7a1a5be3 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +@@ -134,5 +134,15 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { + public int getMaxHeadPitch() { + return getHandle().getMaxHeadXRot(); + } ++ ++ @Override ++ public boolean isLeftHanded() { ++ return getHandle().isLeftHanded(); ++ } ++ ++ @Override ++ public void setLeftHanded(boolean leftHanded) { ++ getHandle().setLeftHanded(leftHanded); ++ } + // Paper end + }