13
0
geforkt von Mirrors/Paper

Add entity API for getting the combined gene of a Panda (#9891)

Dieser Commit ist enthalten in:
booky10 2023-11-04 21:28:23 +01:00
Ursprung 5a34a7c895
Commit d1c10d63dc
2 geänderte Dateien mit 19 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -705,6 +705,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @Override
+ boolean isSitting();
+
+ /**
+ * Gets this Panda's combined gene.
+ * <p>
+ * The combined gene can be modified using
+ * {@link #setMainGene(Gene)} or {@link #setHiddenGene(Gene)}.
+ *
+ * @return combined gene
+ */
+ @NotNull
+ Gene getCombinedGene();
+ // Paper end - Panda API
+
public enum Gene {

Datei anzeigen

@ -850,9 +850,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPanda.java
@@ -0,0 +0,0 @@ public class CraftPanda extends CraftAnimals implements Panda {
public void setHiddenGene(Gene gene) {
this.getHandle().setHiddenGene(CraftPanda.toNms(gene));
}
+ // Paper start - Panda API
+ @Override
+ public void setSneezeTicks(int ticks) {
@ -878,10 +878,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public void setUnhappyTicks(int ticks) {
+ this.getHandle().setUnhappyCounter(ticks);
+ }
+
+ @Override
+ public Gene getCombinedGene() {
+ return CraftPanda.fromNms(this.getHandle().getVariant());
+ }
+ // Paper end - Panda API
+
@Override
public boolean isRolling() {
return this.getHandle().isRolling();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java