Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: MiniDigger | Martin <admin@minidigger.dev>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
Nassim Jahnke
2025-04-12 17:26:44 +02:00
parent 0767902699
commit f00727c57e
2092 changed files with 50551 additions and 48729 deletions

View File

@ -3,10 +3,12 @@ package org.bukkit.entity;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import io.papermc.paper.datacomponent.DataComponentView;
import io.papermc.paper.entity.LookAnchor;
import org.bukkit.Chunk; // Paper
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Nameable;
import org.bukkit.Server;
import org.bukkit.Sound;
@ -33,7 +35,7 @@ import org.jetbrains.annotations.Nullable;
* Not all methods are guaranteed to work/may have side effects when
* {@link #isInWorld()} is false.
*/
public interface Entity extends Metadatable, CommandSender, Nameable, PersistentDataHolder, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, net.kyori.adventure.sound.Sound.Emitter { // Paper
public interface Entity extends Metadatable, CommandSender, Nameable, PersistentDataHolder, net.kyori.adventure.text.event.HoverEventSource<net.kyori.adventure.text.event.HoverEvent.ShowEntity>, net.kyori.adventure.sound.Sound.Emitter, DataComponentView { // Paper
/**
* Gets the entity's current position
@ -337,7 +339,6 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
boolean isFrozen();
// Paper start - missing entity api
/**
* Sets whether the entity is invisible or not.
* <p>
@ -347,14 +348,14 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*
* @param invisible If the entity is invisible
*/
void setInvisible(boolean invisible); // Paper - moved up from LivingEntity
void setInvisible(boolean invisible);
/**
* Gets whether the entity is invisible or not.
*
* @return Whether the entity is invisible
*/
boolean isInvisible(); // Paper - moved up from LivingEntity
boolean isInvisible();
/**
* Sets this entities no physics status.
@ -369,9 +370,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return true if the entity does not have physics.
*/
boolean hasNoPhysics();
// Paper end - missing entity api
// Paper start - Freeze Tick Lock API
/**
* Gets if the entity currently has its freeze ticks locked
* to a set amount.
@ -389,12 +388,11 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @param locked prevent vanilla modification or not
*/
void lockFreezeTicks(boolean locked);
// Paper end - Freeze Tick Lock API
/**
* Mark the entity's removal.
*
* @throws UnsupportedOperationException if you try to remove a {@link Player} use {@link Player#kickPlayer(String)} in this case instead
* @throws UnsupportedOperationException if you try to remove a {@link Player} use {@link Player#kick(net.kyori.adventure.text.Component)} in this case instead
*/
public void remove();
@ -533,6 +531,7 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @param event a {@link EntityDamageEvent}
* @deprecated method is for internal use only and will be removed
*/
@ApiStatus.Internal
@Deprecated(since = "1.20.4", forRemoval = true)
public void setLastDamageCause(@Nullable EntityDamageEvent event);
@ -1029,23 +1028,43 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
/**
* Check if entity is in bubble column
*
* @deprecated check the block at the position of the entity
*/
boolean isInBubbleColumn();
@Deprecated(since = "1.21.5")
default boolean isInBubbleColumn() {
return this.getWorld().getBlockAt(this.getLocation()).getType() == Material.BUBBLE_COLUMN;
}
/**
* Check if entity is in water or rain
*
* @deprecated use {@link #isInWater()}} and {@link #isInRain()}
*/
boolean isInWaterOrRain();
@Deprecated(since = "1.21.5")
default boolean isInWaterOrRain() {
return this.isInWater() || this.isInRain();
}
/**
* Check if entity is in water or bubble column
*
* @deprecated use {@link #isInWater()}, bubble column is considered as water
*/
boolean isInWaterOrBubbleColumn();
@Deprecated(since = "1.21.5")
default boolean isInWaterOrBubbleColumn() {
return this.isInWater();
}
/**
* Check if entity is in water or rain or bubble column
*
* @deprecated use {@link #isInWaterOrRain()}, bubble column is considered as water
*/
boolean isInWaterOrRainOrBubbleColumn();
@Deprecated(since = "1.21.5")
default boolean isInWaterOrRainOrBubbleColumn() {
return this.isInWaterOrRain();
}
/**
* Check if entity is in lava