Update to Minecraft 1.19

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2022-06-08 02:00:00 +10:00
parent 9bfa9ca85b
commit ec575f5252
88 changed files with 1339 additions and 375 deletions

View File

@@ -0,0 +1,9 @@
package org.bukkit.entity;
import org.bukkit.inventory.InventoryHolder;
/**
* An Allay.
*/
public interface Allay extends Creature, InventoryHolder {
}

View File

@@ -0,0 +1,10 @@
package org.bukkit.entity;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.loot.Lootable;
/**
* A {@link Boat} with a chest.
*/
public interface ChestBoat extends Boat, InventoryHolder, Lootable {
}

View File

@@ -271,6 +271,11 @@ public enum EntityType implements Keyed {
GLOW_SQUID("glow_squid", GlowSquid.class, -1),
GOAT("goat", Goat.class, -1),
MARKER("marker", Marker.class, -1),
ALLAY("allay", Allay.class, -1),
CHEST_BOAT("chest_boat", ChestBoat.class, -1),
FROG("frog", Frog.class, -1),
TADPOLE("tadpole", Tadpole.class, -1),
WARDEN("warden", Warden.class, -1),
/**
* A fishing line and bobber.
*/

View File

@@ -0,0 +1,73 @@
package org.bukkit.entity;
import java.util.Locale;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* A Frog.
*/
public interface Frog extends Animals {
/**
* Gets the tongue target of this frog.
*
* @return tongue target or null if not set
*/
@Nullable
Entity getTongueTarget();
/**
* Sets the tongue target of this frog.
*
* @param target tongue target or null to clear
*/
void setTongueTarget(@Nullable Entity target);
/**
* Get the variant of this frog.
*
* @return frog variant
*/
@NotNull
Variant getVariant();
/**
* Set the variant of this frog.
*
* @param variant frog variant
*/
void setVariant(@NotNull Variant variant);
/**
* Represents the variant of a frog - ie its color.
*/
public enum Variant implements Keyed {
/**
* Temperate (brown-orange) frog.
*/
TEMPERATE,
/**
* Warm (gray) frog.
*/
WARM,
/**
* Cold (green) frog.
*/
COLD;
private final NamespacedKey key;
private Variant() {
this.key = NamespacedKey.minecraft(name().toLowerCase(Locale.ROOT));
}
@NotNull
@Override
public NamespacedKey getKey() {
return key;
}
}
}

View File

@@ -5,6 +5,34 @@ package org.bukkit.entity;
*/
public interface Goat extends Animals {
/**
* Gets if this goat has its left horn.
*
* @return left horn status
*/
boolean hasLeftHorn();
/**
* Sets if this goat has its left horn.
*
* @param hasHorn left horn status
*/
void setLeftHorn(boolean hasHorn);
/**
* Gets if this goat has its right horn.
*
* @return right horn status
*/
boolean hasRightHorn();
/**
* Sets if this goat has its right horn.
*
* @param hasHorn right horn status
*/
void setRightHorn(boolean hasHorn);
/**
* Gets if this is a screaming goat.
*

View File

@@ -37,5 +37,29 @@ public enum Pose {
/**
* Entity is dead.
*/
DYING;
DYING,
/**
* Entity is croaking.
*/
CROAKING,
/**
* Entity is using its tongue.
*/
USING_TONGUE,
/**
* Entity is roaring.
*/
ROARING,
/**
* Entity is sniffing.
*/
SNIFFING,
/**
* Entity is emerging.
*/
EMERGING,
/**
* Entity is digging.
*/
DIGGING;
}

View File

@@ -0,0 +1,21 @@
package org.bukkit.entity;
/**
* A baby {@link Frog}.
*/
public interface Tadpole extends Fish {
/**
* Gets the age of this mob.
*
* @return Age
*/
public int getAge();
/**
* Sets the age of this mob.
*
* @param age New age
*/
public void setAge(int age);
}

View File

@@ -0,0 +1,38 @@
package org.bukkit.entity;
import org.jetbrains.annotations.NotNull;
/**
* A Warden.
*/
public interface Warden extends Monster {
/**
* Gets the anger level of this warden.
*
* Anger is an integer from 0 to 150. Once a Warden reaches 80 anger at a
* target it will actively pursue it.
*
* @param entity target
* @return anger level
*/
int getAnger(@NotNull Entity entity);
/**
* Increases the anger level of this warden.
*
* @param entity target
* @param increase number to increase by
* @see #getAnger(org.bukkit.entity.Entity)
*/
void increaseAnger(@NotNull Entity entity, int increase);
/**
* Sets the anger level of this warden.
*
* @param entity target
* @param anger new anger level
* @see #getAnger(org.bukkit.entity.Entity)
*/
void setAnger(@NotNull Entity entity, int anger);
}

View File

@@ -65,6 +65,10 @@ public final class MemoryKey<T> implements Keyed {
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);
public static final MemoryKey<UUID> LIKED_PLAYER = new MemoryKey<>(NamespacedKey.minecraft("liked_player"), UUID.class);
public static final MemoryKey<Location> LIKED_NOTEBLOCK_POSITION = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock"), Location.class);
public static final MemoryKey<Integer> LIKED_NOTEBLOCK_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("liked_noteblock_cooldown_ticks"), Integer.class);
public static final MemoryKey<Integer> ITEM_PICKUP_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("item_pickup_cooldown_ticks"), Integer.class);
/**
* Returns a {@link MemoryKey} by a {@link NamespacedKey}.