mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 03:55:30 +01:00
Initial 1.20.2 update
This commit is contained in:
parent
97ddf858ce
commit
05048be1f7
8
dist/pom.xml
vendored
8
dist/pom.xml
vendored
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
@ -93,7 +93,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>citizens-v1_20_R1</artifactId>
|
||||
<artifactId>citizens-v1_20_R2</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
@ -189,7 +189,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>citizens-v1_20_R1</artifactId>
|
||||
<artifactId>citizens-v1_20_R2</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
@ -208,7 +208,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>citizens-v1_20_R1</artifactId>
|
||||
<artifactId>citizens-v1_20_R2</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
|
@ -4,12 +4,12 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-main</artifactId>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<craftbukkit.version>1.20.1-R0.1-SNAPSHOT</craftbukkit.version>
|
||||
<craftbukkit.version>1.20.2-R0.1-SNAPSHOT</craftbukkit.version>
|
||||
<placeholderapi.version>2.11.2</placeholderapi.version>
|
||||
<citizensapi.version>${project.version}</citizensapi.version>
|
||||
<worldguard.version>7.1.0-SNAPSHOT</worldguard.version>
|
||||
|
@ -30,7 +30,6 @@ import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.io.Files;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
|
||||
import ch.ethz.globis.phtree.PhTreeHelper;
|
||||
import net.byteflux.libby.BukkitLibraryManager;
|
||||
@ -64,6 +63,7 @@ import net.citizensnpcs.api.trait.TraitInfo;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.NBTStorage;
|
||||
import net.citizensnpcs.api.util.Placeholders;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.api.util.Storage;
|
||||
import net.citizensnpcs.api.util.Translator;
|
||||
import net.citizensnpcs.api.util.YamlStorage;
|
||||
@ -87,6 +87,7 @@ import net.citizensnpcs.trait.ShopTrait;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.PlayerUpdateTask;
|
||||
import net.citizensnpcs.util.SkinProperty;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
@ -108,9 +109,8 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
|
||||
@Override
|
||||
public String getTexture(SkullMeta meta) {
|
||||
GameProfile profile = NMS.getProfile(meta);
|
||||
return profile == null ? null
|
||||
: Iterables.getFirst(profile.getProperties().get("textures"), new Property("", "")).getValue();
|
||||
SkinProperty sp = SkinProperty.fromMojangProfile(NMS.getProfile(meta));
|
||||
return sp == null ? null : sp.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -134,7 +134,8 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
profile = new GameProfile(UUID.randomUUID(), null);
|
||||
}
|
||||
}
|
||||
profile.getProperties().put("textures", new Property("textures", texture));
|
||||
profile.getProperties().put("textures",
|
||||
new com.mojang.authlib.properties.Property("textures", texture, null));
|
||||
NMS.setProfile(meta, profile);
|
||||
}
|
||||
|
||||
@ -382,7 +383,7 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
config = new Settings(getDataFolder());
|
||||
setupTranslator();
|
||||
// Disable if the server is not using the compatible Minecraft version
|
||||
String mcVersion = Util.getMinecraftRevision();
|
||||
String mcVersion = SpigotUtil.getMinecraftPackage();
|
||||
try {
|
||||
NMS.loadBridge(mcVersion);
|
||||
} catch (Exception e) {
|
||||
|
@ -52,6 +52,7 @@ import net.citizensnpcs.trait.MirrorTrait;
|
||||
import net.citizensnpcs.trait.RotationTrait;
|
||||
import net.citizensnpcs.trait.RotationTrait.PacketRotationSession;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.SkinProperty;
|
||||
|
||||
public class ProtocolLibListener implements Listener {
|
||||
private final Class<?> flagsClass;
|
||||
@ -152,9 +153,10 @@ public class ProtocolLibListener implements Listener {
|
||||
npcInfo.getProfile().getProperties().clear();
|
||||
for (String key : playerProfile.getProperties().keySet()) {
|
||||
npcInfo.getProfile().getProperties().putAll(key,
|
||||
Iterables.transform(playerProfile.getProperties().get(key),
|
||||
skin -> new WrappedSignedProperty(skin.getName(), skin.getValue(),
|
||||
skin.getSignature())));
|
||||
Iterables.transform(playerProfile.getProperties().get(key), skin -> {
|
||||
SkinProperty sp = SkinProperty.fromMojang(skin);
|
||||
return new WrappedSignedProperty(sp.name, sp.value, sp.signature);
|
||||
}));
|
||||
}
|
||||
changed = true;
|
||||
}
|
||||
@ -219,7 +221,6 @@ public class ProtocolLibListener implements Listener {
|
||||
Messaging.debug("OVERWRITTEN " + type + " " + packet.getHandle());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private NPC getNPCFromPacket(PacketEvent event) {
|
||||
|
@ -183,6 +183,9 @@ public class Settings {
|
||||
KEEP_CHUNKS_LOADED("Whether to keep NPC chunks loaded", "npc.chunks.always-keep-loaded", false),
|
||||
LOCALE("Controls translation files - defaults to your system language, set to en if English required",
|
||||
"general.translation.locale", ""),
|
||||
MAX_CONTROLLABLE_FLIGHT_SPEED(
|
||||
"The maximum flying speed that controllable NPCs can reach, in Minecraft velocity units",
|
||||
"npc.controllable.max-flying-speed", 0.75),
|
||||
MAX_CONTROLLABLE_GROUND_SPEED("The maximum speed that controllable NPCs can reach, in Minecraft velocity units",
|
||||
"npc.controllable.max-ground-speed", 0.5),
|
||||
MAX_NPC_LIMIT_CHECKS(
|
||||
@ -267,7 +270,7 @@ public class Settings {
|
||||
"Whether to use the Citizens pathfinder instead of the Minecraft pathfinder<br>Much more flexible, but may have different performance characteristics",
|
||||
"npc.pathfinding.use-new-finder", false),
|
||||
USE_SCOREBOARD_TEAMS("npc.scoreboard-teams.enable", true),
|
||||
WARN_ON_RELOAD("general.reload-warning-enabled", true);
|
||||
WARN_ON_RELOAD("general.reload-warning-enabled", true),;
|
||||
|
||||
protected String comments;
|
||||
private Duration duration;
|
||||
|
@ -473,21 +473,25 @@ public class NPCCommands {
|
||||
} else if (action.equalsIgnoreCase("add")) {
|
||||
if (args.argsLength() == 2)
|
||||
throw new CommandUsageException();
|
||||
|
||||
if (args.hasFlag('o') && !sender.hasPermission("citizens.admin"))
|
||||
throw new NoPermissionsException();
|
||||
|
||||
String command = args.getJoinedStrings(2);
|
||||
CommandTrait.Hand hand = args.hasFlag('l') && args.hasFlag('r') ? CommandTrait.Hand.BOTH
|
||||
: args.hasFlag('l') ? CommandTrait.Hand.LEFT : CommandTrait.Hand.RIGHT;
|
||||
if (args.hasFlag('s') && hand != CommandTrait.Hand.BOTH) {
|
||||
hand = hand == CommandTrait.Hand.LEFT ? CommandTrait.Hand.SHIFT_LEFT : CommandTrait.Hand.SHIFT_RIGHT;
|
||||
}
|
||||
|
||||
List<String> perms = Lists.newArrayList();
|
||||
if (permissions != null) {
|
||||
perms.addAll(Arrays.asList(permissions.split(",")));
|
||||
}
|
||||
if (command.toLowerCase().startsWith("npc select")) {
|
||||
|
||||
if (command.toLowerCase().startsWith("npc select"))
|
||||
throw new CommandException("npc select not currently supported within commands. Use --id <id> instead");
|
||||
}
|
||||
|
||||
try {
|
||||
int id = commands.addCommand(new NPCCommandBuilder(command, hand).addPerms(perms)
|
||||
.player(args.hasFlag('p') || args.hasFlag('o')).op(args.hasFlag('o')).cooldown(cooldown)
|
||||
@ -506,7 +510,7 @@ public class NPCCommands {
|
||||
throw new CommandException(Messages.NPC_COMMAND_INVALID_ERROR_MESSAGE,
|
||||
Util.listValuesPretty(CommandTraitError.values()));
|
||||
|
||||
commands.clearHistory(which, args.argsLength() > 3 ? args.getString(3) : args.getString(3));
|
||||
commands.clearHistory(which, args.argsLength() > 3 ? args.getString(3) : null);
|
||||
Messaging.send(sender, Messages.NPC_COMMAND_ERRORS_CLEARED, Util.prettyEnum(which));
|
||||
} else if (action.equalsIgnoreCase("sequential")) {
|
||||
commands.setExecutionMode(commands.getExecutionMode() == ExecutionMode.SEQUENTIAL ? ExecutionMode.LINEAR
|
||||
@ -990,16 +994,23 @@ public class NPCCommands {
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "follow (player name|NPC id) (-p[rotect])",
|
||||
usage = "follow (player name|NPC id) (-p[rotect]) (--margin [margin])",
|
||||
desc = "Toggles NPC following you",
|
||||
flags = "p",
|
||||
modifiers = { "follow" },
|
||||
min = 1,
|
||||
max = 2,
|
||||
permission = "citizens.npc.follow")
|
||||
public void follow(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
public void follow(CommandContext args, CommandSender sender, NPC npc, @Flag("margin") Double margin)
|
||||
throws CommandException {
|
||||
boolean protect = args.hasFlag('p');
|
||||
FollowTrait trait = npc.getOrAddTrait(FollowTrait.class);
|
||||
if (margin != null) {
|
||||
trait.setFollowingMargin(margin);
|
||||
Messaging.sendTr(sender, Messages.FOLLOW_MARGIN_SET, npc.getName(), margin);
|
||||
return;
|
||||
}
|
||||
|
||||
trait.setProtect(protect);
|
||||
String name = sender.getName();
|
||||
if (args.argsLength() > 1) {
|
||||
@ -2092,14 +2103,15 @@ public class NPCCommands {
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "pathto me | here | cursor | [x] [y] [z]",
|
||||
usage = "pathto me | here | cursor | [x] [y] [z] (--margin [distance margin])",
|
||||
desc = "Starts pathfinding to a certain location",
|
||||
modifiers = { "pathto" },
|
||||
min = 2,
|
||||
max = 4,
|
||||
permission = "citizens.npc.pathto")
|
||||
public void pathto(CommandContext args, CommandSender sender, NPC npc,
|
||||
@Arg(value = 1, completions = { "me", "here", "cursor" }) String option) throws CommandException {
|
||||
@Arg(value = 1, completions = { "me", "here", "cursor" }) String option, @Flag("margin") Double margin)
|
||||
throws CommandException {
|
||||
Location loc = npc.getStoredLocation();
|
||||
if (args.argsLength() == 2) {
|
||||
if ((option.equalsIgnoreCase("me") || option.equalsIgnoreCase("here"))) {
|
||||
@ -2115,6 +2127,9 @@ public class NPCCommands {
|
||||
loc.setZ(args.getDouble(3));
|
||||
}
|
||||
npc.getNavigator().setTarget(loc);
|
||||
if (margin != null) {
|
||||
npc.getNavigator().getLocalParameters().distanceMargin(margin);
|
||||
}
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -2816,13 +2831,13 @@ public class NPCCommands {
|
||||
|
||||
return;
|
||||
} else if (url != null || file != null) {
|
||||
Messaging.sendTr(sender, Messages.FETCHING_SKIN, file);
|
||||
Messaging.sendTr(sender, Messages.FETCHING_SKIN, url == null ? file : url);
|
||||
Bukkit.getScheduler().runTaskAsynchronously(CitizensAPI.getPlugin(), () -> {
|
||||
try {
|
||||
JSONObject data = null;
|
||||
if (file != null) {
|
||||
File skinsFolder = new File(CitizensAPI.getDataFolder(), "skins");
|
||||
File skin = new File(skinsFolder, file);
|
||||
File skin = new File(skinsFolder, Placeholders.replace(file, sender, npc));
|
||||
if (!skin.exists() || !skin.isFile() || skin.isHidden()
|
||||
|| !skin.getParentFile().equals(skinsFolder)) {
|
||||
Bukkit.getScheduler().runTask(CitizensAPI.getPlugin(),
|
||||
@ -2832,8 +2847,10 @@ public class NPCCommands {
|
||||
data = MojangSkinGenerator.generateFromPNG(Files.readAllBytes(skin.toPath()),
|
||||
args.hasFlag('s'));
|
||||
} else {
|
||||
data = MojangSkinGenerator.generateFromURL(url, args.hasFlag('s'));
|
||||
data = MojangSkinGenerator.generateFromURL(Placeholders.replace(url, sender, npc),
|
||||
args.hasFlag('s'));
|
||||
}
|
||||
|
||||
String uuid = (String) data.get("uuid");
|
||||
JSONObject texture = (JSONObject) data.get("texture");
|
||||
String textureEncoded = (String) texture.get("value");
|
||||
|
@ -14,9 +14,7 @@ import org.bukkit.Bukkit;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.mojang.authlib.Agent;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.GameProfileRepository;
|
||||
import com.mojang.authlib.ProfileLookupCallback;
|
||||
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
@ -122,8 +120,6 @@ class ProfileFetchThread implements Runnable {
|
||||
private void fetchRequests(final Collection<ProfileRequest> requests) {
|
||||
Preconditions.checkNotNull(requests);
|
||||
|
||||
final GameProfileRepository repo = NMS.getGameProfileRepository();
|
||||
|
||||
String[] playerNames = new String[requests.size()];
|
||||
|
||||
int i = 0;
|
||||
@ -131,16 +127,20 @@ class ProfileFetchThread implements Runnable {
|
||||
playerNames[i++] = request.getPlayerName();
|
||||
}
|
||||
|
||||
repo.findProfilesByNames(playerNames, Agent.MINECRAFT, new ProfileLookupCallback() {
|
||||
@Override
|
||||
NMS.findProfilesByNames(playerNames, new ProfileLookupCallback() {
|
||||
@SuppressWarnings("unused")
|
||||
public void onProfileLookupFailed(GameProfile profile, Exception e) {
|
||||
onProfileLookupFailed(profile.getName(), e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProfileLookupFailed(String profileName, Exception e) {
|
||||
if (Messaging.isDebugging()) {
|
||||
Messaging.debug(
|
||||
"Profile lookup for player '" + profile.getName() + "' failed: " + getExceptionMsg(e));
|
||||
Messaging.debug("Profile lookup for player '" + profileName + "' failed: " + getExceptionMsg(e));
|
||||
Messaging.debug(Throwables.getStackTraceAsString(e));
|
||||
}
|
||||
|
||||
ProfileRequest request = findRequest(profile.getName(), requests);
|
||||
ProfileRequest request = findRequest(profileName, requests);
|
||||
if (request == null)
|
||||
return;
|
||||
|
||||
|
@ -14,9 +14,7 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
@ -28,6 +26,7 @@ import net.citizensnpcs.npc.profile.ProfileFetchHandler;
|
||||
import net.citizensnpcs.npc.profile.ProfileFetcher;
|
||||
import net.citizensnpcs.npc.profile.ProfileRequest;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.SkinProperty;
|
||||
|
||||
/**
|
||||
* Stores data for a single skin.
|
||||
@ -39,7 +38,7 @@ public class Skin {
|
||||
private volatile boolean isValid = true;
|
||||
private final Map<SkinnableEntity, Void> pending = new WeakHashMap<SkinnableEntity, Void>(15);
|
||||
private BukkitTask retryTask;
|
||||
private volatile Property skinData;
|
||||
private volatile SkinProperty skinData;
|
||||
private volatile UUID skinId;
|
||||
private final String skinName;
|
||||
|
||||
@ -86,8 +85,7 @@ public class Skin {
|
||||
String cachedName = npc.data().get(CACHED_SKIN_UUID_NAME_METADATA);
|
||||
String texture = skinTrait.getTexture();
|
||||
if (this.skinName.equals(cachedName) && texture != null && !texture.equals("cache")) {
|
||||
Property localData = new Property("textures", texture, skinTrait.getSignature());
|
||||
setNPCTexture(entity, localData);
|
||||
setNPCTexture(entity, new SkinProperty("textures", texture, skinTrait.getSignature()));
|
||||
|
||||
// check if NPC prefers to use cached skin over the latest skin.
|
||||
if (entity.getNPC().data().has("player-skin-use-latest")) {
|
||||
@ -297,7 +295,7 @@ public class Skin {
|
||||
}
|
||||
|
||||
skinId = profile.getId();
|
||||
skinData = Iterables.getFirst(profile.getProperties().get("textures"), null);
|
||||
skinData = SkinProperty.fromMojangProfile(profile);
|
||||
|
||||
List<SkinnableEntity> entities = new ArrayList<SkinnableEntity>(pending.keySet());
|
||||
for (SkinnableEntity entity : entities) {
|
||||
@ -383,7 +381,8 @@ public class Skin {
|
||||
return skin;
|
||||
}
|
||||
|
||||
private static void setNPCSkinData(SkinnableEntity entity, String skinName, UUID skinId, Property skinProperty) {
|
||||
private static void setNPCSkinData(SkinnableEntity entity, String skinName, UUID skinId,
|
||||
SkinProperty skinProperty) {
|
||||
NPC npc = entity.getNPC();
|
||||
SkinTrait skinTrait = npc.getOrAddTrait(SkinTrait.class);
|
||||
|
||||
@ -391,28 +390,26 @@ public class Skin {
|
||||
// for use when the latest skin is not required.
|
||||
npc.data().setPersistent(CACHED_SKIN_UUID_NAME_METADATA, skinName);
|
||||
npc.data().setPersistent(CACHED_SKIN_UUID_METADATA, skinId.toString());
|
||||
if (skinProperty.getValue() != null) {
|
||||
skinTrait.setTexture(skinProperty.getValue(),
|
||||
skinProperty.getSignature() == null ? "" : skinProperty.getSignature());
|
||||
if (skinProperty.value != null) {
|
||||
skinTrait.setTexture(skinProperty.value, skinProperty.signature == null ? "" : skinProperty.signature);
|
||||
setNPCTexture(entity, skinProperty);
|
||||
} else {
|
||||
skinTrait.clearTexture();
|
||||
}
|
||||
}
|
||||
|
||||
private static void setNPCTexture(SkinnableEntity entity, Property skinProperty) {
|
||||
private static void setNPCTexture(SkinnableEntity entity, SkinProperty skinProperty) {
|
||||
GameProfile profile = entity.getProfile();
|
||||
|
||||
// don't set property if already set since this sometimes causes
|
||||
// packet errors that disconnect the client.
|
||||
Property current = Iterables.getFirst(profile.getProperties().get("textures"), null);
|
||||
if (current != null && current.getValue().equals(skinProperty.getValue())
|
||||
&& (current.getSignature() != null && current.getSignature().equals(skinProperty.getSignature()))) {
|
||||
SkinProperty current = SkinProperty.fromMojangProfile(profile);
|
||||
if (current != null && current.value.equals(skinProperty.value) && current.signature != null
|
||||
&& current.signature.equals(skinProperty.signature)) {
|
||||
return;
|
||||
}
|
||||
|
||||
profile.getProperties().removeAll("textures"); // ensure client does not crash due to duplicate properties.
|
||||
profile.getProperties().put("textures", skinProperty);
|
||||
skinProperty.apply(profile);
|
||||
}
|
||||
|
||||
private static final Map<String, Skin> CACHE = new HashMap<String, Skin>(20);
|
||||
|
@ -273,8 +273,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||
return enabled;
|
||||
}
|
||||
|
||||
private double updateHorizontalSpeed(Entity handle, Entity passenger, double speed, float speedMod) {
|
||||
double maxSpeed = Setting.MAX_CONTROLLABLE_GROUND_SPEED.asDouble();
|
||||
private double updateHorizontalSpeed(Entity handle, Entity passenger, double speed, float speedMod,
|
||||
double maxSpeed) {
|
||||
Vector vel = handle.getVelocity();
|
||||
double oldSpeed = Math.sqrt(vel.getX() * vel.getX() + vel.getZ() * vel.getZ());
|
||||
double horizontal = NMS.getHorizontalMovement(passenger);
|
||||
@ -304,7 +304,7 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||
if (newSpeed > oldSpeed && speed < maxSpeed) {
|
||||
return (float) Math.min(maxSpeed, (speed + ((maxSpeed - speed) / 50.0D)));
|
||||
} else {
|
||||
return (float) Math.max(0, (speed - ((speed) / 50.0D)));
|
||||
return (float) Math.max(0, (speed - (speed / 50.0D)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -332,7 +332,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||
.modifiedSpeed((onGround ? GROUND_SPEED : AIR_SPEED));
|
||||
if (!Util.isHorse(npc.getEntity().getType())) {
|
||||
// use minecraft horse physics
|
||||
speed = updateHorizontalSpeed(npc.getEntity(), rider, speed, speedMod);
|
||||
speed = updateHorizontalSpeed(npc.getEntity(), rider, speed, speedMod,
|
||||
Setting.MAX_CONTROLLABLE_GROUND_SPEED.asDouble());
|
||||
}
|
||||
|
||||
boolean shouldJump = NMS.shouldJump(rider);
|
||||
@ -420,11 +421,13 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
|
||||
return;
|
||||
}
|
||||
|
||||
speed = updateHorizontalSpeed(npc.getEntity(), rider, speed, 1F);
|
||||
speed = updateHorizontalSpeed(npc.getEntity(), rider, speed, 1F,
|
||||
Setting.MAX_CONTROLLABLE_FLIGHT_SPEED.asDouble());
|
||||
boolean shouldJump = NMS.shouldJump(rider);
|
||||
if (shouldJump) {
|
||||
npc.getEntity().setVelocity(npc.getEntity().getVelocity().setY(0.25F));
|
||||
}
|
||||
|
||||
npc.getEntity().setVelocity(npc.getEntity().getVelocity().multiply(new Vector(1, 0.98, 1)));
|
||||
setMountedYaw(npc.getEntity());
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ public class FollowTrait extends Trait {
|
||||
@Persist
|
||||
private UUID followingUUID;
|
||||
@Persist
|
||||
private double margin = -1;
|
||||
@Persist
|
||||
private boolean protect;
|
||||
|
||||
public FollowTrait() {
|
||||
@ -50,6 +52,10 @@ public class FollowTrait extends Trait {
|
||||
return entity;
|
||||
}
|
||||
|
||||
public double getFollowingMargin() {
|
||||
return margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the trait is actively following a {@link Entity}.
|
||||
*/
|
||||
@ -109,11 +115,19 @@ public class FollowTrait extends Trait {
|
||||
|
||||
if (!npc.getNavigator().isNavigating()) {
|
||||
npc.getNavigator().setTarget(entity, false);
|
||||
if (margin > 0) {
|
||||
npc.getNavigator().getLocalParameters().distanceMargin(margin);
|
||||
}
|
||||
|
||||
} else {
|
||||
flock.run();
|
||||
}
|
||||
}
|
||||
|
||||
public void setFollowingMargin(double margin) {
|
||||
this.margin = margin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether to protect the followed Entity (similar to wolves in Minecraft, attack whoever attacks the entity).
|
||||
*/
|
||||
|
@ -22,6 +22,7 @@ import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.persistence.Persist;
|
||||
import net.citizensnpcs.api.trait.Trait;
|
||||
import net.citizensnpcs.api.trait.TraitName;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
|
||||
@ -210,7 +211,7 @@ public class ScoreboardTrait extends Trait {
|
||||
}
|
||||
|
||||
if (color != null) {
|
||||
if (SUPPORT_GLOWING_COLOR && Util.getMinecraftRevision().contains("1_12_R1")) {
|
||||
if (SUPPORT_GLOWING_COLOR && SpigotUtil.getMinecraftPackage().contains("1_12_R1")) {
|
||||
SUPPORT_GLOWING_COLOR = false;
|
||||
}
|
||||
if (SUPPORT_GLOWING_COLOR) {
|
||||
|
@ -39,9 +39,9 @@ public class SkinTrait extends Trait {
|
||||
if (skinName == null)
|
||||
return;
|
||||
String filled = ChatColor.stripColor(Placeholders.replace(skinName, null, npc).toLowerCase());
|
||||
Messaging.debug("Filled skin placeholder", filled, "from", skinName);
|
||||
if (!filled.equalsIgnoreCase(skinName) && !filled.equalsIgnoreCase(filledPlaceholder)) {
|
||||
filledPlaceholder = filled;
|
||||
Messaging.debug("Filled skin placeholder", filled, "from", skinName);
|
||||
if (update) {
|
||||
onSkinChange(true);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class EmptyChannel extends AbstractChannel {
|
||||
|
||||
@Override
|
||||
protected boolean isCompatible(EventLoop arg0) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,21 +0,0 @@
|
||||
package net.citizensnpcs.util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
public class EmptySocket extends Socket {
|
||||
@Override
|
||||
public InputStream getInputStream() {
|
||||
return new ByteArrayInputStream(EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OutputStream getOutputStream() {
|
||||
return new ByteArrayOutputStream(5);
|
||||
}
|
||||
|
||||
private static final byte[] EMPTY = new byte[50];
|
||||
}
|
@ -123,6 +123,7 @@ public class Messages {
|
||||
public static final String FETCHING_SKIN = "citizens.commands.npc.skin.fetching";
|
||||
public static final String FLYABLE_SET = "citizens.commands.npc.flyable.set";
|
||||
public static final String FLYABLE_UNSET = "citizens.commands.npc.flyable.unset";
|
||||
public static final String FOLLOW_MARGIN_SET = "citizens.commands.npc.follow.margin-set";
|
||||
public static final String FOLLOW_PLAYER_NOT_INGAME = "citizens.commands.npc.follow.player-not-ingame";
|
||||
public static final String FOLLOW_SET = "citizens.commands.npc.follow.set";
|
||||
public static final String FOLLOW_UNSET = "citizens.commands.npc.follow.unset";
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.citizensnpcs.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
@ -22,7 +21,7 @@ public class MojangSkinGenerator {
|
||||
throws InterruptedException, ExecutionException {
|
||||
return EXECUTOR.submit(() -> {
|
||||
DataOutputStream out = null;
|
||||
BufferedReader reader = null;
|
||||
InputStreamReader reader = null;
|
||||
try {
|
||||
URL target = new URL("https://api.mineskin.org/generate/upload" + (slim ? "?model=slim" : ""));
|
||||
HttpURLConnection con = (HttpURLConnection) target.openConnection();
|
||||
@ -49,15 +48,16 @@ public class MojangSkinGenerator {
|
||||
out.writeBytes("--*****--\r\n");
|
||||
out.flush();
|
||||
out.close();
|
||||
if (con.getResponseCode() != 200) {
|
||||
if (Messaging.isDebugging()) {
|
||||
reader = new BufferedReader(new InputStreamReader(con.getErrorStream()));
|
||||
Messaging.log(new String(CharStreams.toString(reader)));
|
||||
}
|
||||
return null;
|
||||
reader = new InputStreamReader(con.getInputStream());
|
||||
String str = CharStreams.toString(reader);
|
||||
if (Messaging.isDebugging()) {
|
||||
Messaging.debug(str);
|
||||
}
|
||||
reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
JSONObject output = (JSONObject) new JSONParser().parse(reader);
|
||||
|
||||
if (con.getResponseCode() != 200)
|
||||
return null;
|
||||
|
||||
JSONObject output = (JSONObject) new JSONParser().parse(str);
|
||||
JSONObject data = (JSONObject) output.get("data");
|
||||
con.disconnect();
|
||||
return data;
|
||||
@ -82,7 +82,7 @@ public class MojangSkinGenerator {
|
||||
throws InterruptedException, ExecutionException {
|
||||
return EXECUTOR.submit(() -> {
|
||||
DataOutputStream out = null;
|
||||
BufferedReader reader = null;
|
||||
InputStreamReader reader = null;
|
||||
try {
|
||||
URL target = new URL("https://api.mineskin.org/generate/url");
|
||||
HttpURLConnection con = (HttpURLConnection) target.openConnection();
|
||||
@ -103,15 +103,16 @@ public class MojangSkinGenerator {
|
||||
}
|
||||
out.writeBytes(req.toJSONString().replace("\\", ""));
|
||||
out.close();
|
||||
if (con.getResponseCode() != 200) {
|
||||
if (Messaging.isDebugging()) {
|
||||
reader = new BufferedReader(new InputStreamReader(con.getErrorStream()));
|
||||
Messaging.log(new String(CharStreams.toString(reader)));
|
||||
}
|
||||
return null;
|
||||
reader = new InputStreamReader(con.getInputStream());
|
||||
String str = CharStreams.toString(reader);
|
||||
if (Messaging.isDebugging()) {
|
||||
Messaging.debug(str);
|
||||
}
|
||||
reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
JSONObject output = (JSONObject) new JSONParser().parse(reader);
|
||||
|
||||
if (con.getResponseCode() != 200)
|
||||
return null;
|
||||
|
||||
JSONObject output = (JSONObject) new JSONParser().parse(str);
|
||||
JSONObject data = (JSONObject) output.get("data");
|
||||
con.disconnect();
|
||||
return data;
|
||||
|
@ -39,7 +39,7 @@ import org.bukkit.util.Vector;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.GameProfileRepository;
|
||||
import com.mojang.authlib.ProfileLookupCallback;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.ai.NavigatorParameters;
|
||||
@ -167,6 +167,27 @@ public class NMS {
|
||||
return BRIDGE.fillProfileProperties(profile, requireSecure);
|
||||
}
|
||||
|
||||
public static void findProfilesByNames(String[] names, ProfileLookupCallback cb) {
|
||||
if (FIND_PROFILES_BY_NAMES == null) {
|
||||
try {
|
||||
Class<?> agentClass = Class.forName("com.mojang.authlib.Agent");
|
||||
Object minecraftAgent = agentClass.getField("MINECRAFT").get(null);
|
||||
MethodHandle mh = getMethodHandle(BRIDGE.getGameProfileRepository().getClass(), "findProfilesByNames",
|
||||
false, String[].class, agentClass, ProfileLookupCallback.class);
|
||||
FIND_PROFILES_BY_NAMES = MethodHandles.insertArguments(mh, 2, minecraftAgent);
|
||||
} catch (Exception e) {
|
||||
FIND_PROFILES_BY_NAMES = getMethodHandle(BRIDGE.getGameProfileRepository().getClass(),
|
||||
"findProfilesByNames", false, String[].class, ProfileLookupCallback.class);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
FIND_PROFILES_BY_NAMES.invoke(BRIDGE.getGameProfileRepository(), names, cb);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static BlockBreaker getBlockBreaker(Entity entity, Block targetBlock, BlockBreakerConfiguration config) {
|
||||
return BRIDGE.getBlockBreaker(entity, targetBlock, config);
|
||||
}
|
||||
@ -418,10 +439,6 @@ public class NMS {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static GameProfileRepository getGameProfileRepository() {
|
||||
return BRIDGE.getGameProfileRepository();
|
||||
}
|
||||
|
||||
public static MethodHandle getGetter(Class<?> clazz, String name) {
|
||||
return getGetter(clazz, name, true);
|
||||
}
|
||||
@ -625,12 +642,12 @@ public class NMS {
|
||||
public static void loadBridge(String rev) throws Exception {
|
||||
Class<?> entity = null;
|
||||
try {
|
||||
entity = Class.forName("net.minecraft.server.v" + rev + ".Entity");
|
||||
entity = Class.forName("net.minecraft.server." + rev + ".Entity");
|
||||
} catch (ClassNotFoundException ex) {
|
||||
entity = Class.forName("net.minecraft.world.entity.Entity");
|
||||
}
|
||||
giveReflectiveAccess(entity, NMS.class);
|
||||
BRIDGE = (NMSBridge) Class.forName("net.citizensnpcs.nms.v" + rev + ".util.NMSImpl").getConstructor()
|
||||
BRIDGE = (NMSBridge) Class.forName("net.citizensnpcs.nms." + rev + ".util.NMSImpl").getConstructor()
|
||||
.newInstance();
|
||||
}
|
||||
|
||||
@ -883,8 +900,8 @@ public class NMS {
|
||||
}
|
||||
|
||||
private static Method ADD_OPENS;
|
||||
|
||||
private static NMSBridge BRIDGE;
|
||||
private static MethodHandle FIND_PROFILES_BY_NAMES = null;
|
||||
private static Method GET_MODULE;
|
||||
private static MethodHandles.Lookup LOOKUP = MethodHandles.lookup();
|
||||
private static Field MODIFIERS_FIELD;
|
||||
|
@ -84,9 +84,9 @@ public interface NMSBridge {
|
||||
|
||||
public double getHeight(Entity entity);
|
||||
|
||||
public float getHorizontalMovement(Entity entity);
|
||||
public float getHorizontalMovement(Entity entity);;
|
||||
|
||||
public CompoundTag getNBT(ItemStack item);;
|
||||
public CompoundTag getNBT(ItemStack item);
|
||||
|
||||
public NPC getNPC(Entity entity);
|
||||
|
||||
@ -149,9 +149,9 @@ public interface NMSBridge {
|
||||
|
||||
public void registerEntityClass(Class<?> clazz);
|
||||
|
||||
public void remove(Entity entity);
|
||||
public void remove(Entity entity);;
|
||||
|
||||
public void removeFromServerPlayerList(Player player);;
|
||||
public void removeFromServerPlayerList(Player player);
|
||||
|
||||
public void removeFromWorld(org.bukkit.entity.Entity entity);
|
||||
|
||||
@ -167,7 +167,7 @@ public interface NMSBridge {
|
||||
|
||||
public void sendTabListRemove(Player recipient, Player listPlayer);
|
||||
|
||||
public void sendTeamPacket(Player recipient, Team team, int mode);
|
||||
public void sendTeamPacket(Player recipient, Team team, int mode);;
|
||||
|
||||
default public void setAggressive(Entity entity, boolean aggro) {
|
||||
};
|
||||
@ -176,13 +176,13 @@ public interface NMSBridge {
|
||||
throw new UnsupportedOperationException();
|
||||
};
|
||||
|
||||
public void setBodyYaw(Entity entity, float yaw);;
|
||||
public void setBodyYaw(Entity entity, float yaw);
|
||||
|
||||
public void setBoundingBox(Entity entity, BoundingBox box);
|
||||
public void setBoundingBox(Entity entity, BoundingBox box);;
|
||||
|
||||
public default void setCamelPose(Entity entity, CamelPose pose) {
|
||||
throw new UnsupportedOperationException();
|
||||
};
|
||||
}
|
||||
|
||||
public void setCustomName(Entity entity, Object component, String string);
|
||||
|
||||
|
56
main/src/main/java/net/citizensnpcs/util/SkinProperty.java
Normal file
56
main/src/main/java/net/citizensnpcs/util/SkinProperty.java
Normal file
@ -0,0 +1,56 @@
|
||||
package net.citizensnpcs.util;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
|
||||
public class SkinProperty {
|
||||
public final String name;
|
||||
public final String signature;
|
||||
public final String value;
|
||||
|
||||
public SkinProperty(String name, String value, String signature) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public void apply(GameProfile profile) {
|
||||
profile.getProperties().removeAll("textures"); // ensure client does not crash due to duplicate properties.
|
||||
profile.getProperties().put("textures", new com.mojang.authlib.properties.Property(name, value, signature));
|
||||
}
|
||||
|
||||
public static SkinProperty fromMojang(com.mojang.authlib.properties.Property prop) {
|
||||
if (prop == null)
|
||||
return null;
|
||||
if (GET_NAME_METHOD != null) {
|
||||
try {
|
||||
return new SkinProperty((String) GET_NAME_METHOD.invoke(prop), (String) GET_VALUE_METHOD.invoke(prop),
|
||||
(String) GET_SIGNATURE_METHOD.invoke(prop));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return new SkinProperty(prop.name(), prop.value(), prop.signature());
|
||||
}
|
||||
|
||||
public static SkinProperty fromMojangProfile(GameProfile profile) {
|
||||
if (profile == null)
|
||||
return null;
|
||||
Collection<Property> textures = profile.getProperties().get("textures");
|
||||
if (textures == null || textures.size() == 0)
|
||||
return null;
|
||||
return fromMojang(textures.iterator().next());
|
||||
}
|
||||
|
||||
private static MethodHandle GET_NAME_METHOD = null;
|
||||
private static MethodHandle GET_SIGNATURE_METHOD = null;
|
||||
private static MethodHandle GET_VALUE_METHOD = null;
|
||||
static {
|
||||
GET_NAME_METHOD = NMS.getMethodHandle(com.mojang.authlib.properties.Property.class, "getName", false);
|
||||
GET_SIGNATURE_METHOD = NMS.getMethodHandle(com.mojang.authlib.properties.Property.class, "getSignature", false);
|
||||
GET_VALUE_METHOD = NMS.getMethodHandle(com.mojang.authlib.properties.Property.class, "getValue", false);
|
||||
}
|
||||
}
|
@ -236,13 +236,6 @@ public class Util {
|
||||
return new XORShiftRNG();
|
||||
}
|
||||
|
||||
public static String getMinecraftRevision() {
|
||||
if (MINECRAFT_REVISION == null) {
|
||||
MINECRAFT_REVISION = Bukkit.getServer().getClass().getPackage().getName();
|
||||
}
|
||||
return MINECRAFT_REVISION.substring(MINECRAFT_REVISION.lastIndexOf('.') + 2);
|
||||
}
|
||||
|
||||
public static String getTeamName(UUID id) {
|
||||
return "CIT-" + id.toString().replace("-", "").substring(0, 12);
|
||||
}
|
||||
@ -586,7 +579,6 @@ public class Util {
|
||||
}
|
||||
|
||||
private static final Scoreboard DUMMY_SCOREBOARD = Bukkit.getScoreboardManager().getNewScoreboard();
|
||||
private static String MINECRAFT_REVISION;
|
||||
private static final DecimalFormat TWO_DIGIT_DECIMAL = new DecimalFormat();
|
||||
|
||||
static {
|
||||
|
@ -105,6 +105,7 @@ citizens.commands.npc.fox.fox-type-set=Fox type set to [[{0}]].
|
||||
citizens.commands.npc.fox.invalid-fox-type=Invalid fox type specified. Valid types are [[{0}]].
|
||||
citizens.commands.npc.follow.set=[[{0}]] is now following [[{1}]].
|
||||
citizens.commands.npc.follow.unset=[[{0}]] is no longer following anyone.
|
||||
citizens.commands.npc.follow.margin-set=[[{0}]]''s will now follow [[{1}]] blocks away from the target.
|
||||
citizens.commands.npc.frog.invalid-variant=Invalid frog variant. Valid variants are [[{0}]].
|
||||
citizens.commands.npc.frog.variant-set=Variant set to [[{0}]].
|
||||
citizens.commands.npc.gamemode.describe={0}''s gamemode is [[{1}]].
|
||||
|
10
pom.xml
10
pom.xml
@ -6,10 +6,10 @@
|
||||
<packaging>pom</packaging>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
<properties>
|
||||
<BUILD_NUMBER>Unknown</BUILD_NUMBER>
|
||||
<CITIZENS_VERSION>2.0.32</CITIZENS_VERSION>
|
||||
<CITIZENS_VERSION>2.0.33</CITIZENS_VERSION>
|
||||
<maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
|
||||
<maven-assembly-plugin.version>3.5.0</maven-assembly-plugin.version>
|
||||
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
|
||||
@ -44,7 +44,7 @@
|
||||
<module>v1_16_R3</module>
|
||||
<module>v1_18_R2</module>
|
||||
<module>v1_19_R3</module>
|
||||
<module>v1_20_R1</module>
|
||||
<module>v1_20_R2</module>
|
||||
<module>dist</module>
|
||||
</modules>
|
||||
</profile>
|
||||
@ -63,7 +63,7 @@
|
||||
<module>v1_17_R1</module>
|
||||
<module>v1_18_R2</module>
|
||||
<module>v1_19_R3</module>
|
||||
<module>v1_20_R1</module>
|
||||
<module>v1_20_R2</module>
|
||||
<module>dist</module>
|
||||
</modules>
|
||||
</profile>
|
||||
@ -71,7 +71,7 @@
|
||||
<id>dev</id>
|
||||
<modules>
|
||||
<module>main</module>
|
||||
<module>v1_20_R1</module>
|
||||
<module>v1_20_R2</module>
|
||||
<module>dist</module>
|
||||
</modules>
|
||||
</profile>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_10_R1</artifactId>
|
||||
<properties>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.citizensnpcs.nms.v1_10_R1.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -36,7 +35,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_10_R1.AttributeInstance;
|
||||
@ -78,6 +76,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.3);
|
||||
if (npc != null) {
|
||||
skinTracker = new SkinPacketTracker(this);
|
||||
playerInteractManager.setGameMode(EnumGamemode.SURVIVAL);
|
||||
@ -236,13 +235,10 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
NetworkManager conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setPacketListener(playerConnection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
@ -280,7 +276,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(0, 0);
|
||||
}
|
||||
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
|
||||
|
@ -83,8 +83,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
speed.setValue(0.1D * this.e);
|
||||
float movement = (float) (this.e * speed.getValue()) * 10;
|
||||
float movement = (float) (this.e * speed.getValue());
|
||||
this.a.l(movement);
|
||||
this.a.bg = movement;
|
||||
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_11_R1</artifactId>
|
||||
<properties>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.citizensnpcs.nms.v1_11_R1.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -36,7 +35,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_11_R1.AttributeInstance;
|
||||
@ -79,6 +77,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.3D);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
skinTracker = new SkinPacketTracker(this);
|
||||
@ -258,13 +257,10 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
NetworkManager conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setPacketListener(playerConnection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
@ -338,7 +334,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(0, 0);
|
||||
}
|
||||
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
|
||||
|
@ -85,10 +85,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
if (!(this.a instanceof EntitySlime)) {
|
||||
speed.setValue(0.1D * this.e);
|
||||
}
|
||||
float movement = (float) (this.e * speed.getValue()) * 10;
|
||||
float movement = (float) (this.e * speed.getValue());
|
||||
this.a.l(movement);
|
||||
this.a.bf = movement;
|
||||
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_12_R1</artifactId>
|
||||
<properties>
|
||||
|
@ -2,7 +2,6 @@ package net.citizensnpcs.nms.v1_12_R1.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -39,7 +38,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_12_R1.AttributeInstance;
|
||||
@ -82,6 +80,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.3D);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
skinTracker = new SkinPacketTracker(this);
|
||||
@ -267,13 +266,10 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
NetworkManager conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setPacketListener(playerConnection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
@ -355,7 +351,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(0, 0, 0);
|
||||
}
|
||||
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
|
||||
|
@ -48,10 +48,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
if (!(this.a instanceof EntitySlime)) {
|
||||
speed.setValue(0.1D * this.e);
|
||||
}
|
||||
float movement = (float) (this.e * speed.getValue()) * 10;
|
||||
float movement = (float) (this.e * speed.getValue());
|
||||
this.a.k(movement);
|
||||
this.a.bg = movement;
|
||||
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_13_R2</artifactId>
|
||||
<properties>
|
||||
|
@ -2,7 +2,6 @@ package net.citizensnpcs.nms.v1_13_R2.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -39,7 +38,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_13_R2.AttributeInstance;
|
||||
@ -82,6 +80,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.3D);
|
||||
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
skinTracker = new SkinPacketTracker(this);
|
||||
@ -255,15 +255,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
NetworkManager conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setPacketListener(playerConnection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
|
||||
if (range == null) {
|
||||
@ -334,7 +330,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(0, 0, 0);
|
||||
}
|
||||
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
|
||||
|
@ -50,10 +50,7 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
if (!(this.a instanceof EntitySlime)) {
|
||||
speed.setValue(0.1D * this.e);
|
||||
}
|
||||
float movement = (float) (this.e * speed.getValue()) * 10;
|
||||
float movement = (float) (this.e * speed.getValue());
|
||||
this.a.o(movement);
|
||||
this.a.bj = movement;
|
||||
if (shouldSlimeJump() || ((d2 >= NMS.getStepHeight(a.getBukkitEntity())) && (d0 * d0 + d1 * d1 < 1.0D))) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_14_R1</artifactId>
|
||||
<properties>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.citizensnpcs.nms.v1_14_R1.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -38,7 +37,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_14_R1.AttributeInstance;
|
||||
@ -82,6 +80,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.3D);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
skinTracker = new SkinPacketTracker(this);
|
||||
@ -255,15 +254,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
NetworkManager conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setPacketListener(playerConnection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
|
||||
if (range == null) {
|
||||
@ -339,7 +334,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY, getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(new Vec3D(0, 0, 0));
|
||||
}
|
||||
Vec3D mot = getMot();
|
||||
|
@ -49,11 +49,6 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
if (this.a instanceof EntitySlime) {
|
||||
speed.setValue(0.3D * this.e);
|
||||
} else {
|
||||
speed.setValue(0.2D * this.e);
|
||||
}
|
||||
float movement = (float) (this.e * speed.getValue());
|
||||
this.a.o(movement);
|
||||
this.a.bd = movement;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_15_R1</artifactId>
|
||||
<properties>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.citizensnpcs.nms.v1_15_R1.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -37,7 +36,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_15_R1.AttributeInstance;
|
||||
@ -82,6 +80,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.3D);
|
||||
if (npc != null) {
|
||||
skinTracker = new SkinPacketTracker(this);
|
||||
playerInteractManager.setGameMode(EnumGamemode.SURVIVAL);
|
||||
@ -255,13 +254,10 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
NetworkManager conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setPacketListener(playerConnection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
@ -338,7 +334,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(locY(), getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY(), getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(new Vec3D(0, 0, 0));
|
||||
}
|
||||
Vec3D mot = getMot();
|
||||
|
@ -49,7 +49,6 @@ public class PlayerControllerMove extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
speed.setValue(0.3D * this.e);
|
||||
float movement = (float) (this.e * speed.getValue());
|
||||
this.a.o(movement);
|
||||
this.a.bb = movement;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_16_R3</artifactId>
|
||||
<properties>
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.citizensnpcs.nms.v1_16_R3.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -38,7 +37,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.v1_16_R3.AxisAlignedBB;
|
||||
@ -51,6 +49,7 @@ import net.minecraft.server.v1_16_R3.EntityPlayer;
|
||||
import net.minecraft.server.v1_16_R3.EnumGamemode;
|
||||
import net.minecraft.server.v1_16_R3.EnumItemSlot;
|
||||
import net.minecraft.server.v1_16_R3.EnumProtocolDirection;
|
||||
import net.minecraft.server.v1_16_R3.GenericAttributes;
|
||||
import net.minecraft.server.v1_16_R3.IBlockData;
|
||||
import net.minecraft.server.v1_16_R3.IChatBaseComponent;
|
||||
import net.minecraft.server.v1_16_R3.ItemStack;
|
||||
@ -75,6 +74,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, playerInteractManager);
|
||||
this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED).setValue(0.3D);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
@ -235,15 +235,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
NetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
NetworkManager conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
|
||||
playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setPacketListener(playerConnection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
invulnerableTicks = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
@ -312,7 +308,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(locY(), getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(locY(), getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(new Vec3D(0, 0, 0));
|
||||
}
|
||||
Vec3D mot = getMot();
|
||||
|
@ -50,7 +50,6 @@ public class EntityMoveControl extends ControllerMove {
|
||||
this.a.yaw = a(this.a.yaw, f, 90.0F);
|
||||
NMS.setHeadYaw(a.getBukkitEntity(), this.a.yaw);
|
||||
AttributeModifiable speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||
speed.setValue(0.3D * this.e);
|
||||
float movement = (float) (this.e * speed.getValue());
|
||||
this.a.q(movement);
|
||||
this.a.aT = movement;
|
||||
|
@ -2,7 +2,6 @@ package net.citizensnpcs.nms.v1_17_R1.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -36,7 +35,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@ -133,7 +131,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(Vec3.ZERO);
|
||||
}
|
||||
Vec3 mot = getDeltaMovement();
|
||||
@ -256,13 +254,10 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
EmptyNetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(PacketFlow.CLIENTBOUND);
|
||||
EmptyNetworkManager conn = new EmptyNetworkManager(PacketFlow.CLIENTBOUND);
|
||||
connection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setListener(connection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_18_R2</artifactId>
|
||||
<properties>
|
||||
|
@ -2,7 +2,6 @@ package net.citizensnpcs.nms.v1_18_R2.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -37,7 +36,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@ -134,7 +132,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(Vec3.ZERO);
|
||||
}
|
||||
Vec3 mot = getDeltaMovement();
|
||||
@ -256,15 +254,11 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
EmptyNetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(PacketFlow.CLIENTBOUND);
|
||||
EmptyNetworkManager conn = new EmptyNetworkManager(PacketFlow.CLIENTBOUND);
|
||||
connection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setListener(connection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_19_R3</artifactId>
|
||||
<properties>
|
||||
|
@ -2,7 +2,6 @@ package net.citizensnpcs.nms.v1_19_R3.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -35,7 +34,6 @@ import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@ -123,7 +121,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))
|
||||
&& SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(Vec3.ZERO);
|
||||
}
|
||||
Vec3 mot = getDeltaMovement();
|
||||
@ -238,15 +236,11 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
EmptyNetworkManager conn = null;
|
||||
try {
|
||||
conn = new EmptyNetworkManager(PacketFlow.CLIENTBOUND);
|
||||
EmptyNetworkManager conn = new EmptyNetworkManager(PacketFlow.CLIENTBOUND);
|
||||
connection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setListener(connection);
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
|
@ -1,17 +0,0 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.network;
|
||||
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||
|
||||
public class EmptyNetHandler extends ServerGamePacketListenerImpl {
|
||||
public EmptyNetHandler(MinecraftServer minecraftServer, Connection networkManager, ServerPlayer entityPlayer) {
|
||||
super(minecraftServer, networkManager, entityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(Packet<?> packet) {
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.network;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.minecraft.network.Connection;
|
||||
import net.minecraft.network.PacketSendListener;
|
||||
import net.minecraft.network.protocol.Packet;
|
||||
import net.minecraft.network.protocol.PacketFlow;
|
||||
|
||||
public class EmptyNetworkManager extends Connection {
|
||||
public EmptyNetworkManager(PacketFlow flag) throws IOException {
|
||||
super(flag);
|
||||
NMSImpl.initNetworkManager(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void send(Packet packet, PacketSendListener genericfuturelistener) {
|
||||
}
|
||||
}
|
@ -4,12 +4,12 @@
|
||||
<parent>
|
||||
<groupId>net.citizensnpcs</groupId>
|
||||
<artifactId>citizens-parent</artifactId>
|
||||
<version>2.0.32-SNAPSHOT</version>
|
||||
<version>2.0.33-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>citizens-v1_20_R1</artifactId>
|
||||
<artifactId>citizens-v1_20_R2</artifactId>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<craftbukkit.version>1.20.1-R0.1-SNAPSHOT</craftbukkit.version>
|
||||
<craftbukkit.version>1.20.2-R0.1-SNAPSHOT</craftbukkit.version>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
@ -1,9 +1,9 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftAllay;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftAllay;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
@ -11,15 +11,15 @@ import com.mojang.datafixers.util.Pair;
|
||||
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -225,7 +225,7 @@ public class AllayController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,22 +1,22 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftArmorStand;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftArmorStand;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.MobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.MobAI.ForwardingMobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.MobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.MobAI.ForwardingMobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.tags.TagKey;
|
||||
@ -127,7 +127,7 @@ public class ArmorStandController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,23 +1,23 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftAxolotl;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftAxolotl;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.mojang.serialization.Dynamic;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -220,7 +220,7 @@ public class AxolotlController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,20 +1,20 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftBat;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftBat;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -174,7 +174,7 @@ public class BatController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,20 +1,20 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftBee;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftBee;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -171,7 +171,7 @@ public class BeeController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,20 +1,20 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftBlaze;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftBlaze;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -166,7 +166,7 @@ public class BlazeController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,16 +1,16 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftCamel;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftCamel;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
@ -18,7 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -248,7 +248,7 @@ public class CamelController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftCat;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftCat;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -203,7 +203,7 @@ public class CatController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftCaveSpider;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftCaveSpider;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -202,7 +202,7 @@ public class CaveSpiderController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftChicken;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftChicken;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -211,7 +211,7 @@ public class ChickenController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,22 +1,22 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftCod;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftCod;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.EntityMoveControl;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.EntityMoveControl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -240,7 +240,7 @@ public class CodController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftCow;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftCow;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -219,7 +219,7 @@ public class CowController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftCreeper;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftCreeper;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -214,7 +214,7 @@ public class CreeperController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftDolphin;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftDolphin;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -200,7 +200,7 @@ public class DolphinController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftDrowned;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftDrowned;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -192,7 +192,7 @@ public class DrownedController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,24 +1,20 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.util.List;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEnderDragon;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEnderDragon;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.versioned.EnderDragonTrait;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -130,18 +126,18 @@ public class EnderDragonController extends MobEntityController {
|
||||
}
|
||||
if (npc.data().get(NPC.Metadata.COLLIDABLE, false)) {
|
||||
try {
|
||||
KNOCKBACK.invoke(this,
|
||||
NMSImpl.ENDERDRAGON_KNOCKBACK.invoke(this,
|
||||
this.level().getEntities(this,
|
||||
subEntities[6].getBoundingBox().inflate(4.0, 2.0, 4.0).move(0.0, -2.0, 0.0),
|
||||
EntitySelector.NO_CREATIVE_OR_SPECTATOR));
|
||||
KNOCKBACK.invoke(this,
|
||||
NMSImpl.ENDERDRAGON_KNOCKBACK.invoke(this,
|
||||
this.level().getEntities(this,
|
||||
subEntities[7].getBoundingBox().inflate(4.0, 2.0, 4.0).move(0.0, -2.0, 0.0),
|
||||
EntitySelector.NO_CREATIVE_OR_SPECTATOR));
|
||||
HURT.invoke(this, this.level().getEntities(this, subEntities[0].getBoundingBox().inflate(1.0),
|
||||
EntitySelector.NO_CREATIVE_OR_SPECTATOR));
|
||||
HURT.invoke(this, this.level().getEntities(this, subEntities[1].getBoundingBox().inflate(1.0),
|
||||
EntitySelector.NO_CREATIVE_OR_SPECTATOR));
|
||||
NMSImpl.ENDERDRAGON_HURT.invoke(this, this.level().getEntities(this,
|
||||
subEntities[0].getBoundingBox().inflate(1.0), EntitySelector.NO_CREATIVE_OR_SPECTATOR));
|
||||
NMSImpl.ENDERDRAGON_HURT.invoke(this, this.level().getEntities(this,
|
||||
subEntities[1].getBoundingBox().inflate(1.0), EntitySelector.NO_CREATIVE_OR_SPECTATOR));
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
@ -262,7 +258,7 @@ public class EnderDragonController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
||||
@ -280,8 +276,5 @@ public class EnderDragonController extends MobEntityController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private static final MethodHandle HURT = NMS.getMethodHandle(EnderDragon.class, "c", true, List.class);
|
||||
private static final MethodHandle KNOCKBACK = NMS.getMethodHandle(EnderDragon.class, "b", true, List.class);
|
||||
}
|
||||
}
|
@ -1,24 +1,24 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEnderman;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEnderman;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -213,7 +213,7 @@ public class EndermanController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEndermite;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEndermite;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -201,7 +201,7 @@ public class EndermiteController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,13 +1,12 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.net.Socket;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@ -21,20 +20,19 @@ import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_20_R1.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_20_R1.network.EmptyNetworkManager;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.EmptyAdvancementDataPlayer;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.EmptyServerStatsCounter;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.MobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.MobAI.ForwardingMobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.network.EmptyConnection;
|
||||
import net.citizensnpcs.nms.v1_20_R2.network.EmptyPacketListener;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.EmptyAdvancementDataPlayer;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.EmptyServerStatsCounter;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.MobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.MobAI.ForwardingMobAI;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.npc.skin.SkinPacketTracker;
|
||||
import net.citizensnpcs.npc.skin.SkinnableEntity;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.SkinTrait;
|
||||
import net.citizensnpcs.util.EmptySocket;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
@ -43,9 +41,11 @@ import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.contents.LiteralContents;
|
||||
import net.minecraft.network.protocol.PacketFlow;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ClientInformation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.server.level.ServerPlayerGameMode;
|
||||
import net.minecraft.server.network.CommonListenerCookie;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.stats.ServerStatsCounter;
|
||||
import net.minecraft.tags.TagKey;
|
||||
@ -65,8 +65,9 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
private final SkinPacketTracker skinTracker;
|
||||
private EmptyServerStatsCounter statsCache;
|
||||
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, ServerLevel world, GameProfile gameProfile, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile);
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, ServerLevel world, GameProfile gameProfile,
|
||||
ClientInformation ci, NPC npc) {
|
||||
super(minecraftServer, world, gameProfile, ci);
|
||||
this.npc = (CitizensNPC) npc;
|
||||
if (npc != null) {
|
||||
ai = new BasicMobAI(this);
|
||||
@ -76,7 +77,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
initialise(minecraftServer);
|
||||
initialise(minecraftServer, ci);
|
||||
} else {
|
||||
skinTracker = null;
|
||||
}
|
||||
@ -101,9 +102,9 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
public void die(DamageSource damagesource) {
|
||||
// players that die are not normally removed from the world. when the
|
||||
// NPC dies, we are done with the instance and it should be removed.
|
||||
if (dead) {
|
||||
if (dead)
|
||||
return;
|
||||
}
|
||||
|
||||
super.die(damagesource);
|
||||
Bukkit.getScheduler().runTaskLater(CitizensAPI.getPlugin(), () -> {
|
||||
((ServerLevel) level()).removePlayerImmediately(EntityHumanNPC.this, RemovalReason.KILLED);
|
||||
@ -117,26 +118,30 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
super.doTick();
|
||||
return;
|
||||
}
|
||||
|
||||
super.baseTick();
|
||||
boolean navigating = npc.getNavigator().isNavigating() || ai.getMoveControl().hasWanted();
|
||||
if (!navigating && getBukkitEntity() != null
|
||||
&& (!npc.hasTrait(Gravity.class) || npc.getOrAddTrait(Gravity.class).hasGravity())
|
||||
&& Util.isLoaded(getBukkitEntity().getLocation())
|
||||
&& SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld())) {
|
||||
&& (!npc.isProtected() || SpigotUtil.checkYSafe(getY(), getBukkitEntity().getWorld()))) {
|
||||
moveWithFallDamage(Vec3.ZERO);
|
||||
}
|
||||
|
||||
Vec3 mot = getDeltaMovement();
|
||||
if (Math.abs(mot.x) < EPSILON && Math.abs(mot.y) < EPSILON && Math.abs(mot.z) < EPSILON) {
|
||||
setDeltaMovement(Vec3.ZERO);
|
||||
}
|
||||
|
||||
if (navigating) {
|
||||
if (!ai.getNavigation().isDone()) {
|
||||
ai.getNavigation().tick();
|
||||
}
|
||||
moveOnCurrentHeading();
|
||||
}
|
||||
|
||||
tickAI();
|
||||
detectEquipmentUpdates();
|
||||
detectEquipmentUpdatesPublic();
|
||||
noPhysics = isSpectator();
|
||||
if (isSpectator()) {
|
||||
this.onGround = false;
|
||||
@ -231,16 +236,13 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
return damaged;
|
||||
}
|
||||
|
||||
private void initialise(MinecraftServer minecraftServer) {
|
||||
Socket socket = new EmptySocket();
|
||||
EmptyNetworkManager conn = null;
|
||||
private void initialise(MinecraftServer minecraftServer, ClientInformation clientInfo) {
|
||||
try {
|
||||
conn = new EmptyNetworkManager(PacketFlow.CLIENTBOUND);
|
||||
connection = new EmptyNetHandler(minecraftServer, conn, this);
|
||||
conn.setListener(connection);
|
||||
socket.close();
|
||||
EmptyConnection conn = new EmptyConnection(PacketFlow.CLIENTBOUND);
|
||||
connection = new EmptyPacketListener(minecraftServer, conn, this,
|
||||
new CommonListenerCookie(getProfile(), 0, clientInfo));
|
||||
} catch (IOException e) {
|
||||
// swallow
|
||||
e.printStackTrace();
|
||||
}
|
||||
this.invulnerableTime = 0;
|
||||
NMS.setStepHeight(getBukkitEntity(), 1); // the default (0) breaks step climbing
|
||||
@ -253,9 +255,9 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
|
||||
@Override
|
||||
public boolean isInWall() {
|
||||
if (npc == null || noPhysics || isSleeping()) {
|
||||
if (npc == null || noPhysics || isSleeping())
|
||||
return super.isInWall();
|
||||
}
|
||||
|
||||
return Util.inBlock(getBukkitEntity());
|
||||
}
|
||||
|
||||
@ -356,6 +358,7 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
super.tick();
|
||||
if (npc == null)
|
||||
return;
|
||||
|
||||
Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", getBukkitEntity());
|
||||
updatePackets(npc.getNavigator().isNavigating());
|
||||
npc.update();
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEvoker;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEvoker;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -187,7 +187,7 @@ public class EvokerController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftFox;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftFox;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -197,7 +197,7 @@ public class FoxController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftFrog;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftFrog;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -200,7 +200,7 @@ public class FrogController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,20 +1,20 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftGhast;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftGhast;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -166,7 +166,7 @@ public class GhastController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftGiant;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftGiant;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -195,7 +195,7 @@ public class GiantController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftGlowSquid;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftGlowSquid;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -195,7 +195,7 @@ public class GlowSquidController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftGoat;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftGoat;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -197,7 +197,7 @@ public class GoatController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftGuardian;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftGuardian;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -202,7 +202,7 @@ public class GuardianController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,20 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftElderGuardian;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftElderGuardian;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -202,7 +201,7 @@ public class GuardianElderController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftHoglin;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftHoglin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -192,7 +192,7 @@ public class HoglinController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,16 +1,16 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftHorse;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftHorse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
@ -18,7 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -243,7 +243,7 @@ public class HorseController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,16 +1,16 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftDonkey;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftDonkey;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
@ -18,7 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -243,7 +243,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,16 +1,16 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftMule;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftMule;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
@ -18,7 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -242,7 +242,7 @@ public class HorseMuleController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,16 +1,16 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftSkeletonHorse;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftSkeletonHorse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
@ -18,7 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -242,7 +242,7 @@ public class HorseSkeletonController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,16 +1,16 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftZombieHorse;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftZombieHorse;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
@ -18,7 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -243,7 +243,7 @@ public class HorseZombieController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,10 +1,10 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftWorld;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -19,6 +19,7 @@ import net.citizensnpcs.trait.ScoreboardTrait;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ClientInformation;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
|
||||
public class HumanController extends AbstractEntityController {
|
||||
@ -40,7 +41,8 @@ public class HumanController extends AbstractEntityController {
|
||||
npc.getOrAddTrait(ScoreboardTrait.class).createTeam(name);
|
||||
}
|
||||
final GameProfile profile = new GameProfile(uuid, name);
|
||||
final EntityHumanNPC handle = new EntityHumanNPC(MinecraftServer.getServer(), nmsWorld, profile, npc);
|
||||
final EntityHumanNPC handle = new EntityHumanNPC(MinecraftServer.getServer(), nmsWorld, profile,
|
||||
ClientInformation.createDefault(), npc);
|
||||
Skin skin = handle.getSkinTracker().getSkin();
|
||||
if (skin != null) {
|
||||
skin.apply(handle);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftIllusioner;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftIllusioner;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -187,7 +187,7 @@ public class IllusionerController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftIronGolem;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftIronGolem;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -195,7 +195,7 @@ public class IronGolemController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,16 +1,16 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftLlama;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftLlama;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
@ -18,7 +18,7 @@ import net.citizensnpcs.trait.HorseModifiers;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -242,7 +242,7 @@ public class LlamaController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,22 +1,22 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftMagmaCube;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftMagmaCube;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.EntityMoveControl;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.EntityMoveControl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -203,7 +203,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,4 +1,4 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.Map;
|
||||
@ -6,13 +6,13 @@ import java.util.WeakHashMap;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftWorld;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.PitchableLookControl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.PitchableLookControl;
|
||||
import net.citizensnpcs.npc.AbstractEntityController;
|
||||
import net.citizensnpcs.trait.ScoreboardTrait;
|
||||
import net.minecraft.world.entity.EntityType;
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftMushroomCow;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftMushroomCow;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -206,7 +206,7 @@ public class MushroomCowController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftOcelot;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftOcelot;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -203,7 +203,7 @@ public class OcelotController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPanda;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPanda;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -197,7 +197,7 @@ public class PandaController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,20 +1,20 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftParrot;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftParrot;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -177,7 +177,7 @@ public class ParrotController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,22 +1,22 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPhantom;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPhantom;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.EntityMoveControl;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.EntityMoveControl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -232,7 +232,7 @@ public class PhantomController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPig;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPig;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@ -204,7 +204,7 @@ public class PigController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPigZombie;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPigZombie;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -186,7 +186,7 @@ public class PigZombieController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPiglinBrute;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPiglinBrute;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -189,7 +189,7 @@ public class PiglinBruteController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
@ -1,21 +1,21 @@
|
||||
package net.citizensnpcs.nms.v1_20_R1.entity;
|
||||
package net.citizensnpcs.nms.v1_20_R2.entity;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPiglin;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftEntity;
|
||||
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPiglin;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R1.util.NMSImpl;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.ForwardingNPCHolder;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSBoundingBox;
|
||||
import net.citizensnpcs.nms.v1_20_R2.util.NMSImpl;
|
||||
import net.citizensnpcs.npc.CitizensNPC;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.PositionImpl;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
@ -189,7 +189,7 @@ public class PiglinController extends MobEntityController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entity teleportTo(ServerLevel worldserver, PositionImpl location) {
|
||||
public Entity teleportTo(ServerLevel worldserver, Vec3 location) {
|
||||
if (npc == null)
|
||||
return super.teleportTo(worldserver, location);
|
||||
return NMSImpl.teleportAcrossWorld(this, worldserver, location);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user