Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 2e1a3720cf
commit 153752dfac
44 changed files with 3379 additions and 958 deletions

View File

@@ -0,0 +1,69 @@
package org.bukkit.entity;
import org.jetbrains.annotations.NotNull;
/**
* An Axolotl.
*/
public interface Axolotl extends Animals {
/**
* Gets if this axolotl is playing dead.
*
* An axolotl may play dead when it is damaged underwater.
*
* @return playing dead status
*/
boolean isPlayingDead();
/**
* Sets if this axolotl is playing dead.
*
* An axolotl may play dead when it is damaged underwater.
*
* @param playingDead playing dead status
*/
void setPlayingDead(boolean playingDead);
/**
* Get the variant of this axolotl.
*
* @return axolotl variant
*/
@NotNull
Variant getVariant();
/**
* Set the variant of this axolotl.
*
* @param variant axolotl variant
*/
void setVariant(@NotNull Variant variant);
/**
* Represents the variant of a axolotl - ie its color.
*/
public enum Variant {
/**
* Leucistic (pink) axolotl.
*/
LUCY,
/**
* Brown axolotl.
*/
WILD,
/**
* Gold axolotl.
*/
GOLD,
/**
* Cyan axolotl.
*/
CYAN,
/**
* Blue axolotl.
*/
BLUE;
}
}

View File

@@ -8,7 +8,9 @@ public interface Endermite extends Monster {
* An Endermite spawned by a player will be attacked by nearby Enderman.
*
* @return player spawned status
* @deprecated this functionality no longer exists
*/
@Deprecated
boolean isPlayerSpawned();
/**
@@ -17,6 +19,8 @@ public interface Endermite extends Monster {
* An Endermite spawned by a player will be attacked by nearby Enderman.
*
* @param playerSpawned player spawned status
* @deprecated this functionality no longer exists
*/
@Deprecated
void setPlayerSpawned(boolean playerSpawned);
}

View File

@@ -204,6 +204,52 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
public void setFireTicks(int ticks);
/**
* Gets if the entity has visual fire (it will always appear to be on fire).
*
* @param fire whether visual fire is enabled
*/
void setVisualFire(boolean fire);
/**
* Sets if the entity has visual fire (it will always appear to be on fire).
*
* @return whether visual fire is enabled
*/
boolean isVisualFire();
/**
* Returns the entity's current freeze ticks (amount of ticks the entity has
* been in powdered snow).
*
* @return int freeze ticks
*/
int getFreezeTicks();
/**
* Returns the entity's maximum freeze ticks (amount of ticks before it will
* be fully frozen)
*
* @return int max freeze ticks
*/
int getMaxFreezeTicks();
/**
* Sets the entity's current freeze ticks (amount of ticks the entity has
* been in powdered snow).
*
* @param ticks Current ticks
*/
void setFreezeTicks(int ticks);
/**
* Gets if the entity is fully frozen (it has been in powdered snow for max
* freeze ticks).
*
* @return freeze status
*/
boolean isFrozen();
/**
* Mark the entity's removal.
*/

View File

@@ -266,6 +266,11 @@ public enum EntityType implements Keyed {
STRIDER("strider", Strider.class, -1),
ZOGLIN("zoglin", Zoglin.class, -1),
PIGLIN_BRUTE("piglin_brute", PiglinBrute.class, -1),
AXOLOTL("axolotl", Axolotl.class, -1),
GLOW_ITEM_FRAME("glow_item_frame", GlowItemFrame.class, -1),
GLOW_SQUID("glow_squid", GlowSquid.class, -1),
GOAT("goat", Goat.class, -1),
MARKER("marker", Marker.class, -1),
/**
* A fishing line and bobber.
*/

View File

@@ -0,0 +1,7 @@
package org.bukkit.entity;
/**
* A Glow Item Frame.
*/
public interface GlowItemFrame extends ItemFrame {
}

View File

@@ -0,0 +1,25 @@
package org.bukkit.entity;
/**
* A Glow Squid.
*/
public interface GlowSquid extends Squid {
/**
* Get the number of dark ticks remaining for this squid.
*
* Bravo Six will go dark for 100 ticks (5 seconds) if damaged.
*
* @return dark ticks remaining
*/
int getDarkTicksRemaining();
/**
* Sets the number of dark ticks remaining for this squid.
*
* Bravo Six will go dark for 100 ticks (5 seconds) if damaged.
*
* @param darkTicksRemaining dark ticks remaining
*/
void setDarkTicksRemaining(int darkTicksRemaining);
}

View File

@@ -0,0 +1,27 @@
package org.bukkit.entity;
/**
* A Goat.
*/
public interface Goat extends Animals {
/**
* Gets if this is a screaming goat.
*
* A screaming goat makes screaming sounds and rams more often. They do not
* offer home loans.
*
* @return screaming status
*/
boolean isScreaming();
/**
* Sets if this is a screaming goat.
*
* A screaming goat makes screaming sounds and rams more often. They do not
* offer home loans.
*
* @param screaming screaming status
*/
void setScreaming(boolean screaming);
}

View File

@@ -0,0 +1,7 @@
package org.bukkit.entity;
/**
* A Marker entity, exists only on the server.
*/
public interface Marker extends Entity {
}

View File

@@ -30,6 +30,10 @@ public enum Pose {
* Entity is sneaking.
*/
SNEAKING,
/**
* Entity is long jumping.
*/
LONG_JUMPING,
/**
* Entity is dead.
*/

View File

@@ -59,6 +59,12 @@ public final class MemoryKey<T> implements Keyed {
public static final MemoryKey<Boolean> ADMIRING_ITEM = new MemoryKey<>(NamespacedKey.minecraft("admiring_item"), Boolean.class);
public static final MemoryKey<Boolean> ADMIRING_DISABLED = new MemoryKey<>(NamespacedKey.minecraft("admiring_disabled"), Boolean.class);
public static final MemoryKey<Boolean> HUNTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("hunted_recently"), Boolean.class);
public static final MemoryKey<Integer> PLAY_DEAD_TICKS = new MemoryKey<>(NamespacedKey.minecraft("play_dead_ticks"), Integer.class);
public static final MemoryKey<Integer> TEMPTATION_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("temptation_cooldown_ticks"), Integer.class);
public static final MemoryKey<Boolean> IS_TEMPTED = new MemoryKey<>(NamespacedKey.minecraft("is_tempted"), Boolean.class);
public static final MemoryKey<Integer> LONG_JUMP_COOLING_DOWN = new MemoryKey<>(NamespacedKey.minecraft("long_jump_cooling_down"), Integer.class);
public static final MemoryKey<Boolean> HAS_HUNTING_COOLDOWN = new MemoryKey<>(NamespacedKey.minecraft("has_hunting_cooldown"), Boolean.class);
public static final MemoryKey<Integer> RAM_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("ram_cooldown_ticks"), Integer.class);
/**
* Returns a {@link MemoryKey} by a {@link NamespacedKey}.