Skip to content

Commit

Permalink
Deprecate Turtle#isDigging (#11959)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lulu13022002 authored Jan 12, 2025
1 parent 86c6308 commit 2ea6aee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
8 changes: 5 additions & 3 deletions paper-api/src/main/java/org/bukkit/entity/Turtle.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public interface Turtle extends Animals {
*/
boolean isLayingEgg();

// Paper start
/**
* Get the turtle's home location
*
Expand All @@ -49,14 +48,17 @@ public interface Turtle extends Animals {
* Get if turtle is digging to lay eggs
*
* @return True if digging
* @deprecated in favor of {@link #isLayingEgg()}
*/
boolean isDigging();
@Deprecated(since = "1.21.4")
default boolean isDigging() {
return this.isLayingEgg();
}

/**
* Set if turtle is carrying egg
*
* @param hasEgg True if carrying egg
*/
void setHasEgg(boolean hasEgg);
// Paper end
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@
} else if (!isBrewable || !itemStack1.is(blockEntity.ingredient)) {
blockEntity.brewTime = 0;
}
@@ -114,6 +_,14 @@
@@ -113,7 +_,14 @@
setChanged(level, pos, state);
} else if (isBrewable && blockEntity.fuel > 0) {
blockEntity.fuel--;
blockEntity.brewTime = 400;
- blockEntity.brewTime = 400;
+ // CraftBukkit start
+ org.bukkit.event.block.BrewingStartEvent event = new org.bukkit.event.block.BrewingStartEvent(
+ org.bukkit.craftbukkit.block.CraftBlock.at(level, pos),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public boolean isLayingEgg() {
return this.getHandle().isLayingEgg();
}

// Paper start
@Override
public org.bukkit.Location getHome() {
return io.papermc.paper.util.MCUtil.toLocation(this.getHandle().level(), this.getHandle().getHomePos());
Expand All @@ -45,14 +44,8 @@ public boolean isGoingHome() {
return this.getHandle().isGoingHome();
}

@Override
public boolean isDigging() {
return this.getHandle().isLayingEgg();
}

@Override
public void setHasEgg(boolean hasEgg) {
this.getHandle().setHasEgg(hasEgg);
}
// Paper end
}

0 comments on commit 2ea6aee

Please sign in to comment.