mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Implement API, check for invalid Player references, remove Text min/max-cooldown settings and fix Text delay/right click cancellations, make SitTrait work with npc#teleport
This commit is contained in:
parent
a669a8a256
commit
b8e79b20cf
Binary file not shown.
@ -96,7 +96,6 @@ import net.citizensnpcs.trait.CommandTrait;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
import net.citizensnpcs.trait.CurrentLocation;
|
||||
import net.citizensnpcs.trait.ShopTrait;
|
||||
import net.citizensnpcs.trait.SitTrait;
|
||||
import net.citizensnpcs.util.ChunkCoord;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
@ -237,7 +236,7 @@ public class EventListen implements Listener {
|
||||
npc = CitizensAPI.getNPCRegistry().getNPC(((EntityDamageByEntityEvent) event).getDamager());
|
||||
if (npc == null)
|
||||
return;
|
||||
event.setCancelled(!npc.data().get(NPC.DAMAGE_OTHERS_METADATA, true));
|
||||
event.setCancelled(!npc.data().get(NPC.Metadata.DAMAGE_OTHERS, true));
|
||||
NPCDamageEntityEvent damageEvent = new NPCDamageEntityEvent(npc, (EntityDamageByEntityEvent) event);
|
||||
Bukkit.getPluginManager().callEvent(damageEvent);
|
||||
}
|
||||
@ -278,7 +277,7 @@ public class EventListen implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!npc.data().get(NPC.DROPS_ITEMS_METADATA, false)) {
|
||||
if (!npc.data().get(NPC.Metadata.DROPS_ITEMS, false)) {
|
||||
event.getDrops().clear();
|
||||
}
|
||||
|
||||
@ -286,7 +285,7 @@ public class EventListen implements Listener {
|
||||
Bukkit.getPluginManager().callEvent(new NPCDeathEvent(npc, event));
|
||||
npc.despawn(DespawnReason.DEATH);
|
||||
|
||||
int delay = npc.data().get(NPC.RESPAWN_DELAY_METADATA, -1);
|
||||
int delay = npc.data().get(NPC.Metadata.RESPAWN_DELAY, -1);
|
||||
if (delay < 0)
|
||||
return;
|
||||
int deathAnimationTicks = event.getEntity() instanceof LivingEntity ? 20 : 2;
|
||||
@ -323,7 +322,7 @@ public class EventListen implements Listener {
|
||||
NPC npc = CitizensAPI.getNPCRegistry().getNPC(event.getTarget());
|
||||
if (npc == null)
|
||||
return;
|
||||
event.setCancelled(!npc.data().get(NPC.TARGETABLE_METADATA, !npc.isProtected()));
|
||||
event.setCancelled(!npc.data().get(NPC.Metadata.TARGETABLE, !npc.isProtected()));
|
||||
Bukkit.getPluginManager().callEvent(new EntityTargetNPCEvent(event, npc));
|
||||
}
|
||||
|
||||
@ -453,7 +452,7 @@ public class EventListen implements Listener {
|
||||
return;
|
||||
}
|
||||
boolean leashProtected = npc.isProtected();
|
||||
if (npc.data().get(NPC.LEASH_PROTECTED_METADATA, leashProtected)) {
|
||||
if (npc.data().get(NPC.Metadata.LEASH_PROTECTED, leashProtected)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@ -486,11 +485,6 @@ public class EventListen implements Listener {
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerTeleport(final PlayerTeleportEvent event) {
|
||||
NPC npc = CitizensAPI.getNPCRegistry().getNPC(event.getPlayer());
|
||||
if (event.getCause() == TeleportCause.PLUGIN && npc != null) {
|
||||
if (npc.hasTrait(SitTrait.class)) {
|
||||
npc.getOrAddTrait(SitTrait.class).setSitting(event.getTo());
|
||||
}
|
||||
}
|
||||
if (event.getCause() == TeleportCause.PLUGIN && !event.getPlayer().hasMetadata("citizens-force-teleporting")
|
||||
&& npc != null && Setting.PLAYER_TELEPORT_DELAY.asInt() > 0) {
|
||||
event.setCancelled(true);
|
||||
|
@ -166,8 +166,6 @@ public class Settings {
|
||||
STORAGE_TYPE("storage.type", "yaml"),
|
||||
SUBPLUGIN_FOLDER("subplugins.folder", "plugins"),
|
||||
TABLIST_REMOVE_PACKET_DELAY("npc.tablist.remove-packet-delay", 1),
|
||||
TALK_CLOSE_MAXIMUM_COOLDOWN("npc.text.max-talk-cooldown", 5),
|
||||
TALK_CLOSE_MINIMUM_COOLDOWN("npc.text.min-talk-cooldown", 10),
|
||||
TALK_CLOSE_TO_NPCS("npc.chat.options.talk-to-npcs", true),
|
||||
TALK_ITEM("npc.text.talk-item", "*"),
|
||||
USE_BOAT_CONTROLS("npc.controllable.use-boat-controls", true),
|
||||
|
@ -78,6 +78,7 @@ import net.citizensnpcs.api.npc.BlockBreaker;
|
||||
import net.citizensnpcs.api.npc.BlockBreaker.BlockBreakerConfiguration;
|
||||
import net.citizensnpcs.api.npc.MemoryNPCDataStore;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.npc.NPCRegistry;
|
||||
import net.citizensnpcs.api.trait.Trait;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
@ -394,11 +395,11 @@ public class NPCCommands {
|
||||
permission = "citizens.npc.chunkload")
|
||||
@Requirements(selected = true, ownership = true)
|
||||
public void chunkload(CommandContext args, CommandSender sender, NPC npc) {
|
||||
boolean enabled = !npc.data().get(NPC.KEEP_CHUNK_LOADED_METADATA, Setting.KEEP_CHUNKS_LOADED.asBoolean());
|
||||
boolean enabled = !npc.data().get(NPC.Metadata.KEEP_CHUNK_LOADED, Setting.KEEP_CHUNKS_LOADED.asBoolean());
|
||||
if (args.hasFlag('t')) {
|
||||
npc.data().set(NPC.KEEP_CHUNK_LOADED_METADATA, enabled);
|
||||
npc.data().set(NPC.Metadata.KEEP_CHUNK_LOADED, enabled);
|
||||
} else {
|
||||
npc.data().setPersistent(NPC.KEEP_CHUNK_LOADED_METADATA, enabled);
|
||||
npc.data().setPersistent(NPC.Metadata.KEEP_CHUNK_LOADED, enabled);
|
||||
}
|
||||
Messaging.sendTr(sender, enabled ? Messages.CHUNKLOAD_SET : Messages.CHUNKLOAD_UNSET, npc.getName());
|
||||
}
|
||||
@ -689,7 +690,7 @@ public class NPCCommands {
|
||||
}
|
||||
|
||||
if (args.hasFlag('s')) {
|
||||
npc.data().set(NPC.SILENT_METADATA, true);
|
||||
npc.data().set(NPC.Metadata.SILENT, true);
|
||||
}
|
||||
|
||||
if (nameplate != null) {
|
||||
@ -1270,11 +1271,11 @@ public class NPCCommands {
|
||||
flags = "t",
|
||||
permission = "citizens.npc.leashable")
|
||||
public void leashable(CommandContext args, CommandSender sender, NPC npc) {
|
||||
boolean vulnerable = !npc.data().get(NPC.LEASH_PROTECTED_METADATA, true);
|
||||
boolean vulnerable = !npc.data().get(NPC.Metadata.LEASH_PROTECTED, true);
|
||||
if (args.hasFlag('t')) {
|
||||
npc.data().set(NPC.LEASH_PROTECTED_METADATA, vulnerable);
|
||||
npc.data().set(NPC.Metadata.LEASH_PROTECTED, vulnerable);
|
||||
} else {
|
||||
npc.data().setPersistent(NPC.LEASH_PROTECTED_METADATA, vulnerable);
|
||||
npc.data().setPersistent(NPC.Metadata.LEASH_PROTECTED, vulnerable);
|
||||
}
|
||||
String key = vulnerable ? Messages.LEASHABLE_STOPPED : Messages.LEASHABLE_SET;
|
||||
Messaging.sendTr(sender, key, npc.getName());
|
||||
@ -1527,15 +1528,15 @@ public class NPCCommands {
|
||||
Material material = Material.matchMaterial(item);
|
||||
if (material == null)
|
||||
throw new CommandException();
|
||||
npc.data().setPersistent(NPC.MINECART_ITEM_METADATA, material.name());
|
||||
npc.data().setPersistent(NPC.MINECART_ITEM_DATA_METADATA, data);
|
||||
npc.data().setPersistent(NPC.Metadata.MINECART_ITEM, material.name());
|
||||
npc.data().setPersistent(NPC.Metadata.MINECART_ITEM_DATA, data);
|
||||
}
|
||||
if (args.hasValueFlag("offset")) {
|
||||
npc.data().setPersistent(NPC.MINECART_OFFSET_METADATA, args.getFlagInteger("offset"));
|
||||
npc.data().setPersistent(NPC.Metadata.MINECART_OFFSET, args.getFlagInteger("offset"));
|
||||
}
|
||||
|
||||
Messaging.sendTr(sender, Messages.MINECART_SET, npc.data().get(NPC.MINECART_ITEM_METADATA, ""),
|
||||
npc.data().get(NPC.MINECART_ITEM_DATA_METADATA, 0), npc.data().get(NPC.MINECART_OFFSET_METADATA, 0));
|
||||
Messaging.sendTr(sender, Messages.MINECART_SET, npc.data().get(NPC.Metadata.MINECART_ITEM, ""),
|
||||
npc.data().get(NPC.Metadata.MINECART_ITEM_DATA, 0), npc.data().get(NPC.Metadata.MINECART_OFFSET, 0));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -1611,9 +1612,9 @@ public class NPCCommands {
|
||||
public void moveto(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
if (!npc.isSpawned()) {
|
||||
npc.spawn(npc.getOrAddTrait(CurrentLocation.class).getLocation(), SpawnReason.COMMAND);
|
||||
}
|
||||
if (!npc.isSpawned()) {
|
||||
throw new CommandException("NPC could not be spawned.");
|
||||
if (!npc.isSpawned()) {
|
||||
throw new CommandException("NPC could not be spawned.");
|
||||
}
|
||||
}
|
||||
Location current = npc.getEntity().getLocation();
|
||||
Location to;
|
||||
@ -1671,7 +1672,7 @@ public class NPCCommands {
|
||||
old = old.equals("hover") ? "true" : "" + !Boolean.parseBoolean(old);
|
||||
}
|
||||
npc.data().setPersistent(NPC.Metadata.NAMEPLATE_VISIBLE, old);
|
||||
npc.data().set(NPC.Metadata.FORCE_PACKET_UPDATE, true);
|
||||
npc.scheduleUpdate(NPCUpdate.PACKET);
|
||||
Messaging.sendTr(sender, Messages.NAMEPLATE_VISIBILITY_SET, old);
|
||||
}
|
||||
|
||||
@ -1767,8 +1768,8 @@ public class NPCCommands {
|
||||
permission = "citizens.npc.passive")
|
||||
public void passive(CommandContext args, CommandSender sender, NPC npc, @Flag("set") Boolean set)
|
||||
throws CommandException {
|
||||
boolean passive = set != null ? set : !npc.data().get(NPC.DAMAGE_OTHERS_METADATA, true);
|
||||
npc.data().setPersistent(NPC.DAMAGE_OTHERS_METADATA, passive);
|
||||
boolean passive = set != null ? set : !npc.data().get(NPC.Metadata.DAMAGE_OTHERS, true);
|
||||
npc.data().setPersistent(NPC.Metadata.DAMAGE_OTHERS, passive);
|
||||
Messaging.sendTr(sender, passive ? Messages.PASSIVE_SET : Messages.PASSIVE_UNSET, npc.getName());
|
||||
}
|
||||
|
||||
@ -1914,14 +1915,14 @@ public class NPCCommands {
|
||||
permission = "citizens.npc.playerlist")
|
||||
@Requirements(selected = true, ownership = true, types = EntityType.PLAYER)
|
||||
public void playerlist(CommandContext args, CommandSender sender, NPC npc) {
|
||||
boolean remove = !npc.data().get(NPC.REMOVE_FROM_PLAYERLIST_METADATA,
|
||||
boolean remove = !npc.data().get(NPC.Metadata.REMOVE_FROM_PLAYERLIST,
|
||||
Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean());
|
||||
if (args.hasFlag('a')) {
|
||||
remove = false;
|
||||
} else if (args.hasFlag('r')) {
|
||||
remove = true;
|
||||
}
|
||||
npc.data().setPersistent(NPC.REMOVE_FROM_PLAYERLIST_METADATA, remove);
|
||||
npc.data().setPersistent(NPC.Metadata.REMOVE_FROM_PLAYERLIST, remove);
|
||||
if (npc.isSpawned()) {
|
||||
npc.despawn(DespawnReason.PENDING_RESPAWN);
|
||||
npc.spawn(npc.getOrAddTrait(CurrentLocation.class).getLocation(), SpawnReason.RESPAWN);
|
||||
@ -2184,10 +2185,10 @@ public class NPCCommands {
|
||||
public void respawn(CommandContext args, CommandSender sender, NPC npc) {
|
||||
if (args.argsLength() > 1) {
|
||||
int delay = args.getTicks(1);
|
||||
npc.data().setPersistent(NPC.RESPAWN_DELAY_METADATA, delay);
|
||||
npc.data().setPersistent(NPC.Metadata.RESPAWN_DELAY, delay);
|
||||
Messaging.sendTr(sender, Messages.RESPAWN_DELAY_SET, delay);
|
||||
} else {
|
||||
Messaging.sendTr(sender, Messages.RESPAWN_DELAY_DESCRIBE, npc.data().get(NPC.RESPAWN_DELAY_METADATA, -1));
|
||||
Messaging.sendTr(sender, Messages.RESPAWN_DELAY_DESCRIBE, npc.data().get(NPC.Metadata.RESPAWN_DELAY, -1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2391,21 +2392,17 @@ public class NPCCommands {
|
||||
if (args.argsLength() == 3) {
|
||||
shop = shops.getShop(args.getString(2).toLowerCase());
|
||||
}
|
||||
if (action.equalsIgnoreCase("delete")) {
|
||||
if (args.argsLength() != 3 || shop == null)
|
||||
throw new CommandUsageException();
|
||||
if (!sender.hasPermission("citizens.admin") && (!sender.hasPermission("citizens.npc.shop.edit")
|
||||
|| !sender.hasPermission("citizens.npc.shop.edit." + shop.getName())))
|
||||
throw new NoPermissionsException();
|
||||
shops.deleteShop(shop);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shop == null)
|
||||
throw new CommandUsageException();
|
||||
if (action.equalsIgnoreCase("edit")) {
|
||||
if (!sender.hasPermission("citizens.admin") && (!sender.hasPermission("citizens.npc.shop.edit")
|
||||
|| !sender.hasPermission("citizens.npc.shop.edit." + shop.getName())))
|
||||
|
||||
if (action.equalsIgnoreCase("delete")) {
|
||||
if (args.argsLength() != 3)
|
||||
throw new CommandUsageException();
|
||||
if (!shop.canEdit(npc, sender))
|
||||
throw new NoPermissionsException();
|
||||
shops.deleteShop(shop);
|
||||
} else if (action.equalsIgnoreCase("edit")) {
|
||||
if (!shop.canEdit(npc, sender))
|
||||
throw new NoPermissionsException();
|
||||
shop.displayEditor(npc == null ? null : npc.getOrAddTrait(ShopTrait.class), sender);
|
||||
} else if (action.equalsIgnoreCase("show")) {
|
||||
@ -2580,9 +2577,9 @@ public class NPCCommands {
|
||||
@Requirements(selected = true, ownership = true, livingEntity = true)
|
||||
public void sound(CommandContext args, CommandSender sender, NPC npc, @Flag("death") String death,
|
||||
@Flag("ambient") String ambient, @Flag("hurt") String hurt) throws CommandException {
|
||||
String ambientSound = npc.data().get(NPC.AMBIENT_SOUND_METADATA);
|
||||
String deathSound = npc.data().get(NPC.DEATH_SOUND_METADATA);
|
||||
String hurtSound = npc.data().get(NPC.HURT_SOUND_METADATA);
|
||||
String ambientSound = npc.data().get(NPC.Metadata.AMBIENT_SOUND);
|
||||
String deathSound = npc.data().get(NPC.Metadata.DEATH_SOUND);
|
||||
String hurtSound = npc.data().get(NPC.Metadata.HURT_SOUND);
|
||||
if (args.getValueFlags().size() == 0 && args.getFlags().size() == 0) {
|
||||
Messaging.sendTr(sender, Messages.SOUND_INFO, npc.getName(), ambientSound, hurtSound, deathSound);
|
||||
return;
|
||||
@ -2590,14 +2587,14 @@ public class NPCCommands {
|
||||
|
||||
if (args.hasFlag('n')) {
|
||||
ambientSound = deathSound = hurtSound = "";
|
||||
npc.data().setPersistent(NPC.SILENT_METADATA, true);
|
||||
npc.data().setPersistent(NPC.Metadata.SILENT, true);
|
||||
}
|
||||
if (args.hasFlag('s')) {
|
||||
npc.data().setPersistent(NPC.SILENT_METADATA, !npc.data().get(NPC.SILENT_METADATA, false));
|
||||
npc.data().setPersistent(NPC.Metadata.SILENT, !npc.data().get(NPC.Metadata.SILENT, false));
|
||||
}
|
||||
if (args.hasFlag('d')) {
|
||||
ambientSound = deathSound = hurtSound = null;
|
||||
npc.data().setPersistent(NPC.SILENT_METADATA, false);
|
||||
npc.data().setPersistent(NPC.Metadata.SILENT, false);
|
||||
} else {
|
||||
if (death != null) {
|
||||
deathSound = death.equals("d") ? null : NMS.getSound(death);
|
||||
@ -2610,19 +2607,19 @@ public class NPCCommands {
|
||||
}
|
||||
}
|
||||
if (deathSound == null) {
|
||||
npc.data().remove(NPC.DEATH_SOUND_METADATA);
|
||||
npc.data().remove(NPC.Metadata.DEATH_SOUND);
|
||||
} else {
|
||||
npc.data().setPersistent(NPC.DEATH_SOUND_METADATA, deathSound);
|
||||
npc.data().setPersistent(NPC.Metadata.DEATH_SOUND, deathSound);
|
||||
}
|
||||
if (hurtSound == null) {
|
||||
npc.data().remove(NPC.HURT_SOUND_METADATA);
|
||||
npc.data().remove(NPC.Metadata.HURT_SOUND);
|
||||
} else {
|
||||
npc.data().setPersistent(NPC.HURT_SOUND_METADATA, hurtSound);
|
||||
npc.data().setPersistent(NPC.Metadata.HURT_SOUND, hurtSound);
|
||||
}
|
||||
if (ambientSound == null) {
|
||||
npc.data().remove(NPC.AMBIENT_SOUND_METADATA);
|
||||
npc.data().remove(NPC.Metadata.AMBIENT_SOUND);
|
||||
} else {
|
||||
npc.data().setPersistent(NPC.AMBIENT_SOUND_METADATA, ambientSound);
|
||||
npc.data().setPersistent(NPC.Metadata.AMBIENT_SOUND, ambientSound);
|
||||
}
|
||||
|
||||
if (ambientSound != null && ambientSound.isEmpty()) {
|
||||
@ -2637,7 +2634,7 @@ public class NPCCommands {
|
||||
if ((!Strings.isNullOrEmpty(ambientSound) && !ambientSound.equals("none"))
|
||||
|| (!Strings.isNullOrEmpty(deathSound) && !deathSound.equals("none"))
|
||||
|| (!Strings.isNullOrEmpty(hurtSound) && !hurtSound.equals("none"))) {
|
||||
npc.data().setPersistent(NPC.SILENT_METADATA, false);
|
||||
npc.data().setPersistent(NPC.Metadata.SILENT, false);
|
||||
}
|
||||
Messaging.sendTr(sender, Messages.SOUND_SET, npc.getName(), ambientSound, hurtSound, deathSound);
|
||||
}
|
||||
@ -2717,7 +2714,7 @@ public class NPCCommands {
|
||||
} else {
|
||||
Player player = Bukkit.getPlayerExact(target);
|
||||
if (player != null) {
|
||||
context.addRecipient((Entity) player);
|
||||
context.addRecipient(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2802,11 +2799,11 @@ public class NPCCommands {
|
||||
flags = "t",
|
||||
permission = "citizens.npc.targetable")
|
||||
public void targetable(CommandContext args, CommandSender sender, NPC npc) {
|
||||
boolean targetable = !npc.data().get(NPC.TARGETABLE_METADATA, npc.isProtected());
|
||||
boolean targetable = !npc.data().get(NPC.Metadata.TARGETABLE, npc.isProtected());
|
||||
if (args.hasFlag('t')) {
|
||||
npc.data().set(NPC.TARGETABLE_METADATA, targetable);
|
||||
npc.data().set(NPC.Metadata.TARGETABLE, targetable);
|
||||
} else {
|
||||
npc.data().setPersistent(NPC.TARGETABLE_METADATA, targetable);
|
||||
npc.data().setPersistent(NPC.Metadata.TARGETABLE, targetable);
|
||||
}
|
||||
Messaging.sendTr(sender, targetable ? Messages.TARGETABLE_SET : Messages.TARGETABLE_UNSET, npc.getName());
|
||||
}
|
||||
@ -3021,9 +3018,9 @@ public class NPCCommands {
|
||||
public void vulnerable(CommandContext args, CommandSender sender, NPC npc) {
|
||||
boolean vulnerable = !npc.isProtected();
|
||||
if (args.hasFlag('t')) {
|
||||
npc.data().set(NPC.DEFAULT_PROTECTED_METADATA, vulnerable);
|
||||
npc.data().set(NPC.Metadata.DEFAULT_PROTECTED, vulnerable);
|
||||
} else {
|
||||
npc.data().setPersistent(NPC.DEFAULT_PROTECTED_METADATA, vulnerable);
|
||||
npc.data().setPersistent(NPC.Metadata.DEFAULT_PROTECTED, vulnerable);
|
||||
}
|
||||
String key = vulnerable ? Messages.VULNERABLE_STOPPED : Messages.VULNERABLE_SET;
|
||||
Messaging.sendTr(sender, key, npc.getName());
|
||||
|
@ -64,9 +64,9 @@ public class WaypointCommands {
|
||||
max = 1,
|
||||
permission = "citizens.waypoints.disableteleport")
|
||||
public void disableTeleporting(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
npc.data().setPersistent(NPC.DISABLE_DEFAULT_STUCK_ACTION_METADATA,
|
||||
!npc.data().get(NPC.DISABLE_DEFAULT_STUCK_ACTION_METADATA, false));
|
||||
if (npc.data().get(NPC.DISABLE_DEFAULT_STUCK_ACTION_METADATA, false)) {
|
||||
npc.data().setPersistent(NPC.Metadata.DISABLE_DEFAULT_STUCK_ACTION,
|
||||
!npc.data().get(NPC.Metadata.DISABLE_DEFAULT_STUCK_ACTION, false));
|
||||
if (npc.data().get(NPC.Metadata.DISABLE_DEFAULT_STUCK_ACTION, false)) {
|
||||
npc.getNavigator().getDefaultParameters().stuckAction(null);
|
||||
Messaging.sendTr(sender, Messages.WAYPOINT_TELEPORTING_DISABLED, npc.getName());
|
||||
} else {
|
||||
@ -103,8 +103,8 @@ public class WaypointCommands {
|
||||
max = 1,
|
||||
permission = "citizens.waypoints.opendoors")
|
||||
public void openDoors(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
boolean opensDoors = !npc.data().get(NPC.PATHFINDER_OPEN_DOORS_METADATA, false);
|
||||
npc.data().setPersistent(NPC.PATHFINDER_OPEN_DOORS_METADATA, opensDoors);
|
||||
boolean opensDoors = !npc.data().get(NPC.Metadata.PATHFINDER_OPEN_DOORS, false);
|
||||
npc.data().setPersistent(NPC.Metadata.PATHFINDER_OPEN_DOORS, opensDoors);
|
||||
Messaging.sendTr(sender,
|
||||
opensDoors ? Messages.PATHFINDER_OPEN_DOORS_ENABLED : Messages.PATHFINDER_OPEN_DOORS_DISABLED,
|
||||
npc.getName());
|
||||
|
@ -48,6 +48,7 @@ import net.citizensnpcs.trait.CurrentLocation;
|
||||
import net.citizensnpcs.trait.Gravity;
|
||||
import net.citizensnpcs.trait.HologramTrait;
|
||||
import net.citizensnpcs.trait.ScoreboardTrait;
|
||||
import net.citizensnpcs.trait.SitTrait;
|
||||
import net.citizensnpcs.trait.SneakTrait;
|
||||
import net.citizensnpcs.util.ChunkCoord;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
@ -79,7 +80,7 @@ public class CitizensNPC extends AbstractNPC {
|
||||
}
|
||||
NPCDespawnEvent event = new NPCDespawnEvent(this, reason);
|
||||
if (reason == DespawnReason.CHUNK_UNLOAD) {
|
||||
event.setCancelled(data().get(NPC.KEEP_CHUNK_LOADED_METADATA, Setting.KEEP_CHUNKS_LOADED.asBoolean()));
|
||||
event.setCancelled(data().get(NPC.Metadata.KEEP_CHUNK_LOADED, Setting.KEEP_CHUNKS_LOADED.asBoolean()));
|
||||
}
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled() && reason != DespawnReason.DEATH) {
|
||||
@ -159,6 +160,13 @@ public class CitizensNPC extends AbstractNPC {
|
||||
return getEntity() != null && NMS.isValid(getEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpdating(NPCUpdate update) {
|
||||
return update == NPCUpdate.PACKET
|
||||
? updateCounter > data().get(NPC.Metadata.PACKET_UPDATE_DELAY, Setting.PACKET_UPDATE_DELAY.asInt())
|
||||
: false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void load(final DataKey root) {
|
||||
super.load(root);
|
||||
@ -195,11 +203,18 @@ public class CitizensNPC extends AbstractNPC {
|
||||
@Override
|
||||
public void save(DataKey root) {
|
||||
super.save(root);
|
||||
if (!data().get(NPC.SHOULD_SAVE_METADATA, true))
|
||||
if (!data().get(NPC.Metadata.SHOULD_SAVE, true))
|
||||
return;
|
||||
navigator.save(root.getRelative("navigator"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleUpdate(NPCUpdate update) {
|
||||
if (update == NPCUpdate.PACKET) {
|
||||
updateCounter = data().get(NPC.Metadata.PACKET_UPDATE_DELAY, Setting.PACKET_UPDATE_DELAY.asInt()) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBukkitEntityType(EntityType type) {
|
||||
EntityController controller = EntityControllers.createForType(type);
|
||||
@ -407,13 +422,16 @@ public class CitizensNPC extends AbstractNPC {
|
||||
|
||||
@Override
|
||||
public void teleport(Location location, TeleportCause reason) {
|
||||
super.teleport(location, reason);
|
||||
if (!isSpawned())
|
||||
return;
|
||||
if (hasTrait(SitTrait.class)) {
|
||||
getOrAddTrait(SitTrait.class).setSitting(location);
|
||||
}
|
||||
Location npcLoc = getEntity().getLocation(CACHE_LOCATION);
|
||||
if (isSpawned() && npcLoc.getWorld() == location.getWorld() && npcLoc.distanceSquared(location) < 1) {
|
||||
if (isSpawned() && npcLoc.getWorld() == location.getWorld() && npcLoc.distance(location) < 1) {
|
||||
NMS.setHeadYaw(getEntity(), location.getYaw());
|
||||
}
|
||||
super.teleport(location, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -463,9 +481,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
}
|
||||
|
||||
boolean isLiving = getEntity() instanceof LivingEntity;
|
||||
int packetUpdateDelay = data().get(NPC.Metadata.PACKET_UPDATE_DELAY, Setting.PACKET_UPDATE_DELAY.asInt());
|
||||
if (updateCounter++ > packetUpdateDelay || data().has(NPC.Metadata.FORCE_PACKET_UPDATE)) {
|
||||
if (data().get(NPC.KEEP_CHUNK_LOADED_METADATA, Setting.KEEP_CHUNKS_LOADED.asBoolean())) {
|
||||
if (isUpdating(NPCUpdate.PACKET)) {
|
||||
if (data().get(NPC.Metadata.KEEP_CHUNK_LOADED, Setting.KEEP_CHUNKS_LOADED.asBoolean())) {
|
||||
ChunkCoord currentCoord = new ChunkCoord(getStoredLocation());
|
||||
if (!currentCoord.equals(cachedCoord)) {
|
||||
resetCachedCoord();
|
||||
@ -478,7 +495,6 @@ public class CitizensNPC extends AbstractNPC {
|
||||
updateScoreboard();
|
||||
}
|
||||
updateCounter = 0;
|
||||
data().remove(NPC.Metadata.FORCE_PACKET_UPDATE);
|
||||
}
|
||||
|
||||
updateCustomNameVisibility();
|
||||
@ -502,13 +518,15 @@ public class CitizensNPC extends AbstractNPC {
|
||||
}
|
||||
}
|
||||
|
||||
if (SUPPORT_SILENT && data().has(NPC.SILENT_METADATA)) {
|
||||
if (SUPPORT_SILENT && data().has(NPC.Metadata.SILENT)) {
|
||||
try {
|
||||
getEntity().setSilent(Boolean.parseBoolean(data().get(NPC.Metadata.SILENT).toString()));
|
||||
} catch (NoSuchMethodError e) {
|
||||
SUPPORT_SILENT = false;
|
||||
}
|
||||
}
|
||||
|
||||
updateCounter++;
|
||||
} catch (Exception ex) {
|
||||
Throwable error = Throwables.getRootCause(ex);
|
||||
Messaging.logTr(Messages.EXCEPTION_UPDATING_NPC, getId(), error.getMessage());
|
||||
@ -542,8 +560,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
return;
|
||||
if (!Util.isAlwaysFlyable(type))
|
||||
return;
|
||||
if (!data().has(NPC.FLYABLE_METADATA)) {
|
||||
data().setPersistent(NPC.FLYABLE_METADATA, true);
|
||||
if (!data().has(NPC.Metadata.FLYABLE)) {
|
||||
data().setPersistent(NPC.Metadata.FLYABLE, true);
|
||||
}
|
||||
if (!hasTrait(Gravity.class)) {
|
||||
getOrAddTrait(Gravity.class).setEnabled(true);
|
||||
@ -580,6 +598,8 @@ public class CitizensNPC extends AbstractNPC {
|
||||
private static boolean SUPPORT_GLOWING = true;
|
||||
private static boolean SUPPORT_NODAMAGE_TICKS = true;
|
||||
private static boolean SUPPORT_PICKUP_ITEMS = true;
|
||||
|
||||
private static boolean SUPPORT_SILENT = true;
|
||||
|
||||
private static boolean SUPPORT_USE_ITEM = true;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import net.citizensnpcs.api.ai.NavigatorParameters;
|
||||
import net.citizensnpcs.api.ai.TargetType;
|
||||
import net.citizensnpcs.api.ai.event.CancelReason;
|
||||
import net.citizensnpcs.api.astar.AStarMachine;
|
||||
import net.citizensnpcs.api.astar.AStarMachine.AStarState;
|
||||
import net.citizensnpcs.api.astar.pathfinder.BlockExaminer;
|
||||
import net.citizensnpcs.api.astar.pathfinder.BlockSource;
|
||||
import net.citizensnpcs.api.astar.pathfinder.MinecraftBlockExaminer;
|
||||
@ -30,12 +31,10 @@ import net.citizensnpcs.util.Util;
|
||||
|
||||
public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
private final Location destination;
|
||||
private int iterations;
|
||||
private final NPC npc;
|
||||
private final NavigatorParameters params;
|
||||
private Path plan;
|
||||
private boolean planned = false;
|
||||
private AStarMachine<VectorNode, Path>.AStarState state;
|
||||
private AStarPlanner planner;
|
||||
private Vector vector;
|
||||
|
||||
public AStarNavigationStrategy(NPC npc, Iterable<Vector> path, NavigatorParameters params) {
|
||||
@ -44,7 +43,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
this.params = params;
|
||||
this.destination = list.get(list.size() - 1).toLocation(npc.getStoredLocation().getWorld());
|
||||
this.npc = npc;
|
||||
setPlan(new Path(list));
|
||||
this.plan = new Path(list);
|
||||
}
|
||||
|
||||
public AStarNavigationStrategy(NPC npc, Location dest, NavigatorParameters params) {
|
||||
@ -69,71 +68,28 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
return destination;
|
||||
}
|
||||
|
||||
public void initialisePathfinder() {
|
||||
params.examiner(new BlockExaminer() {
|
||||
@Override
|
||||
public float getCost(BlockSource source, PathPoint point) {
|
||||
Vector pos = point.getVector();
|
||||
Material above = source.getMaterialAt(pos.setY(pos.getY() + 1));
|
||||
return params.avoidWater() && (MinecraftBlockExaminer.isLiquid(above)
|
||||
|| MinecraftBlockExaminer.isLiquidOrInLiquid(pos.toLocation(source.getWorld()).getBlock())) ? 1F
|
||||
: 0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PassableState isPassable(BlockSource source, PathPoint point) {
|
||||
return PassableState.IGNORE;
|
||||
}
|
||||
});
|
||||
Location location = npc.getEntity().getLocation();
|
||||
VectorGoal goal = new VectorGoal(destination, (float) params.pathDistanceMargin());
|
||||
state = ASTAR.getStateFor(goal,
|
||||
new VectorNode(goal, location, new NMSChunkBlockSource(location, params.range()), params.examiners()));
|
||||
}
|
||||
|
||||
public void setPlan(Path path) {
|
||||
this.plan = path;
|
||||
this.planned = true;
|
||||
if (plan == null || plan.isComplete()) {
|
||||
setCancelReason(CancelReason.STUCK);
|
||||
} else {
|
||||
vector = plan.getCurrentVector();
|
||||
if (params.debug()) {
|
||||
plan.debug();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop() {
|
||||
if (plan != null && params.debug()) {
|
||||
plan.debugEnd();
|
||||
}
|
||||
state = null;
|
||||
plan = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update() {
|
||||
if (!planned) {
|
||||
if (state == null) {
|
||||
initialisePathfinder();
|
||||
if (plan == null) {
|
||||
if (planner == null) {
|
||||
planner = new AStarPlanner(params, npc.getStoredLocation(), destination);
|
||||
}
|
||||
int maxIterations = Setting.MAXIMUM_ASTAR_ITERATIONS.asInt();
|
||||
int iterationsPerTick = Setting.ASTAR_ITERATIONS_PER_TICK.asInt();
|
||||
Path plan = ASTAR.run(state, iterationsPerTick);
|
||||
if (plan == null) {
|
||||
if (state.isEmpty()) {
|
||||
setCancelReason(CancelReason.STUCK);
|
||||
}
|
||||
if (iterationsPerTick > 0 && maxIterations > 0) {
|
||||
iterations += iterationsPerTick;
|
||||
if (iterations > maxIterations) {
|
||||
setCancelReason(CancelReason.STUCK);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setPlan(plan);
|
||||
CancelReason reason = planner.tick(Setting.ASTAR_ITERATIONS_PER_TICK.asInt(),
|
||||
Setting.MAXIMUM_ASTAR_ITERATIONS.asInt());
|
||||
if (reason != null) {
|
||||
setCancelReason(reason);
|
||||
}
|
||||
plan = planner.plan;
|
||||
if (plan != null) {
|
||||
planner = null;
|
||||
}
|
||||
}
|
||||
if (getCancelReason() != null || plan == null || plan.isComplete()) {
|
||||
@ -141,7 +97,7 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
}
|
||||
Location loc = npc.getEntity().getLocation(NPC_LOCATION);
|
||||
/* Proper door movement - gets stuck on corners at times
|
||||
|
||||
|
||||
Block block = currLoc.getWorld().getBlockAt(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ());
|
||||
if (MinecraftBlockExaminer.isDoor(block.getType())) {
|
||||
Door door = (Door) block.getState().getData();
|
||||
@ -184,6 +140,65 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class AStarPlanner {
|
||||
Location from;
|
||||
int iterations;
|
||||
NavigatorParameters params;
|
||||
Path plan;
|
||||
AStarState state;
|
||||
Location to;
|
||||
|
||||
public AStarPlanner(NavigatorParameters params, Location from, Location to) {
|
||||
this.params = params;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
params.examiner(new BlockExaminer() {
|
||||
@Override
|
||||
public float getCost(BlockSource source, PathPoint point) {
|
||||
Vector pos = point.getVector();
|
||||
Material above = source.getMaterialAt(pos.setY(pos.getY() + 1));
|
||||
return params.avoidWater() && (MinecraftBlockExaminer.isLiquid(above)
|
||||
|| MinecraftBlockExaminer.isLiquidOrInLiquid(pos.toLocation(source.getWorld()).getBlock()))
|
||||
? 1F
|
||||
: 0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PassableState isPassable(BlockSource source, PathPoint point) {
|
||||
return PassableState.IGNORE;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public CancelReason tick(int iterationsPerTick, int maxIterations) {
|
||||
if (plan != null)
|
||||
return null;
|
||||
if (state == null) {
|
||||
VectorGoal goal = new VectorGoal(to, (float) params.pathDistanceMargin());
|
||||
state = ASTAR.getStateFor(goal,
|
||||
new VectorNode(goal, from, new NMSChunkBlockSource(from, params.range()), params.examiners()));
|
||||
}
|
||||
Path plan = ASTAR.run(state, iterationsPerTick);
|
||||
if (plan == null) {
|
||||
if (state.isEmpty()) {
|
||||
return CancelReason.STUCK;
|
||||
}
|
||||
if (iterationsPerTick > 0 && maxIterations > 0) {
|
||||
iterations += iterationsPerTick;
|
||||
if (iterations > maxIterations) {
|
||||
return CancelReason.STUCK;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.plan = plan;
|
||||
if (params.debug()) {
|
||||
plan.debug();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static final AStarMachine<VectorNode, Path> ASTAR = AStarMachine.createWithDefaultStorage();
|
||||
private static final Location NPC_LOCATION = new Location(null, 0, 0, 0);
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ import net.citizensnpcs.api.astar.pathfinder.MinecraftBlockExaminer;
|
||||
import net.citizensnpcs.api.astar.pathfinder.SwimmingExaminer;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.util.DataKey;
|
||||
import net.citizensnpcs.npc.ai.AStarNavigationStrategy.AStarPlanner;
|
||||
import net.citizensnpcs.npc.ai.MCNavigationStrategy.MCNavigator;
|
||||
import net.citizensnpcs.trait.RotationTrait;
|
||||
import net.citizensnpcs.trait.RotationTrait.PacketRotationSession;
|
||||
import net.citizensnpcs.trait.RotationTrait.RotationParams;
|
||||
@ -65,7 +67,7 @@ public class CitizensNavigator implements Navigator, Runnable {
|
||||
|
||||
public CitizensNavigator(NPC npc) {
|
||||
this.npc = npc;
|
||||
if (npc.data().get(NPC.DISABLE_DEFAULT_STUCK_ACTION_METADATA, false)) {
|
||||
if (npc.data().get(NPC.Metadata.DISABLE_DEFAULT_STUCK_ACTION, false)) {
|
||||
defaultParams.stuckAction(null);
|
||||
}
|
||||
defaultParams.examiner(new SwimmingExaminer(npc));
|
||||
@ -81,6 +83,23 @@ public class CitizensNavigator implements Navigator, Runnable {
|
||||
stopNavigating(reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNavigateTo(Location dest) {
|
||||
return canNavigateTo(dest, defaultParams.clone());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canNavigateTo(Location dest, NavigatorParameters params) {
|
||||
if (defaultParams.useNewPathfinder()) {
|
||||
AStarPlanner planner = new AStarPlanner(params, npc.getStoredLocation(), dest);
|
||||
planner.tick(Setting.MAXIMUM_ASTAR_ITERATIONS.asInt(), Setting.MAXIMUM_ASTAR_ITERATIONS.asInt());
|
||||
return planner.plan != null;
|
||||
} else {
|
||||
MCNavigator nav = NMS.getTargetNavigator(npc.getEntity(), dest, params);
|
||||
return nav.getCancelReason() == null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public NavigatorParameters getDefaultParameters() {
|
||||
return defaultParams;
|
||||
@ -419,8 +438,7 @@ public class CitizensNavigator implements Navigator, Runnable {
|
||||
|
||||
private void switchParams() {
|
||||
localParams = defaultParams.clone();
|
||||
if (!npc.data().has(NPC.PATHFINDER_OPEN_DOORS_METADATA) ? Setting.NEW_PATHFINDER_OPENS_DOORS.asBoolean()
|
||||
: npc.data().<Boolean> get(NPC.PATHFINDER_OPEN_DOORS_METADATA)) {
|
||||
if (npc.data().get(NPC.Metadata.PATHFINDER_OPEN_DOORS, Setting.NEW_PATHFINDER_OPENS_DOORS.asBoolean())) {
|
||||
localParams.examiner(new DoorExaminer());
|
||||
}
|
||||
if (Setting.NEW_PATHFINDER_CHECK_BOUNDING_BOXES.asBoolean()) {
|
||||
|
@ -142,12 +142,12 @@ public class ArmorStandTrait extends Trait {
|
||||
setMarker(true);
|
||||
setVisible(false);
|
||||
npc.setProtected(true);
|
||||
npc.data().set(NPC.NAMEPLATE_VISIBLE_METADATA, false);
|
||||
npc.data().set(NPC.Metadata.NAMEPLATE_VISIBLE, false);
|
||||
}
|
||||
|
||||
public void setAsPointEntityWithName() {
|
||||
setAsPointEntity();
|
||||
npc.data().set(NPC.NAMEPLATE_VISIBLE_METADATA, true);
|
||||
npc.data().set(NPC.Metadata.NAMEPLATE_VISIBLE, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +54,7 @@ public class ScoreboardTrait extends Trait {
|
||||
|
||||
public void createTeam(String entityName) {
|
||||
String teamName = Util.getTeamName(npc.getUniqueId());
|
||||
npc.data().set(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA, teamName);
|
||||
npc.data().set(NPC.Metadata.SCOREBOARD_FAKE_TEAM_NAME, teamName);
|
||||
Scoreboard scoreboard = Util.getDummyScoreboard();
|
||||
Team team = scoreboard.getTeam(teamName);
|
||||
if (team == null) {
|
||||
@ -84,11 +84,11 @@ public class ScoreboardTrait extends Trait {
|
||||
if (npc.getEntity() == null)
|
||||
return;
|
||||
String name = npc.getEntity() instanceof Player ? npc.getEntity().getName() : npc.getUniqueId().toString();
|
||||
String teamName = npc.data().get(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA, "");
|
||||
String teamName = npc.data().get(NPC.Metadata.SCOREBOARD_FAKE_TEAM_NAME, "");
|
||||
if (teamName.isEmpty())
|
||||
return;
|
||||
Team team = Util.getDummyScoreboard().getTeam(teamName);
|
||||
npc.data().remove(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA);
|
||||
npc.data().remove(NPC.Metadata.SCOREBOARD_FAKE_TEAM_NAME);
|
||||
if (team == null)
|
||||
return;
|
||||
if (team.hasEntry(name)) {
|
||||
@ -132,7 +132,7 @@ public class ScoreboardTrait extends Trait {
|
||||
|
||||
if (!Setting.USE_SCOREBOARD_TEAMS.asBoolean()) {
|
||||
team.unregister();
|
||||
npc.data().remove(NPC.SCOREBOARD_FAKE_TEAM_NAME_METADATA);
|
||||
npc.data().remove(NPC.Metadata.SCOREBOARD_FAKE_TEAM_NAME);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ public class ScoreboardTrait extends Trait {
|
||||
|
||||
if (SUPPORT_COLLIDABLE_SETOPTION) {
|
||||
try {
|
||||
OptionStatus collide = npc.data().<Boolean> get(NPC.COLLIDABLE_METADATA, !npc.isProtected())
|
||||
OptionStatus collide = npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE, !npc.isProtected())
|
||||
? OptionStatus.ALWAYS
|
||||
: OptionStatus.NEVER;
|
||||
if (collide != team.getOption(Option.COLLISION_RULE)) {
|
||||
|
@ -34,9 +34,11 @@ import net.citizensnpcs.api.gui.Menu;
|
||||
import net.citizensnpcs.api.gui.MenuContext;
|
||||
import net.citizensnpcs.api.gui.MenuPattern;
|
||||
import net.citizensnpcs.api.gui.MenuSlot;
|
||||
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.trait.trait.Owner;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.Placeholders;
|
||||
import net.citizensnpcs.trait.shop.CommandAction;
|
||||
@ -109,11 +111,17 @@ public class ShopTrait extends Trait {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean canEdit(NPC npc, Player sender) {
|
||||
return sender.hasPermission("citizens.admin") || sender.hasPermission("citizens.npc.shop.edit")
|
||||
|| sender.hasPermission("citizens.npc.shop.edit." + getName())
|
||||
|| npc.getOrAddTrait(Owner.class).isOwnedBy(sender);
|
||||
}
|
||||
|
||||
public void display(Player sender) {
|
||||
if (viewPermission != null && !sender.hasPermission(viewPermission))
|
||||
return;
|
||||
if (pages.size() == 0) {
|
||||
Messaging.send(sender, "<red>Empty shop");
|
||||
Messaging.sendError(sender, "Empty shop");
|
||||
return;
|
||||
}
|
||||
InventoryMenu.createSelfRegistered(new NPCShopViewer(this, sender)).present(sender);
|
||||
|
@ -28,9 +28,9 @@ public class SneakTrait extends Trait {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (npc.data().has(NPC.SNEAKING_METADATA)) {
|
||||
setSneaking(npc.data().get(NPC.SNEAKING_METADATA));
|
||||
npc.data().remove(NPC.SNEAKING_METADATA);
|
||||
if (npc.data().has(NPC.Metadata.SNEAKING)) {
|
||||
setSneaking(npc.data().get(NPC.Metadata.SNEAKING));
|
||||
npc.data().remove(NPC.Metadata.SNEAKING);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -152,12 +151,11 @@ public class Text extends Trait implements Runnable, Listener {
|
||||
|
||||
@EventHandler
|
||||
private void onRightClick(NPCRightClickEvent event) {
|
||||
if (!event.getNPC().equals(npc))
|
||||
if (!event.getNPC().equals(npc) || text.size() == 0)
|
||||
return;
|
||||
String localPattern = itemInHandPattern.equals("default") ? Setting.TALK_ITEM.asString() : itemInHandPattern;
|
||||
if (Util.matchesItemInHand(event.getClicker(), localPattern) && !shouldTalkClose()) {
|
||||
sendCooldownMessage(event.getClicker());
|
||||
event.setCancelled(true);
|
||||
talk(event.getClicker());
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,16 +172,13 @@ public class Text extends Trait implements Runnable, Listener {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (!npc.isSpawned())
|
||||
return;
|
||||
|
||||
if (!talkClose)
|
||||
if (!npc.isSpawned() || !talkClose || text.size() == 0)
|
||||
return;
|
||||
|
||||
for (Player player : CitizensAPI.getLocationLookup().getNearbyPlayers(npc.getEntity().getLocation(), range)) {
|
||||
if (player.getGameMode() == GameMode.SPECTATOR)
|
||||
continue;
|
||||
sendCooldownMessage(player);
|
||||
talk(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,26 +197,6 @@ public class Text extends Trait implements Runnable, Listener {
|
||||
}
|
||||
}
|
||||
|
||||
private void sendCooldownMessage(Player player) {
|
||||
Long cooldown = cooldowns.get(player.getUniqueId());
|
||||
if (cooldown != null) {
|
||||
if (System.currentTimeMillis() < cooldown)
|
||||
return;
|
||||
|
||||
cooldowns.remove(player.getUniqueId());
|
||||
}
|
||||
|
||||
sendText(player);
|
||||
|
||||
int secondsDelta = delay != -1 ? delay
|
||||
: RANDOM.nextInt(Setting.TALK_CLOSE_MAXIMUM_COOLDOWN.asInt())
|
||||
+ Setting.TALK_CLOSE_MINIMUM_COOLDOWN.asInt();
|
||||
if (secondsDelta <= 0)
|
||||
return;
|
||||
long millisecondsDelta = TimeUnit.MILLISECONDS.convert(secondsDelta, TimeUnit.SECONDS);
|
||||
cooldowns.put(player.getUniqueId(), System.currentTimeMillis() + millisecondsDelta);
|
||||
}
|
||||
|
||||
boolean sendPage(CommandSender player, int page) {
|
||||
Paginator paginator = new Paginator().header("Current Texts").enablePageSwitcher("/npc text page $page");
|
||||
for (int i = 0; i < text.size(); i++) {
|
||||
@ -292,9 +267,20 @@ public class Text extends Trait implements Runnable, Listener {
|
||||
return talkClose;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public boolean toggle() {
|
||||
return toggleTalkClose();
|
||||
private void talk(Player player) {
|
||||
Long cooldown = cooldowns.get(player.getUniqueId());
|
||||
if (cooldown != null) {
|
||||
if (System.currentTimeMillis() < cooldown)
|
||||
return;
|
||||
|
||||
cooldowns.remove(player.getUniqueId());
|
||||
}
|
||||
|
||||
sendText(player);
|
||||
|
||||
if (delay <= 0)
|
||||
return;
|
||||
cooldowns.put(player.getUniqueId(), System.currentTimeMillis() + (delay * 50));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -486,8 +486,8 @@ public class NMS {
|
||||
BRIDGE.playAnimation(animation, player, radius);
|
||||
}
|
||||
|
||||
public static void playerTick(Player entity) {
|
||||
BRIDGE.playerTick(entity);
|
||||
public static Runnable playerTicker(Player entity) {
|
||||
return BRIDGE.playerTicker(entity);
|
||||
}
|
||||
|
||||
public static void registerEntityClass(Class<?> clazz) {
|
||||
@ -689,6 +689,7 @@ public class NMS {
|
||||
private static Object UNSAFE;
|
||||
private static MethodHandle UNSAFE_FIELD_OFFSET;
|
||||
private static MethodHandle UNSAFE_PUT_OBJECT;
|
||||
|
||||
private static MethodHandle UNSAFE_STATIC_FIELD_OFFSET;
|
||||
|
||||
static {
|
||||
|
@ -130,7 +130,7 @@ public interface NMSBridge {
|
||||
|
||||
public void playAnimation(PlayerAnimation animation, Player player, int radius);
|
||||
|
||||
public void playerTick(Player entity);
|
||||
public Runnable playerTicker(Player entity);
|
||||
|
||||
public void registerEntityClass(Class<?> clazz);
|
||||
|
||||
@ -146,9 +146,9 @@ public interface NMSBridge {
|
||||
|
||||
public void sendPositionUpdate(Player excluding, Entity from, Location location);
|
||||
|
||||
public void sendRotationNearby(Entity from, float bodyYaw, float headYaw, float pitch);
|
||||
public void sendRotationNearby(Entity from, float bodyYaw, float headYaw, float pitch);;
|
||||
|
||||
public boolean sendTabListAdd(Player recipient, Player listPlayer);;
|
||||
public boolean sendTabListAdd(Player recipient, Player listPlayer);
|
||||
|
||||
public void sendTabListRemove(Player recipient, Collection<? extends SkinnableEntity> skinnableNPCs);
|
||||
|
||||
@ -166,13 +166,13 @@ public interface NMSBridge {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void setCustomName(Entity entity, Object component, String string);
|
||||
public void setCustomName(Entity entity, Object component, String string);;
|
||||
|
||||
public void setDestination(Entity entity, double x, double y, double z, float speed);;
|
||||
public void setDestination(Entity entity, double x, double y, double z, float speed);
|
||||
|
||||
public void setEndermanAngry(Enderman enderman, boolean angry);
|
||||
|
||||
public void setHeadYaw(Entity entity, float yaw);
|
||||
public void setHeadYaw(Entity entity, float yaw);;
|
||||
|
||||
public void setKnockbackResistance(LivingEntity entity, double d);;
|
||||
|
||||
@ -180,13 +180,13 @@ public interface NMSBridge {
|
||||
throw new UnsupportedOperationException();
|
||||
};
|
||||
|
||||
public void setNavigationTarget(Entity handle, Entity target, float speed);;
|
||||
public void setNavigationTarget(Entity handle, Entity target, float speed);
|
||||
|
||||
public void setNoGravity(Entity entity, boolean nogravity);
|
||||
public void setNoGravity(Entity entity, boolean nogravity);;
|
||||
|
||||
public default void setPandaSitting(Entity entity, boolean sitting) {
|
||||
throw new UnsupportedOperationException();
|
||||
};
|
||||
}
|
||||
|
||||
public default void setPeekShulker(Entity entity, int peek) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
@ -11,6 +11,10 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.npc.ai.NPCHolder;
|
||||
|
||||
public class PlayerUpdateTask extends BukkitRunnable {
|
||||
@Override
|
||||
public void cancel() {
|
||||
@ -43,14 +47,35 @@ public class PlayerUpdateTask extends BukkitRunnable {
|
||||
PLAYERS.remove(entity.getUniqueId());
|
||||
}
|
||||
for (Entity entity : PLAYERS_PENDING_ADD) {
|
||||
PLAYERS.put(entity.getUniqueId(), (Player) entity);
|
||||
PlayerTick rm = PLAYERS.remove(entity.getUniqueId());
|
||||
if (rm != null) {
|
||||
NPC old = ((NPCHolder) rm).getNPC();
|
||||
NPC next = ((NPCHolder) entity).getNPC();
|
||||
Messaging.severe(old == next ? "Player registered twice"
|
||||
: "Player registered twice with different NPC instances", rm.entity.getUniqueId());
|
||||
rm.entity.remove();
|
||||
}
|
||||
PLAYERS.put(entity.getUniqueId(), new PlayerTick((Player) entity));
|
||||
}
|
||||
PLAYERS_PENDING_ADD.clear();
|
||||
PLAYERS_PENDING_REMOVE.clear();
|
||||
|
||||
for (Player entity : PLAYERS.values()) {
|
||||
PLAYERS.values().forEach(Runnable::run);
|
||||
}
|
||||
|
||||
private static class PlayerTick implements Runnable {
|
||||
Player entity;
|
||||
Runnable tick;
|
||||
|
||||
public PlayerTick(Player player) {
|
||||
entity = player;
|
||||
tick = NMS.playerTicker(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (entity.isValid()) {
|
||||
NMS.playerTick(entity);
|
||||
tick.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -76,10 +101,10 @@ public class PlayerUpdateTask extends BukkitRunnable {
|
||||
PLAYERS_PENDING_ADD.add(entity);
|
||||
}
|
||||
|
||||
private static Map<UUID, org.bukkit.entity.Player> PLAYERS = new HashMap<UUID, org.bukkit.entity.Player>();
|
||||
private static List<org.bukkit.entity.Entity> PLAYERS_PENDING_ADD = new ArrayList<org.bukkit.entity.Entity>();
|
||||
private static List<org.bukkit.entity.Entity> PLAYERS_PENDING_REMOVE = new ArrayList<org.bukkit.entity.Entity>();
|
||||
private static Map<UUID, org.bukkit.entity.Entity> TICKERS = new HashMap<UUID, org.bukkit.entity.Entity>();
|
||||
private static List<org.bukkit.entity.Entity> TICKERS_PENDING_ADD = new ArrayList<org.bukkit.entity.Entity>();
|
||||
private static List<org.bukkit.entity.Entity> TICKERS_PENDING_REMOVE = new ArrayList<org.bukkit.entity.Entity>();
|
||||
private static Map<UUID, PlayerTick> PLAYERS = new HashMap<>();
|
||||
private static List<Entity> PLAYERS_PENDING_ADD = new ArrayList<>();
|
||||
private static List<Entity> PLAYERS_PENDING_REMOVE = new ArrayList<>();
|
||||
private static Map<UUID, Entity> TICKERS = new HashMap<>();
|
||||
private static List<Entity> TICKERS_PENDING_ADD = new ArrayList<>();
|
||||
private static List<Entity> TICKERS_PENDING_REMOVE = new ArrayList<>();
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class Util {
|
||||
return new Vector(x, y, z);
|
||||
}
|
||||
boolean allowed = !npc.isProtected()
|
||||
|| (npc.data().has(NPC.COLLIDABLE_METADATA) && npc.data().<Boolean> get(NPC.COLLIDABLE_METADATA));
|
||||
|| (npc.data().has(NPC.Metadata.COLLIDABLE) && npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE));
|
||||
if (NPCPushEvent.getHandlerList().getRegisteredListeners().length == 0) {
|
||||
return allowed ? new Vector(x, y, z) : null;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ citizens.editors.text.invalid-range=Invalid range.
|
||||
citizens.editors.text.invalid-delay=Invalid delay.
|
||||
citizens.editors.text.random-talker-set=[[Random talking]] set to [[{0}]].
|
||||
citizens.editors.text.range-set=[[Range]] set to [[{0}]].
|
||||
citizens.editors.text.delay-set=[[Delay]] set to [[{0}]] seconds.
|
||||
citizens.editors.text.delay-set=[[Delay]] set to [[{0}]] ticks.
|
||||
citizens.editors.text.realistic-looking-set=[[Realistic looking]] set to [[{0}]].
|
||||
citizens.editors.text.speech-bubbles-set=[[Speech bubbles]] set to [[{0}]].
|
||||
citizens.editors.text.start-prompt=<click:suggest_command:add ><yellow>Add text</click> | <click:suggest_command:item ><hover:show_text:"Set the talk item in hand pattern (set to <yellow>default</yellow> to clear)"><yellow>item</hover></click> | <click:suggest_command:range ><hover:show_text:Set the talking range in blocks><yellow>range</hover></click> | <click:suggest_command:delay ><hover:show_text:Set the talking delay in seconds><yellow>delay</yellow></hover></click><br><click:run_command:/npc text close><hover:show_text:Toggle sending messages when players get close>{0}talk close</hover></click> | <click:run_command:/npc text random><hover:show_text:Toggle random talking>{1}random</hover></click> | <click:run_command:/npc text speech bubbles><hover:show_text:Toggle showing text as holograms instead of chat messages>{2}speech bubbles</hover></click> | <click:run_command:/npc text realistic looking><hover:show_text:Toggle requiring line of sight before speaking>{3}realistic</hover></click>
|
||||
|
@ -71,12 +71,12 @@ public class BatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -115,7 +115,7 @@ public class BatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class BatController extends MobEntityController {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -68,12 +68,12 @@ public class BlazeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -112,7 +112,7 @@ public class BlazeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -132,7 +132,7 @@ public class BlazeController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class CaveSpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,7 +137,7 @@ public class CaveSpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -158,7 +158,7 @@ public class CaveSpiderController extends MobEntityController {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault)) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
if (super.isLeashed()) {
|
||||
|
@ -88,12 +88,12 @@ public class ChickenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -148,7 +148,7 @@ public class ChickenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -168,7 +168,7 @@ public class ChickenController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -103,12 +103,12 @@ public class CowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -163,7 +163,7 @@ public class CowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -183,7 +183,7 @@ public class CowController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -88,12 +88,12 @@ public class CreeperController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -147,7 +147,7 @@ public class CreeperController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -167,7 +167,7 @@ public class CreeperController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -68,12 +68,12 @@ public class EnderDragonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -111,7 +111,7 @@ public class EnderDragonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,7 +131,7 @@ public class EnderDragonController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class EndermanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class EndermanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -156,7 +156,7 @@ public class EndermanController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class EndermiteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class EndermiteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -156,7 +156,7 @@ public class EndermiteController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -22,6 +22,7 @@ import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
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_10_R1.network.EmptyNetHandler;
|
||||
@ -73,7 +74,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
private final CitizensNPC npc;
|
||||
private final Location packetLocationCache = new Location(null, 0, 0, 0);
|
||||
private final SkinPacketTracker skinTracker;
|
||||
private int updateCounter = 0;
|
||||
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
@ -114,12 +114,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -278,7 +278,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
@Override
|
||||
public boolean isCollidable() {
|
||||
return npc == null ? super.isCollidable()
|
||||
: npc.data().has(NPC.COLLIDABLE_METADATA) ? npc.data().<Boolean> get(NPC.COLLIDABLE_METADATA)
|
||||
: npc.data().has(NPC.Metadata.COLLIDABLE) ? npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE)
|
||||
: !npc.isProtected();
|
||||
}
|
||||
|
||||
@ -336,18 +336,10 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
super.m();
|
||||
if (npc == null)
|
||||
return;
|
||||
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
|
||||
updateEffects = true;
|
||||
}
|
||||
this.noclip = isSpectator();
|
||||
Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity);
|
||||
|
||||
boolean navigating = npc.getNavigator().isNavigating();
|
||||
updatePackets(navigating);
|
||||
|
||||
if (noDamageTicks > 0) {
|
||||
--noDamageTicks;
|
||||
}
|
||||
updatePackets(npc.getNavigator().isNavigating());
|
||||
|
||||
npc.update();
|
||||
}
|
||||
@ -428,10 +420,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void updatePackets(boolean navigating) {
|
||||
if (updateCounter++ <= npc.data().<Integer> get(NPC.Metadata.PACKET_UPDATE_DELAY,
|
||||
Setting.PACKET_UPDATE_DELAY.asInt()))
|
||||
if (!npc.isUpdating(NPCUpdate.PACKET))
|
||||
return;
|
||||
updateCounter = 0;
|
||||
updateEffects = true;
|
||||
boolean itemChanged = false;
|
||||
for (EnumItemSlot slot : EnumItemSlot.values()) {
|
||||
ItemStack equipment = getEquipment(slot);
|
||||
|
@ -54,12 +54,12 @@ public class GhastController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,7 +103,7 @@ public class GhastController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class GhastController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class GiantController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class GiantController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class GiantController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class GuardianController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class GuardianController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class GuardianController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -86,12 +86,12 @@ public class HorseController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,7 +154,7 @@ public class HorseController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -174,7 +174,7 @@ public class HorseController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class IronGolemController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class IronGolemController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class IronGolemController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -69,12 +69,12 @@ public class MagmaCubeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -135,7 +135,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -155,7 +155,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -85,12 +85,12 @@ public class MushroomCowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +144,7 @@ public class MushroomCowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -164,7 +164,7 @@ public class MushroomCowController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -74,12 +74,12 @@ public class OcelotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -140,7 +140,7 @@ public class OcelotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -160,7 +160,7 @@ public class OcelotController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -75,12 +75,12 @@ public class PigController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class PigController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -163,7 +163,7 @@ public class PigController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -64,12 +64,12 @@ public class PigZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class PigZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class PigZombieController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -65,12 +65,12 @@ public class PolarBearController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -109,7 +109,7 @@ public class PolarBearController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -130,7 +130,7 @@ public class PolarBearController extends MobEntityController {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -75,12 +75,12 @@ public class RabbitController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -135,7 +135,7 @@ public class RabbitController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -160,7 +160,7 @@ public class RabbitController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -74,12 +74,12 @@ public class SheepController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +133,7 @@ public class SheepController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -153,7 +153,7 @@ public class SheepController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -64,12 +64,12 @@ public class ShulkerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class ShulkerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class ShulkerController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SilverfishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SilverfishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SilverfishController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SkeletonController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -69,12 +69,12 @@ public class SlimeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class SlimeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -156,7 +156,7 @@ public class SlimeController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SnowmanController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SpiderController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SquidController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -80,7 +80,7 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack) {
|
||||
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
|
||||
if (npc != null && npc.data().get(NPC.Metadata.VILLAGER_BLOCK_TRADES, true)) {
|
||||
blockingATrade = true;
|
||||
}
|
||||
return super.a(entityhuman, enumhand, itemstack);
|
||||
@ -88,12 +88,12 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,7 +157,7 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -177,7 +177,7 @@ public class VillagerController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class WitchController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class WitchController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class WitchController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -54,12 +54,12 @@ public class WitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,7 +103,7 @@ public class WitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class WitherController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -76,12 +76,12 @@ public class WolfController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class WolfController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -156,7 +156,7 @@ public class WolfController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class ZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bV() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class ZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class ZombieController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -891,8 +891,8 @@ public class NMSImpl implements NMSBridge {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playerTick(Player entity) {
|
||||
((EntityPlayer) getHandle(entity)).k_();
|
||||
public Runnable playerTicker(Player entity) {
|
||||
return ((EntityPlayer) getHandle(entity))::k_;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1719,7 +1719,7 @@ public class NMSImpl implements NMSBridge {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static SoundEffect getSoundEffect(NPC npc, SoundEffect snd, String meta) {
|
||||
public static SoundEffect getSoundEffect(NPC npc, SoundEffect snd, NPC.Metadata meta) {
|
||||
return npc == null || !npc.data().has(meta) ? snd
|
||||
: SoundEffect.a.get(new MinecraftKey(npc.data().get(meta, snd == null ? "" : snd.toString())));
|
||||
}
|
||||
@ -1748,9 +1748,9 @@ public class NMSImpl implements NMSBridge {
|
||||
NPC npc = ((NPCHolder) minecart).getNPC();
|
||||
if (npc == null)
|
||||
return;
|
||||
Material mat = Material.getMaterial(npc.data().get(NPC.MINECART_ITEM_METADATA, ""));
|
||||
int data = npc.data().get(NPC.MINECART_ITEM_DATA_METADATA, 0);
|
||||
int offset = npc.data().get(NPC.MINECART_OFFSET_METADATA, 0);
|
||||
Material mat = Material.getMaterial(npc.data().get(NPC.Metadata.MINECART_ITEM, ""));
|
||||
int data = npc.data().get(NPC.Metadata.MINECART_ITEM_DATA, 0);
|
||||
int offset = npc.data().get(NPC.Metadata.MINECART_OFFSET, 0);
|
||||
minecart.a(mat != null);
|
||||
if (mat != null) {
|
||||
minecart.setDisplayBlock(Block.getById(mat.getId()).fromLegacyData(data));
|
||||
|
@ -71,12 +71,12 @@ public class BatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -115,7 +115,7 @@ public class BatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,7 +137,7 @@ public class BatController extends MobEntityController {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -68,12 +68,12 @@ public class BlazeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -112,7 +112,7 @@ public class BlazeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +133,7 @@ public class BlazeController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class CaveSpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -137,7 +137,7 @@ public class CaveSpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -159,7 +159,7 @@ public class CaveSpiderController extends MobEntityController {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault)) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
if (super.isLeashed()) {
|
||||
|
@ -88,12 +88,12 @@ public class ChickenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -148,7 +148,7 @@ public class ChickenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -169,7 +169,7 @@ public class ChickenController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -103,12 +103,12 @@ public class CowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -163,7 +163,7 @@ public class CowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -184,7 +184,7 @@ public class CowController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -80,12 +80,12 @@ public class CreeperController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -139,7 +139,7 @@ public class CreeperController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -160,7 +160,7 @@ public class CreeperController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -68,12 +68,12 @@ public class EnderDragonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -111,7 +111,7 @@ public class EnderDragonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -132,7 +132,7 @@ public class EnderDragonController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class EndermanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class EndermanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,7 +157,7 @@ public class EndermanController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class EndermiteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class EndermiteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -157,7 +157,7 @@ public class EndermiteController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -22,6 +22,7 @@ import net.citizensnpcs.Settings.Setting;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.event.NPCEnderTeleportEvent;
|
||||
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_11_R1.network.EmptyNetHandler;
|
||||
@ -75,7 +76,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
private final CitizensNPC npc;
|
||||
private final Location packetLocationCache = new Location(null, 0, 0, 0);
|
||||
private final SkinPacketTracker skinTracker;
|
||||
private int updateCounter = 0;
|
||||
|
||||
public EntityHumanNPC(MinecraftServer minecraftServer, WorldServer world, GameProfile gameProfile,
|
||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||
@ -120,9 +120,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
if (npc == null)
|
||||
return;
|
||||
this.noclip = isSpectator();
|
||||
if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) {
|
||||
updateEffects = true;
|
||||
}
|
||||
Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity);
|
||||
|
||||
boolean navigating = npc.getNavigator().isNavigating() || controllerMove.a();
|
||||
@ -133,12 +130,12 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -247,7 +244,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
|
||||
@Override
|
||||
public IChatBaseComponent getPlayerListName() {
|
||||
if (npc.data().get(NPC.REMOVE_FROM_PLAYERLIST_METADATA, Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean())) {
|
||||
if (Setting.DISABLE_TABLIST.asBoolean()) {
|
||||
return new ChatComponentText("");
|
||||
}
|
||||
return super.getPlayerListName();
|
||||
@ -305,7 +302,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
@Override
|
||||
public boolean isCollidable() {
|
||||
return npc == null ? super.isCollidable()
|
||||
: npc.data().has(NPC.COLLIDABLE_METADATA) ? npc.data().<Boolean> get(NPC.COLLIDABLE_METADATA)
|
||||
: npc.data().has(NPC.Metadata.COLLIDABLE) ? npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE)
|
||||
: !npc.isProtected();
|
||||
}
|
||||
|
||||
@ -434,10 +431,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
}
|
||||
|
||||
private void updatePackets(boolean navigating) {
|
||||
if (updateCounter++ <= npc.data().<Integer> get(NPC.Metadata.PACKET_UPDATE_DELAY,
|
||||
Setting.PACKET_UPDATE_DELAY.asInt()))
|
||||
if (!npc.isUpdating(NPCUpdate.PACKET))
|
||||
return;
|
||||
updateCounter = 0;
|
||||
updateEffects = true;
|
||||
boolean itemChanged = false;
|
||||
for (EnumItemSlot slot : EnumItemSlot.values()) {
|
||||
ItemStack equipment = getEquipment(slot);
|
||||
|
@ -63,12 +63,12 @@ public class EvokerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class EvokerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +144,7 @@ public class EvokerController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -54,12 +54,12 @@ public class GhastController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,7 +103,7 @@ public class GhastController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -124,7 +124,7 @@ public class GhastController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class GiantController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class GiantController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class GiantController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class GuardianController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class GuardianController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +144,7 @@ public class GuardianController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class GuardianElderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class GuardianElderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +144,7 @@ public class GuardianElderController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -86,12 +86,12 @@ public class HorseController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -146,7 +146,7 @@ public class HorseController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -167,7 +167,7 @@ public class HorseController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -86,12 +86,12 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -146,7 +146,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -167,7 +167,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -86,12 +86,12 @@ public class HorseMuleController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -146,7 +146,7 @@ public class HorseMuleController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -167,7 +167,7 @@ public class HorseMuleController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -87,12 +87,12 @@ public class HorseSkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -147,7 +147,7 @@ public class HorseSkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -168,7 +168,7 @@ public class HorseSkeletonController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -87,12 +87,12 @@ public class HorseZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -147,7 +147,7 @@ public class HorseZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -168,7 +168,7 @@ public class HorseZombieController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class IronGolemController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class IronGolemController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class IronGolemController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -86,12 +86,12 @@ public class LlamaController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -146,7 +146,7 @@ public class LlamaController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -167,7 +167,7 @@ public class LlamaController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class MagmaCubeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -164,7 +164,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -84,12 +84,12 @@ public class MushroomCowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,7 +143,7 @@ public class MushroomCowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -164,7 +164,7 @@ public class MushroomCowController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -74,12 +74,12 @@ public class OcelotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -140,7 +140,7 @@ public class OcelotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -161,7 +161,7 @@ public class OcelotController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -75,12 +75,12 @@ public class PigController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,7 +141,7 @@ public class PigController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -162,7 +162,7 @@ public class PigController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -64,12 +64,12 @@ public class PigZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class PigZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +144,7 @@ public class PigZombieController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -65,12 +65,12 @@ public class PolarBearController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -109,7 +109,7 @@ public class PolarBearController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -131,7 +131,7 @@ public class PolarBearController extends MobEntityController {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -75,12 +75,12 @@ public class RabbitController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -135,7 +135,7 @@ public class RabbitController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -161,7 +161,7 @@ public class RabbitController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -74,12 +74,12 @@ public class SheepController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +133,7 @@ public class SheepController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,7 +154,7 @@ public class SheepController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -74,12 +74,12 @@ public class ShulkerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -133,7 +133,7 @@ public class ShulkerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -153,7 +153,7 @@ public class ShulkerController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SilverfishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SilverfishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SilverfishController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SkeletonController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SkeletonStrayController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SkeletonStrayController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SkeletonStrayController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SkeletonWitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SkeletonWitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SkeletonWitherController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -77,12 +77,12 @@ public class SlimeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -144,7 +144,7 @@ public class SlimeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -164,7 +164,7 @@ public class SlimeController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SnowmanController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SpiderController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class SquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class SquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class SquidController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -57,12 +57,12 @@ public class VexController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -101,7 +101,7 @@ public class VexController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class VexController extends MobEntityController {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -82,7 +82,7 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean a(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
if (npc != null && npc.data().get(NPC.VILLAGER_BLOCK_TRADES, true)) {
|
||||
if (npc != null && npc.data().get(NPC.Metadata.VILLAGER_BLOCK_TRADES, true)) {
|
||||
blockingATrade = true;
|
||||
List<MerchantRecipe> list = getOffers(entityhuman);
|
||||
if (list != null) {
|
||||
@ -94,12 +94,12 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -163,7 +163,7 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -183,7 +183,7 @@ public class VillagerController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -74,12 +74,12 @@ public class VindicatorController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -134,7 +134,7 @@ public class VindicatorController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -154,7 +154,7 @@ public class VindicatorController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class WitchController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class WitchController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class WitchController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -54,12 +54,12 @@ public class WitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -103,7 +103,7 @@ public class WitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -123,7 +123,7 @@ public class WitherController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -76,12 +76,12 @@ public class WolfController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -136,7 +136,7 @@ public class WolfController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -156,7 +156,7 @@ public class WolfController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
@ -63,12 +63,12 @@ public class ZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect bW() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.DEATH_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected SoundEffect bX() {
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.HURT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.bX(), NPC.Metadata.HURT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +122,7 @@ public class ZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
protected SoundEffect G() {
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.AMBIENT_SOUND_METADATA);
|
||||
return NMSImpl.getSoundEffect(npc, super.G(), NPC.Metadata.AMBIENT_SOUND);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -142,7 +142,7 @@ public class ZombieController extends MobEntityController {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.isProtected();
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
if (!protectedDefault || !npc.data().get(NPC.Metadata.LEASH_PROTECTED, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
unleash(true, false); // clearLeash with client update
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user