mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -07:00
Add API for checking if a zombie has the option to break doors (#6855)
This commit is contained in:
@@ -246,3 +246,6 @@ public net.minecraft.world.entity.ai.attributes.AttributeSupplier instances
|
|||||||
|
|
||||||
# Add ItemFactory#getSpawnEgg API
|
# Add ItemFactory#getSpawnEgg API
|
||||||
public net.minecraft.world.item.SpawnEggItem BY_ID
|
public net.minecraft.world.item.SpawnEggItem BY_ID
|
||||||
|
|
||||||
|
# Zombie API - breaking doors
|
||||||
|
public net.minecraft.world.entity.monster.Zombie supportsBreakDoorGoal()Z
|
||||||
|
@@ -21,10 +21,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ boolean canBreakDoors();
|
+ boolean canBreakDoors();
|
||||||
+
|
+
|
||||||
+ /**
|
+ /**
|
||||||
+ * Sets if this zombie can break doors
|
+ * Sets if this zombie can break doors.
|
||||||
|
+ * Check {@link #supportsBreakingDoors()} to see
|
||||||
|
+ * if this zombie type will even be affected by using
|
||||||
|
+ * this method.
|
||||||
+ *
|
+ *
|
||||||
+ * @param canBreakDoors True if zombie can break doors
|
+ * @param canBreakDoors True if zombie can break doors
|
||||||
+ */
|
+ */
|
||||||
+ void setCanBreakDoors(boolean canBreakDoors);
|
+ void setCanBreakDoors(boolean canBreakDoors);
|
||||||
|
+
|
||||||
|
+ /**
|
||||||
|
+ * Checks if this zombie type supports breaking doors.
|
||||||
|
+ * {@link Drowned} do not have support for breaking doors
|
||||||
|
+ * so using {@link #setCanBreakDoors(boolean)} on them has
|
||||||
|
+ * no effect.
|
||||||
|
+ *
|
||||||
|
+ * @return
|
||||||
|
+ */
|
||||||
|
+ boolean supportsBreakingDoors();
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ @Override
|
+ @Override
|
||||||
+ public void setCanBreakDoors(boolean canBreakDoors) {
|
+ public void setCanBreakDoors(boolean canBreakDoors) {
|
||||||
+ getHandle().setCanBreakDoors(canBreakDoors);
|
+ getHandle().setCanBreakDoors(canBreakDoors);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @Override
|
||||||
|
+ public boolean supportsBreakingDoors() {
|
||||||
|
+ return getHandle().supportsBreakDoorGoal();
|
||||||
+ }
|
+ }
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user