diff --git a/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch b/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch index 6b681ae6e6..23fd4b93dc 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/EntityLiving.patch @@ -33,6 +33,15 @@ public abstract class EntityLiving extends Entity implements Attackable { private static final Logger LOGGER = LogUtils.getLogger(); +@@ -157,7 +183,7 @@ + private static final double MAX_LINE_OF_SIGHT_TEST_RANGE = 128.0D; + protected static final int LIVING_ENTITY_FLAG_IS_USING = 1; + protected static final int LIVING_ENTITY_FLAG_OFF_HAND = 2; +- protected static final int LIVING_ENTITY_FLAG_SPIN_ATTACK = 4; ++ public static final int LIVING_ENTITY_FLAG_SPIN_ATTACK = 4; + protected static final DataWatcherObject DATA_LIVING_ENTITY_FLAGS = DataWatcher.defineId(EntityLiving.class, DataWatcherRegistry.BYTE); + public static final DataWatcherObject DATA_HEALTH_ID = DataWatcher.defineId(EntityLiving.class, DataWatcherRegistry.FLOAT); + private static final DataWatcherObject> DATA_EFFECT_PARTICLES = DataWatcher.defineId(EntityLiving.class, DataWatcherRegistry.PARTICLES); @@ -249,6 +275,19 @@ protected boolean skipDropExperience; private final Reference2ObjectMap> activeLocationDependentEnchantments; @@ -1008,7 +1017,7 @@ this.setSharedFlag(7, flag); } -@@ -3141,14 +3634,21 @@ +@@ -3141,13 +3634,20 @@ @Override public boolean isPickable() { @@ -1020,18 +1029,26 @@ public boolean isPushable() { - return this.isAlive() && !this.isSpectator() && !this.onClimbable(); + return this.isAlive() && !this.isSpectator() && !this.onClimbable() && this.collides; // CraftBukkit - } - ++ } ++ + // CraftBukkit start - collidable API + @Override + public boolean canCollideWithBukkit(Entity entity) { + return isPushable() && this.collides != this.collidableExemptions.contains(entity.getUUID()); -+ } + } + // CraftBukkit end -+ + @Override public float getYHeadRot() { - return this.yHeadRot; +@@ -3245,7 +3745,7 @@ + + } + +- protected void setLivingEntityFlag(int i, boolean flag) { ++ public void setLivingEntityFlag(int i, boolean flag) { + int j = (Byte) this.entityData.get(EntityLiving.DATA_LIVING_ENTITY_FLAGS); + + if (flag) { @@ -3346,7 +3846,26 @@ } else { if (!this.useItem.isEmpty() && this.isUsingItem()) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 025e844209..24fb29778a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -160,6 +160,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { getHandle().stopSleepInBed(true, setSpawnLocation); } + @Override + public void startRiptideAttack(int duration, float damage, ItemStack attackItem) { + Preconditions.checkArgument(duration > 0, "Duration must be greater than 0"); + Preconditions.checkArgument(damage >= 0, "Damage must not be negative"); + + getHandle().startAutoSpinAttack(duration, damage, CraftItemStack.asNMSCopy(attackItem)); + } + @Override public Location getBedLocation() { Preconditions.checkState(isSleeping(), "Not sleeping"); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index a0fae73dbf..586d0a6d27 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -656,6 +656,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return getHandle().isAutoSpinAttack(); } + @Override + public void setRiptiding(boolean riptiding) { + getHandle().setLivingEntityFlag(EntityLiving.LIVING_ENTITY_FLAG_SPIN_ATTACK, riptiding); + } + @Override public boolean isSleeping() { return getHandle().isSleeping();