13
0
geforkt von Mirrors/Paper

Updated Upstream (Bukkit/CraftBukkit) (#8172)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
23f557a0 SPIGOT-5380, SPIGOT-6958, PR-772: Add some missing entity API

CraftBukkit Changes:
fc3071161 SPIGOT-5380, SPIGOT-6958, PR-1085: Add some missing entity API
Dieser Commit ist enthalten in:
Jake Potrebic 2022-07-22 11:18:00 -07:00
Ursprung 1e414c0753
Commit d6e0ab24da
14 geänderte Dateien mit 66 neuen und 294 gelöschten Zeilen

Datei anzeigen

@ -173,7 +173,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override // Paper
public void setCollarColor(@NotNull DyeColor color);
// Paper start
/**
diff --git a/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java b/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/entity/SheepDyeWoolEvent.java

Datei anzeigen

@ -20,15 +20,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* Represents a Witch
*/
public interface Witch extends Raider, RangedEntity { // Paper
+ // Paper start
+ /**
+ * Check if Witch is drinking a potion
+ *
+ * @return True if drinking a potion
+ */
+ boolean isDrinkingPotion();
@@ -0,0 +0,0 @@ public interface Witch extends Raider, RangedEntity { // Paper
* @return whether the witch is drinking a potion
*/
boolean isDrinkingPotion();
+
+ // Paper start
+ /**
+ * Get time remaining (in ticks) the Witch is drinking a potion
+ *
@ -51,8 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ *
+ * @return The potion the witch is drinking
+ */
+ @Nullable
+ ItemStack getDrinkingPotion();
+ @Nullable ItemStack getDrinkingPotion();
+
+ /**
+ * Set the potion the Witch should drink

Datei anzeigen

@ -9,9 +9,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/Zombie.java
+++ b/src/main/java/org/bukkit/entity/Zombie.java
@@ -0,0 +0,0 @@ public interface Zombie extends Monster, Ageable {
* @param time new conversion time
* @param flag Whether this zombie can break doors
*/
void setConversionTime(int time);
void setCanBreakDoors(boolean flag);
+
+ // Paper start
+ /**
+ * Check if zombie is drowning

Datei anzeigen

@ -242,42 +242,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param faceplanted face planted
+ */
+ public void setFaceplanted(boolean faceplanted);
+
+ /**
+ * Gets if the fox face planted.
+ *
+ * @return fox face planted
+ */
+ public boolean isFaceplanted();
+ // Paper end - Add more fox behavior API
}
diff --git a/src/main/java/org/bukkit/entity/Ghast.java b/src/main/java/org/bukkit/entity/Ghast.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Ghast.java
+++ b/src/main/java/org/bukkit/entity/Ghast.java
@@ -0,0 +0,0 @@ package org.bukkit.entity;
/**
* Represents a Ghast.
*/
-public interface Ghast extends Flying {}
+// Paper start
+public interface Ghast extends Flying {
+
+ /**
+ * Returns whether the ghast is charging an attack.
+ *
+ * @return whether the ghast is charging an attack
+ */
+ boolean isCharging();
+
+ /**
+ * Sets whether the ghast is charging an attack.
+ * This determines whether the client displays the charging animation.
+ *
+ * @param charging whether the ghast is charging an attack
+ */
+ void setCharging(boolean charging);
@@ -0,0 +0,0 @@ public interface Ghast extends Flying {
* @param flag Whether the Ghast is charging
*/
void setCharging(boolean flag);
+
+ // Paper start
+ /**
+ * Returns the explosion power of shot fireballs.
+ *
@ -293,25 +269,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ void setExplosionPower(int explosionPower);
+ // Paper end
+}
}
diff --git a/src/main/java/org/bukkit/entity/Panda.java b/src/main/java/org/bukkit/entity/Panda.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Panda.java
+++ b/src/main/java/org/bukkit/entity/Panda.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
/**
* Panda entity.
*/
-public interface Panda extends Animals {
+public interface Panda extends Animals, Sittable { // Paper
@@ -0,0 +0,0 @@ public interface Panda extends Animals, Sittable {
*/
int getUnhappyTicks();
/**
* Gets this Panda's main gene.
@@ -0,0 +0,0 @@ public interface Panda extends Animals {
return recessive;
}
}
+
+ // Paper start - Panda API
+ /**
+ * Sets the sneeze progress in this animation.
@ -329,22 +295,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ int getSneezeTicks();
+
+ /**
+ * Sets if the panda is sneezing, which causes the sneeze counter to count.
+ * <p>
+ * When false, this will automatically set the sneeze ticks to 0.
+ *
+ * @param sneeze if the panda is sneezing or not
+ */
+ void setSneezing(boolean sneeze);
+
+ /**
+ * Gets if the panda is sneezing
+ *
+ * @return is sneezing
+ */
+ boolean isSneezing();
+
+ /**
+ * Sets the eating ticks for this panda.
+ * <p>
+ *
@ -371,39 +321,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ void setUnhappyTicks(int ticks);
+
+ /**
+ * Gets how many ticks this panda will be unhappy for.
+ *
+ * @return unhappy ticks
+ */
+ int getUnhappyTicks();
+
+ /**
+ * Sets if this panda is currently rolling.
+ *
+ * @param rolling should roll
+ */
+ void setRolling(boolean rolling);
+
+ /**
+ * Gets if this panda is currently rolling on the ground.
+ *
+ * @return is rolling
+ */
+ boolean isRolling();
+
+ /**
+ * Sets if this panda is currently on its back.
+ *
+ * @param onBack is on its back
+ * @deprecated use {@link #setOnBack(boolean)}
+ */
+ void setIsOnBack(boolean onBack);
+
+ /**
+ * Gets if this panda is currently on its back.
+ *
+ * @return is on back
+ */
+ boolean isOnBack();
+ @Deprecated(forRemoval = true)
+ default void setIsOnBack(boolean onBack) {
+ this.setOnBack(onBack);
+ }
+
+ /**
+ * Sets if this panda is currently sitting.
@ -432,7 +358,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override
+ boolean isSitting();
+ // Paper end - Panda API
}
+
public enum Gene {
NORMAL(false),
diff --git a/src/main/java/org/bukkit/entity/Piglin.java b/src/main/java/org/bukkit/entity/Piglin.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Piglin.java
@ -672,33 +601,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param value whether the wither can travel through portals
+ */
+ void setCanTravelThroughPortals(boolean value);
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Wolf.java
+++ b/src/main/java/org/bukkit/entity/Wolf.java
@@ -0,0 +0,0 @@ public interface Wolf extends Tameable, Sittable {
* @param color the color to apply
*/
public void setCollarColor(@NotNull DyeColor color);
+
+ // Paper start
+ /**
+ * Sets if the wolf is interested.
+ * <p>
+ * This causes the wolf to tilt its head to the side.
+ *
+ * @param interested is interested
+ */
+ void setInterested(boolean interested);
+
+ /**
+ * Gets if the wolf is interested.
+ *
+ * @return is interested
+ */
+ boolean isInterested();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/ZombieVillager.java b/src/main/java/org/bukkit/entity/ZombieVillager.java

Datei anzeigen

@ -165,7 +165,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
*/
-public interface Witch extends Raider {
+public interface Witch extends Raider, RangedEntity { // Paper
}
/**
* Gets whether the witch is drinking a potion
diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Wither.java

Datei anzeigen

@ -233,10 +233,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
* Represents a turtle.
*/
-public interface Turtle extends Animals { }
+public interface Turtle extends Animals {
+ // Paper start
@@ -0,0 +0,0 @@ public interface Turtle extends Animals {
* @return Whether the turtle is laying an egg
*/
boolean isLayingEgg();
+
+ // Paper start
+ /**
+ * Get the turtle's home location
+ *
@ -267,24 +269,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ boolean isDigging();
+
+ /**
+ * Get if turtle is carrying egg
+ *
+ * @return True if carrying egg
+ */
+ boolean hasEgg();
+
+ /**
+ * Set if turtle is carrying egg
+ *
+ * @param hasEgg True if carrying egg
+ */
+ void setHasEgg(boolean hasEgg);
+
+ /**
+ * Returns whether the turtle is currently laying an egg.
+ *
+ * @return whether the turtle is laying an egg
+ */
+ boolean isLayingEgg();
+ // Paper end
+}
}

Datei anzeigen

@ -8,35 +8,31 @@ diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/buk
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Zombie.java
+++ b/src/main/java/org/bukkit/entity/Zombie.java
@@ -0,0 +0,0 @@ public interface Zombie extends Monster, Ageable {
/**
* Sets whether this zombie can break doors
- *
- * This will be ignored if the entity is a Drowned. Will also stop the action if
+ * <p>
+ * Check {@link #supportsBreakingDoors()} to see
+ * if this zombie type will even be affected by using
+ * this method. Will also stop the action if
* the entity is currently breaking a door.
*
* @param flag Whether this zombie can break doors
@@ -0,0 +0,0 @@ public interface Zombie extends Monster, Ageable {
* @param shouldBurnInDay True to burn in sunlight
*/
void setShouldBurnInDay(boolean shouldBurnInDay);
+
+ /**
+ * Check if this zombie can break doors
+ *
+ * @return True if zombie can break doors
+ */
+ boolean canBreakDoors();
+
+ /**
+ * 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
+ */
+ 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
+ * @return true if entity supports breaking doors
+ */
+ boolean supportsBreakingDoors();
// Paper end

Datei anzeigen

@ -8,15 +8,6 @@ diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/m
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
@@ -0,0 +0,0 @@
package net.minecraft.world.entity.monster;
+// Paper start
+import com.destroystokyo.paper.event.entity.WitchReadyPotionEvent;
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
@@ -0,0 +0,0 @@ public class Witch extends Raider implements RangedAttackMob {
}
@ -98,15 +89,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public class CraftWitch extends CraftRaider implements Witch, com.destroystokyo.paper.entity.CraftRangedEntity<net.minecraft.world.entity.monster.Witch> { // Paper
public CraftWitch(CraftServer server, net.minecraft.world.entity.monster.Witch entity) {
@@ -0,0 +0,0 @@ public class CraftWitch extends CraftRaider implements Witch, com.destroystokyo.
public EntityType getType() {
return EntityType.WITCH;
public boolean isDrinkingPotion() {
return this.getHandle().isDrinkingPotion();
}
+
+ // Paper start
+ public boolean isDrinkingPotion() {
+ return getHandle().isDrinkingPotion();
+ }
+
+ public int getPotionUseTimeLeft() {
+ return getHandle().usingTime;
+ }

Datei anzeigen

@ -305,9 +305,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
@@ -0,0 +0,0 @@ public class CraftFox extends CraftAnimals implements Fox {
this.getHandle().getEntityData().set(net.minecraft.world.entity.animal.Fox.DATA_TRUSTED_ID_1, player == null ? Optional.empty() : Optional.of(player.getUniqueId()));
public boolean isFaceplanted() {
return this.getHandle().isFaceplanted();
}
+
+ // Paper start - Add more fox behavior API
+ @Override
+ public void setInterested(boolean interested) {
@ -343,11 +344,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public void setFaceplanted(boolean faceplanted) {
+ this.getHandle().setFaceplanted(faceplanted);
+ }
+
+ @Override
+ public boolean isFaceplanted() {
+ return this.getHandle().isFaceplanted();
+ }
+ // Paper end - Add more fox behavior API
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java
@ -355,22 +351,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftGhast.java
@@ -0,0 +0,0 @@ public class CraftGhast extends CraftFlying implements Ghast {
public EntityType getType() {
return EntityType.GHAST;
public void setCharging(boolean flag) {
this.getHandle().setCharging(flag);
}
+
+ // Paper start
+ @Override
+ public boolean isCharging() {
+ return this.getHandle().isCharging();
+ }
+
+ @Override
+ public void setCharging(boolean charging) {
+ this.getHandle().setCharging(charging);
+ }
+
+ @Override
+ public int getExplosionPower() {
+ return this.getHandle().getExplosionPower();
+ }
@ -402,16 +388,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public void setSneezing(boolean sneeze) {
+ this.getHandle().sneeze(sneeze);
+ }
+
+ @Override
+ public boolean isSneezing() {
+ return this.getHandle().isSneezing();
+ }
+
+ @Override
+ public void setEatingTicks(int ticks) {
+ this.getHandle().setEatCounter(ticks);
+ }
@ -425,45 +401,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public void setUnhappyTicks(int ticks) {
+ this.getHandle().setUnhappyCounter(ticks);
+ }
+
+ @Override
+ public int getUnhappyTicks() {
+ return this.getHandle().getUnhappyCounter();
+ }
+
+ @Override
+ public boolean isRolling() {
+ return this.getHandle().isRolling();
+ }
+
+ @Override
+ public void setRolling(boolean rolling) {
+ this.getHandle().roll(rolling);
+ }
+
+ @Override
+ public boolean isOnBack() {
+ return this.getHandle().isOnBack();
+ }
+
+ @Override
+ public void setIsOnBack(boolean onBack) {
+ this.getHandle().setOnBack(onBack);
+ }
+
+ @Override
+ public boolean isSitting() {
+ return this.getHandle().isSitting();
+ }
+
+ @Override
+ public void setSitting(boolean sitting) {
+ this.getHandle().sit(sitting);
+ }
+ // Paper end - Panda API
public static Gene fromNms(net.minecraft.world.entity.animal.Panda.Gene gene) {
Preconditions.checkArgument(gene != null, "Gene may not be null");
@Override
public boolean isRolling() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java
@ -651,23 +592,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java
@@ -0,0 +0,0 @@ public class CraftWolf extends CraftTameableAnimal implements Wolf {
public void setCollarColor(DyeColor color) {
this.getHandle().setCollarColor(net.minecraft.world.item.DyeColor.byId(color.getWoolData()));
}
+ // Paper start
+ @Override
+ public void setInterested(boolean interested) {
+ this.getHandle().setIsInterested(interested);
+ }
+
+ @Override
+ public boolean isInterested() {
+ return this.getHandle().isInterested();
+ }
+ // Paper end
}

Datei anzeigen

@ -56,14 +56,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java
@@ -0,0 +0,0 @@ public class CraftTurtle extends CraftAnimals implements Turtle {
public EntityType getType() {
return EntityType.TURTLE;
public boolean isLayingEgg() {
return this.getHandle().isLayingEgg();
}
+
+ // Paper start
+ @Override
+ public org.bukkit.Location getHome() {
+ return net.minecraft.server.MCUtil.toLocation(getHandle().level, getHandle().getHomePos());
+ return net.minecraft.server.MCUtil.toLocation(getHandle().getLevel(), getHandle().getHomePos());
+ }
+
+ @Override
@ -82,18 +82,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public boolean hasEgg() {
+ return getHandle().hasEgg();
+ }
+
+ @Override
+ public void setHasEgg(boolean hasEgg) {
+ getHandle().setHasEgg(hasEgg);
+ }
+
+ @Override
+ public boolean isLayingEgg() {
+ return this.getHandle().isLayingEgg();
+ }
+ // Paper end
}

Datei anzeigen

@ -14,16 +14,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+
+ @Override
+ public boolean canBreakDoors() {
+ return getHandle().canBreakDoors();
+ }
+
+ @Override
+ public void setCanBreakDoors(boolean canBreakDoors) {
+ getHandle().setCanBreakDoors(canBreakDoors);
+ }
+
+ @Override
+ public boolean supportsBreakingDoors() {
+ return getHandle().supportsBreakDoorGoal();
+ }

Datei anzeigen

@ -5,7 +5,7 @@ PS1="$"
function changelog() {
base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1)
cd $1 && git log --oneline ${base}...HEAD | sed -E 's/(^[0-9a-f]{8,} |Revert ")#([0-9]+)/\1PR-\2/'
cd $1 && git log --oneline ${base}...HEAD | sed -E 's/(^[0-9a-f]{8,}( SPIGOT-[0-9]{1,4},?)* |Revert ")#([0-9]+)/\1PR-\3/'
}
bukkit=$(changelog work/Bukkit)
cb=$(changelog work/CraftBukkit)

@ -1 +1 @@
Subproject commit d90bdc08ffe5384cec87bcf5d41265763436d35f
Subproject commit 23f557a0a005db45e17f16e58c8f0a583682be79

@ -1 +1 @@
Subproject commit 9a8e080108222cf09aed735a3b5089d3da6350c6
Subproject commit fc3071161ce4ceacceafcf77c03e5fe8464c6675