Deprecate Turtle#isDigging (#11959)

This commit is contained in:
Lulu13022002
2025-01-12 21:49:25 +01:00
committed by GitHub
parent 86c6308faf
commit 2ea6aee343
3 changed files with 8 additions and 12 deletions

View File

@@ -22,7 +22,6 @@ public interface Turtle extends Animals {
*/ */
boolean isLayingEgg(); boolean isLayingEgg();
// Paper start
/** /**
* Get the turtle's home location * Get the turtle's home location
* *
@@ -49,8 +48,12 @@ public interface Turtle extends Animals {
* Get if turtle is digging to lay eggs * Get if turtle is digging to lay eggs
* *
* @return True if digging * @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 * Set if turtle is carrying egg
@@ -58,5 +61,4 @@ public interface Turtle extends Animals {
* @param hasEgg True if carrying egg * @param hasEgg True if carrying egg
*/ */
void setHasEgg(boolean hasEgg); void setHasEgg(boolean hasEgg);
// Paper end
} }

View File

@@ -100,10 +100,11 @@
} else if (!isBrewable || !itemStack1.is(blockEntity.ingredient)) { } else if (!isBrewable || !itemStack1.is(blockEntity.ingredient)) {
blockEntity.brewTime = 0; blockEntity.brewTime = 0;
} }
@@ -114,6 +_,14 @@ @@ -113,7 +_,14 @@
setChanged(level, pos, state);
} else if (isBrewable && blockEntity.fuel > 0) { } else if (isBrewable && blockEntity.fuel > 0) {
blockEntity.fuel--; blockEntity.fuel--;
blockEntity.brewTime = 400; - blockEntity.brewTime = 400;
+ // CraftBukkit start + // CraftBukkit start
+ org.bukkit.event.block.BrewingStartEvent event = new org.bukkit.event.block.BrewingStartEvent( + org.bukkit.event.block.BrewingStartEvent event = new org.bukkit.event.block.BrewingStartEvent(
+ org.bukkit.craftbukkit.block.CraftBlock.at(level, pos), + org.bukkit.craftbukkit.block.CraftBlock.at(level, pos),

View File

@@ -29,7 +29,6 @@ public class CraftTurtle extends CraftAnimals implements Turtle {
return this.getHandle().isLayingEgg(); return this.getHandle().isLayingEgg();
} }
// Paper start
@Override @Override
public org.bukkit.Location getHome() { public org.bukkit.Location getHome() {
return io.papermc.paper.util.MCUtil.toLocation(this.getHandle().level(), this.getHandle().getHomePos()); return io.papermc.paper.util.MCUtil.toLocation(this.getHandle().level(), this.getHandle().getHomePos());
@@ -45,14 +44,8 @@ public class CraftTurtle extends CraftAnimals implements Turtle {
return this.getHandle().isGoingHome(); return this.getHandle().isGoingHome();
} }
@Override
public boolean isDigging() {
return this.getHandle().isLayingEgg();
}
@Override @Override
public void setHasEgg(boolean hasEgg) { public void setHasEgg(boolean hasEgg) {
this.getHandle().setHasEgg(hasEgg); this.getHandle().setHasEgg(hasEgg);
} }
// Paper end
} }