2016-07-13 16:38:24 +02:00
|
|
|
package net.citizensnpcs.util;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
2023-07-08 15:36:04 +02:00
|
|
|
import java.util.UUID;
|
|
|
|
import java.util.function.Function;
|
2016-07-13 16:38:24 +02:00
|
|
|
|
|
|
|
import org.bukkit.Location;
|
2023-06-19 14:55:16 +02:00
|
|
|
import org.bukkit.Sound;
|
2016-07-13 16:38:24 +02:00
|
|
|
import org.bukkit.World;
|
2016-11-17 10:00:16 +01:00
|
|
|
import org.bukkit.block.Block;
|
2023-01-05 13:05:15 +01:00
|
|
|
import org.bukkit.command.BlockCommandSender;
|
2020-06-27 09:41:47 +02:00
|
|
|
import org.bukkit.entity.Enderman;
|
2016-07-13 16:38:24 +02:00
|
|
|
import org.bukkit.entity.Entity;
|
|
|
|
import org.bukkit.entity.FishHook;
|
|
|
|
import org.bukkit.entity.LivingEntity;
|
2019-04-24 15:01:22 +02:00
|
|
|
import org.bukkit.entity.Ocelot;
|
2016-07-13 16:38:24 +02:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.entity.Tameable;
|
|
|
|
import org.bukkit.entity.Wither;
|
|
|
|
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
|
2022-06-12 13:49:21 +02:00
|
|
|
import org.bukkit.inventory.Inventory;
|
2022-06-11 19:37:38 +02:00
|
|
|
import org.bukkit.inventory.InventoryView;
|
2022-12-03 11:21:46 +01:00
|
|
|
import org.bukkit.inventory.ItemStack;
|
2016-07-13 16:38:24 +02:00
|
|
|
import org.bukkit.inventory.meta.SkullMeta;
|
2020-03-03 16:31:04 +01:00
|
|
|
import org.bukkit.scoreboard.Team;
|
2016-08-02 18:13:21 +02:00
|
|
|
import org.bukkit.util.Vector;
|
2016-07-13 16:38:24 +02:00
|
|
|
|
|
|
|
import com.mojang.authlib.GameProfile;
|
|
|
|
import com.mojang.authlib.GameProfileRepository;
|
|
|
|
|
|
|
|
import net.citizensnpcs.api.ai.NavigatorParameters;
|
2016-12-26 17:38:59 +01:00
|
|
|
import net.citizensnpcs.api.command.CommandManager;
|
2016-07-13 16:38:24 +02:00
|
|
|
import net.citizensnpcs.api.command.exception.CommandException;
|
2022-12-03 11:21:46 +01:00
|
|
|
import net.citizensnpcs.api.jnbt.CompoundTag;
|
2016-11-17 10:00:16 +01:00
|
|
|
import net.citizensnpcs.api.npc.BlockBreaker;
|
|
|
|
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
2016-07-13 16:38:24 +02:00
|
|
|
import net.citizensnpcs.api.npc.NPC;
|
|
|
|
import net.citizensnpcs.api.npc.NPCRegistry;
|
2020-06-30 14:39:40 +02:00
|
|
|
import net.citizensnpcs.api.util.BoundingBox;
|
2023-01-03 13:55:27 +01:00
|
|
|
import net.citizensnpcs.api.util.EntityDim;
|
2016-07-13 16:38:24 +02:00
|
|
|
import net.citizensnpcs.npc.ai.MCNavigationStrategy.MCNavigator;
|
|
|
|
import net.citizensnpcs.npc.ai.MCTargetStrategy.TargetNavigator;
|
|
|
|
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
2023-07-08 15:36:04 +02:00
|
|
|
import net.citizensnpcs.trait.MirrorTrait;
|
2022-12-18 06:25:08 +01:00
|
|
|
import net.citizensnpcs.trait.versioned.CamelTrait.CamelPose;
|
2023-03-14 20:37:05 +01:00
|
|
|
import net.citizensnpcs.trait.versioned.SnifferTrait.SnifferState;
|
2023-04-03 16:40:04 +02:00
|
|
|
import net.citizensnpcs.util.EntityPacketTracker.PacketAggregator;
|
2016-07-13 16:38:24 +02:00
|
|
|
|
|
|
|
public interface NMSBridge {
|
2022-12-18 17:36:53 +01:00
|
|
|
default void activate(Entity entity) {
|
|
|
|
};
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public boolean addEntityToWorld(Entity entity, SpawnReason custom);
|
|
|
|
|
|
|
|
public void addOrRemoveFromPlayerList(Entity entity, boolean remove);
|
|
|
|
|
|
|
|
public void attack(LivingEntity attacker, LivingEntity target);
|
|
|
|
|
2022-02-02 14:40:19 +01:00
|
|
|
public void cancelMoveDestination(Entity entity);
|
|
|
|
|
2023-04-03 16:40:04 +02:00
|
|
|
public default Iterable<Object> createBundlePacket(List<Object> packets) {
|
|
|
|
return packets;
|
2023-01-03 13:55:27 +01:00
|
|
|
}
|
|
|
|
|
2023-04-16 19:47:32 +02:00
|
|
|
public EntityPacketTracker createPacketTracker(Entity entity, PacketAggregator agg);;
|
2023-04-03 16:40:04 +02:00
|
|
|
|
2019-04-25 09:43:44 +02:00
|
|
|
public GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) throws Throwable;
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2016-11-17 10:00:16 +01:00
|
|
|
public BlockBreaker getBlockBreaker(Entity entity, Block targetBlock, BlockBreakerConfiguration config);
|
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default Object getBossBar(Entity entity) {
|
|
|
|
throw new UnsupportedOperationException();
|
|
|
|
}
|
2019-12-11 17:13:54 +01:00
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public BoundingBox getBoundingBox(Entity handle);
|
|
|
|
|
2020-06-30 14:39:40 +02:00
|
|
|
public BoundingBox getCollisionBox(Block block);
|
|
|
|
|
2022-02-19 09:36:31 +01:00
|
|
|
public Location getDestination(Entity entity);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public GameProfileRepository getGameProfileRepository();
|
|
|
|
|
2016-12-11 10:12:29 +01:00
|
|
|
public float getHeadYaw(Entity entity);
|
|
|
|
|
2020-07-06 02:42:46 +02:00
|
|
|
public double getHeight(Entity entity);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public float getHorizontalMovement(Entity entity);
|
|
|
|
|
2023-04-03 16:40:04 +02:00
|
|
|
public CompoundTag getNBT(ItemStack item);;
|
2022-12-03 11:21:46 +01:00
|
|
|
|
2023-04-03 16:40:04 +02:00
|
|
|
public NPC getNPC(Entity entity);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-04-16 19:47:32 +02:00
|
|
|
public EntityPacketTracker getPacketTracker(Entity entity);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public List<Entity> getPassengers(Entity entity);
|
|
|
|
|
2022-12-24 18:37:54 +01:00
|
|
|
public GameProfile getProfile(Player player);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public GameProfile getProfile(SkullMeta meta);
|
|
|
|
|
2023-06-19 14:55:16 +02:00
|
|
|
public String getSoundPath(Sound flag) throws CommandException;
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-01-05 13:05:15 +01:00
|
|
|
public Entity getSource(BlockCommandSender sender);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public float getSpeedFor(NPC npc);
|
|
|
|
|
|
|
|
public float getStepHeight(Entity entity);
|
|
|
|
|
|
|
|
public TargetNavigator getTargetNavigator(Entity handle, Entity target, NavigatorParameters parameters);
|
|
|
|
|
2016-08-02 18:13:21 +02:00
|
|
|
public MCNavigator getTargetNavigator(Entity entity, Iterable<Vector> dest, NavigatorParameters params);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public MCNavigator getTargetNavigator(Entity entity, Location dest, NavigatorParameters params);
|
|
|
|
|
|
|
|
public Entity getVehicle(Entity entity);
|
|
|
|
|
|
|
|
public float getVerticalMovement(Entity entity);
|
|
|
|
|
2020-07-06 02:42:46 +02:00
|
|
|
public double getWidth(Entity entity);
|
|
|
|
|
2020-04-30 13:11:56 +02:00
|
|
|
public float getYaw(Entity entity);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public boolean isOnGround(Entity entity);
|
|
|
|
|
2021-04-30 04:31:25 +02:00
|
|
|
public boolean isSolid(Block in);
|
|
|
|
|
2019-10-03 07:14:20 +02:00
|
|
|
public boolean isValid(Entity entity);
|
|
|
|
|
2016-12-26 17:38:59 +01:00
|
|
|
public void load(CommandManager commands);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void look(Entity from, Entity to);
|
|
|
|
|
|
|
|
public void look(Entity entity, float yaw, float pitch);
|
|
|
|
|
2016-12-16 10:03:11 +01:00
|
|
|
public void look(Entity entity, Location to, boolean headOnly, boolean immediate);
|
2016-11-22 09:04:48 +01:00
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void mount(Entity entity, Entity passenger);
|
|
|
|
|
2023-07-08 15:36:04 +02:00
|
|
|
public default void onPlayerInfoAdd(Player player, Object source, Function<UUID, MirrorTrait> mirrorTraits) {
|
2022-12-29 16:26:02 +01:00
|
|
|
}
|
|
|
|
|
2022-07-29 03:15:15 +02:00
|
|
|
public InventoryView openAnvilInventory(Player player, Inventory anvil, String title);
|
2022-06-12 13:49:21 +02:00
|
|
|
|
2018-02-03 01:56:09 +01:00
|
|
|
public void openHorseScreen(Tameable horse, Player equipper);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
|
|
|
public void playAnimation(PlayerAnimation animation, Player player, int radius);
|
|
|
|
|
2023-01-01 08:26:35 +01:00
|
|
|
public Runnable playerTicker(Player entity);
|
2020-04-29 14:56:39 +02:00
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void registerEntityClass(Class<?> clazz);
|
|
|
|
|
2019-02-05 11:12:02 +01:00
|
|
|
public void remove(Entity entity);
|
|
|
|
|
2023-04-16 19:47:32 +02:00
|
|
|
public void removeFromServerPlayerList(Player player);;
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-04-16 19:47:32 +02:00
|
|
|
public void removeFromWorld(org.bukkit.entity.Entity entity);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-04-03 16:40:04 +02:00
|
|
|
public void removeHookIfNecessary(NPCRegistry npcRegistry, FishHook entity);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-03-07 16:58:03 +01:00
|
|
|
public void replaceTrackerEntry(Entity entity);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-04-29 18:18:24 +02:00
|
|
|
public void sendPositionUpdate(Entity from, boolean position, Float bodyYaw, Float pitch, Float headYaw);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-01-01 08:26:35 +01:00
|
|
|
public boolean sendTabListAdd(Player recipient, Player listPlayer);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2022-12-29 16:26:02 +01:00
|
|
|
public void sendTabListRemove(Player recipient, Collection<? extends SkinnableEntity> skinnableNPCs);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
|
|
|
public void sendTabListRemove(Player recipient, Player listPlayer);
|
|
|
|
|
2022-12-24 18:37:54 +01:00
|
|
|
public void sendTeamPacket(Player recipient, Team team, int mode);
|
2020-04-30 14:51:10 +02:00
|
|
|
|
2023-01-16 16:54:21 +01:00
|
|
|
default public void setAggressive(Entity entity, boolean aggro) {
|
2023-04-16 19:47:32 +02:00
|
|
|
};
|
2023-01-16 16:54:21 +01:00
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default void setAllayDancing(Entity entity, boolean dancing) {
|
|
|
|
throw new UnsupportedOperationException();
|
2023-04-16 19:47:32 +02:00
|
|
|
};
|
2022-07-28 00:36:51 +02:00
|
|
|
|
2023-04-03 16:40:04 +02:00
|
|
|
public void setBodyYaw(Entity entity, float yaw);;
|
2023-01-03 13:55:27 +01:00
|
|
|
|
2023-04-16 19:47:32 +02:00
|
|
|
public void setBoundingBox(Entity entity, BoundingBox box);
|
2020-03-21 11:30:52 +01:00
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default void setCamelPose(Entity entity, CamelPose pose) {
|
|
|
|
throw new UnsupportedOperationException();
|
2023-01-05 13:05:15 +01:00
|
|
|
};
|
2022-12-18 06:25:08 +01:00
|
|
|
|
2023-04-03 16:40:04 +02:00
|
|
|
public void setCustomName(Entity entity, Object component, String string);
|
2022-11-29 23:13:55 +01:00
|
|
|
|
2023-04-16 19:47:32 +02:00
|
|
|
public void setDestination(Entity entity, double x, double y, double z, float speed);
|
2023-01-03 13:55:27 +01:00
|
|
|
|
2023-04-03 16:40:04 +02:00
|
|
|
public void setDimensions(Entity entity, EntityDim desired);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-01-16 16:54:21 +01:00
|
|
|
public void setEndermanAngry(Enderman enderman, boolean angry);
|
2020-06-27 09:41:47 +02:00
|
|
|
|
2023-01-05 13:05:15 +01:00
|
|
|
public void setHeadYaw(Entity entity, float yaw);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-01-03 13:55:27 +01:00
|
|
|
public void setKnockbackResistance(LivingEntity entity, double d);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-02-21 15:56:50 +01:00
|
|
|
public void setLocationDirectly(Entity entity, Location location);
|
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default void setLyingDown(Entity cat, boolean lying) {
|
|
|
|
throw new UnsupportedOperationException();
|
2023-01-03 13:55:27 +01:00
|
|
|
}
|
2019-12-11 17:13:54 +01:00
|
|
|
|
2023-01-01 08:26:35 +01:00
|
|
|
public void setNavigationTarget(Entity handle, Entity target, float speed);
|
2016-07-13 16:38:24 +02:00
|
|
|
|
2023-01-03 13:55:27 +01:00
|
|
|
public void setNoGravity(Entity entity, boolean nogravity);
|
2020-03-02 07:51:54 +01:00
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default void setPandaSitting(Entity entity, boolean sitting) {
|
|
|
|
throw new UnsupportedOperationException();
|
2023-01-01 08:26:35 +01:00
|
|
|
}
|
2020-02-21 13:28:57 +01:00
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default void setPeekShulker(Entity entity, int peek) {
|
|
|
|
throw new UnsupportedOperationException();
|
2022-12-29 16:26:02 +01:00
|
|
|
}
|
2018-04-08 18:17:17 +02:00
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default void setPiglinDancing(Entity entity, boolean dancing) {
|
|
|
|
throw new UnsupportedOperationException();
|
2022-12-18 17:36:53 +01:00
|
|
|
}
|
2022-07-07 17:34:15 +02:00
|
|
|
|
2022-12-24 18:37:54 +01:00
|
|
|
public void setPitch(Entity entity, float pitch);
|
2022-04-24 13:22:55 +02:00
|
|
|
|
2022-12-18 06:25:08 +01:00
|
|
|
public default void setPolarBearRearing(Entity entity, boolean rearing) {
|
|
|
|
throw new UnsupportedOperationException();
|
2022-12-18 17:36:53 +01:00
|
|
|
}
|
2020-12-17 06:13:23 +01:00
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void setProfile(SkullMeta meta, GameProfile profile);
|
|
|
|
|
|
|
|
public void setShouldJump(Entity entity);
|
|
|
|
|
2019-04-24 15:01:22 +02:00
|
|
|
public void setSitting(Ocelot ocelot, boolean sitting);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void setSitting(Tameable tameable, boolean sitting);
|
|
|
|
|
2021-09-20 14:59:54 +02:00
|
|
|
public void setSneaking(Entity entity, boolean sneaking);
|
|
|
|
|
2023-03-14 20:37:05 +01:00
|
|
|
public default void setSnifferState(Entity entity, SnifferState state) {
|
|
|
|
}
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void setStepHeight(Entity entity, float height);
|
|
|
|
|
2023-04-08 08:43:03 +02:00
|
|
|
public default void setTeamNameTagVisible(Team team, boolean visible) {
|
|
|
|
team.setOption(Team.Option.NAME_TAG_VISIBILITY, visible ? Team.OptionStatus.ALWAYS : Team.OptionStatus.NEVER);
|
|
|
|
}
|
2020-03-03 16:31:04 +01:00
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void setVerticalMovement(Entity bukkitEntity, double d);
|
|
|
|
|
|
|
|
public void setWitherCharged(Wither wither, boolean charged);
|
|
|
|
|
|
|
|
public boolean shouldJump(Entity entity);
|
|
|
|
|
2016-11-21 18:00:52 +01:00
|
|
|
public void shutdown();
|
|
|
|
|
2022-10-25 11:07:11 +02:00
|
|
|
public void sleep(Player entity, boolean sleep);
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void trySwim(Entity entity);
|
|
|
|
|
|
|
|
public void trySwim(Entity entity, float power);
|
|
|
|
|
2022-06-11 19:37:38 +02:00
|
|
|
public void updateInventoryTitle(Player player, InventoryView view, String newTitle);
|
|
|
|
|
2023-08-27 19:49:14 +02:00
|
|
|
public default void updateMountedInteractionHeight(Entity entity, Entity mount, double height) {
|
|
|
|
}
|
|
|
|
|
2016-07-13 16:38:24 +02:00
|
|
|
public void updateNavigationWorld(Entity entity, World world);
|
|
|
|
|
2023-08-27 19:49:14 +02:00
|
|
|
public void updatePathfindingRange(NPC npc, float pathfindingRange);;
|
2016-07-13 16:38:24 +02:00
|
|
|
}
|