mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-16 20:31:30 +01:00
Aggressively send scoreboard teams
This commit is contained in:
parent
ac92bafa71
commit
acca94d911
@ -102,6 +102,7 @@ import net.citizensnpcs.trait.ClickRedirectTrait;
|
||||
import net.citizensnpcs.trait.CommandTrait;
|
||||
import net.citizensnpcs.trait.Controllable;
|
||||
import net.citizensnpcs.trait.CurrentLocation;
|
||||
import net.citizensnpcs.trait.ScoreboardTrait;
|
||||
import net.citizensnpcs.util.ChunkCoord;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
@ -117,7 +118,7 @@ public class EventListen implements Listener {
|
||||
this.skinUpdateTracker = new SkinUpdateTracker(registries);
|
||||
}
|
||||
|
||||
private void checkCreationEvent(CommandSenderCreateNPCEvent event) {
|
||||
private void checkCreationEvent(CommandSenderCreateNPCEvent event) {
|
||||
if (event.getCreator().hasPermission("citizens.admin.avoid-limits"))
|
||||
return;
|
||||
int limit = Setting.DEFAULT_NPC_LIMIT.asInt();
|
||||
@ -503,10 +504,6 @@ public class EventListen implements Listener {
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
skinUpdateTracker.updatePlayer(event.getPlayer(), Setting.INITIAL_PLAYER_JOIN_SKIN_PACKET_DELAY_TICKS.asInt(),
|
||||
true);
|
||||
|
||||
if (Setting.USE_SCOREBOARD_TEAMS.asBoolean()) {
|
||||
Util.updateNPCTeams(event.getPlayer(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
@ -538,6 +535,7 @@ public class EventListen implements Listener {
|
||||
}
|
||||
}
|
||||
skinUpdateTracker.removePlayer(event.getPlayer().getUniqueId());
|
||||
ScoreboardTrait.onPlayerQuit(event);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
|
@ -669,14 +669,14 @@ public class NPCCommands {
|
||||
npc.getNavigator().getDefaultParameters().debug(!npc.getNavigator().getDefaultParameters().debug());
|
||||
Messaging.send(sender, "Path debugging set to " + npc.getNavigator().getDefaultParameters().debug());
|
||||
} else if (args.hasFlag('n')) {
|
||||
String output = "Use new finder " + npc.getNavigator().getDefaultParameters().useNewPathfinder();
|
||||
output += "Distance margin " + npc.getNavigator().getDefaultParameters().distanceMargin() + "(path margin "
|
||||
+ npc.getNavigator().getDefaultParameters().pathDistanceMargin() + ")<br>";
|
||||
String output = "Use new finder [[" + npc.getNavigator().getDefaultParameters().useNewPathfinder();
|
||||
output += "]] distance margin [[" + npc.getNavigator().getDefaultParameters().distanceMargin()
|
||||
+ "]] (path margin [[" + npc.getNavigator().getDefaultParameters().pathDistanceMargin() + "]])<br>";
|
||||
output += "Teleport if below " + npc.getNavigator().getDefaultParameters().destinationTeleportMargin()
|
||||
+ " blocks<br>";
|
||||
output += "Range " + npc.getNavigator().getDefaultParameters().range() + "<br>";
|
||||
output += "Stuck action " + npc.getNavigator().getDefaultParameters().stuckAction() + "<br>";
|
||||
output += "Speed " + npc.getNavigator().getDefaultParameters().speed() + "<br>";
|
||||
output += "Range [[" + npc.getNavigator().getDefaultParameters().range() + "]] speed [["
|
||||
+ npc.getNavigator().getDefaultParameters().speed() + "]]<br>";
|
||||
output += "Stuck action [[" + npc.getNavigator().getDefaultParameters().stuckAction() + "]]<br>";
|
||||
Messaging.send(sender, output);
|
||||
}
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
* Finds a new look-close target
|
||||
*/
|
||||
public void findNewTarget() {
|
||||
double min = range * range;
|
||||
double min = range;
|
||||
Player old = lookingAt;
|
||||
for (Entity entity : npc.getEntity().getNearbyEntities(range, range, range)) {
|
||||
if (!(entity instanceof Player))
|
||||
@ -96,7 +96,7 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
Location location = player.getLocation(CACHE_LOCATION);
|
||||
if (location.getWorld() != NPC_LOCATION.getWorld())
|
||||
continue;
|
||||
double dist = location.distanceSquared(NPC_LOCATION);
|
||||
double dist = location.distance(NPC_LOCATION);
|
||||
if (dist > min || CitizensAPI.getNPCRegistry().getNPC(entity) != null || isInvisible(player))
|
||||
continue;
|
||||
min = dist;
|
||||
|
@ -3,27 +3,34 @@ package net.citizensnpcs.trait;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.scoreboard.Team;
|
||||
import org.bukkit.scoreboard.Team.Option;
|
||||
import org.bukkit.scoreboard.Team.OptionStatus;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
|
||||
import net.citizensnpcs.Settings.Setting;
|
||||
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.npc.ai.NPCHolder;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
import net.citizensnpcs.util.Util;
|
||||
|
||||
@TraitName("scoreboardtrait")
|
||||
public class ScoreboardTrait extends Trait {
|
||||
private boolean changed;
|
||||
@Persist
|
||||
private ChatColor color;
|
||||
private int justSpawned;
|
||||
private ChatColor previousGlowingColor;
|
||||
|
||||
@Persist
|
||||
private final Set<String> tags = new HashSet<String>();
|
||||
|
||||
@ -50,7 +57,7 @@ public class ScoreboardTrait extends Trait {
|
||||
if (SUPPORT_TAGS) {
|
||||
try {
|
||||
if (!npc.getEntity().getScoreboardTags().equals(tags)) {
|
||||
justSpawned = Setting.SCOREBOARD_SEND_TICKS.asInt();
|
||||
changed = true;
|
||||
for (Iterator<String> iterator = npc.getEntity().getScoreboardTags().iterator(); iterator
|
||||
.hasNext();) {
|
||||
String oldTag = iterator.next();
|
||||
@ -71,7 +78,7 @@ public class ScoreboardTrait extends Trait {
|
||||
try {
|
||||
OptionStatus visibility = nameVisibility ? OptionStatus.ALWAYS : OptionStatus.NEVER;
|
||||
if (visibility != team.getOption(Option.NAME_TAG_VISIBILITY)) {
|
||||
justSpawned = Setting.SCOREBOARD_SEND_TICKS.asInt();
|
||||
changed = true;
|
||||
}
|
||||
team.setOption(Option.NAME_TAG_VISIBILITY, visibility);
|
||||
} catch (NoSuchMethodError e) {
|
||||
@ -86,7 +93,7 @@ public class ScoreboardTrait extends Trait {
|
||||
OptionStatus collide = npc.data().<Boolean> get(NPC.COLLIDABLE_METADATA) ? OptionStatus.ALWAYS
|
||||
: OptionStatus.NEVER;
|
||||
if (collide != team.getOption(Option.COLLISION_RULE)) {
|
||||
justSpawned = Setting.SCOREBOARD_SEND_TICKS.asInt();
|
||||
changed = true;
|
||||
}
|
||||
team.setOption(Option.COLLISION_RULE, collide);
|
||||
} catch (NoSuchMethodError e) {
|
||||
@ -115,7 +122,7 @@ public class ScoreboardTrait extends Trait {
|
||||
|| (previousGlowingColor != null && color != previousGlowingColor)) {
|
||||
team.setColor(color);
|
||||
previousGlowingColor = color;
|
||||
justSpawned = Setting.SCOREBOARD_SEND_TICKS.asInt();
|
||||
changed = true;
|
||||
}
|
||||
} catch (NoSuchMethodError err) {
|
||||
SUPPORT_GLOWING_COLOR = false;
|
||||
@ -126,13 +133,22 @@ public class ScoreboardTrait extends Trait {
|
||||
&& !team.getPrefix().equals(previousGlowingColor.toString()))) {
|
||||
team.setPrefix(color.toString());
|
||||
previousGlowingColor = color;
|
||||
justSpawned = Setting.SCOREBOARD_SEND_TICKS.asInt();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (justSpawned > 0) {
|
||||
Util.sendTeamPacketToOnlinePlayers(team, 2);
|
||||
justSpawned--;
|
||||
|
||||
for (Player player : npc.getEntity().getWorld().getPlayers()) {
|
||||
if (player instanceof NPCHolder)
|
||||
continue;
|
||||
if (SENT_TEAMS.containsEntry(player.getUniqueId(), team.getName())) {
|
||||
if (changed) {
|
||||
NMS.sendTeamPacket(player, team, 2);
|
||||
}
|
||||
} else {
|
||||
NMS.sendTeamPacket(player, team, 0);
|
||||
SENT_TEAMS.put(player.getUniqueId(), team.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -159,11 +175,6 @@ public class ScoreboardTrait extends Trait {
|
||||
npc.getEntity() instanceof Player ? npc.getEntity().getName() : npc.getUniqueId().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSpawn() {
|
||||
justSpawned = Setting.SCOREBOARD_SEND_TICKS.asInt();
|
||||
}
|
||||
|
||||
public void removeTag(String tag) {
|
||||
tags.remove(tag);
|
||||
}
|
||||
@ -172,6 +183,11 @@ public class ScoreboardTrait extends Trait {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public static void onPlayerQuit(PlayerQuitEvent event) {
|
||||
SENT_TEAMS.removeAll(event.getPlayer().getUniqueId());
|
||||
}
|
||||
|
||||
private static SetMultimap<UUID, String> SENT_TEAMS = HashMultimap.create();
|
||||
private static boolean SUPPORT_COLLIDABLE_SETOPTION = true;
|
||||
private static boolean SUPPORT_GLOWING_COLOR = true;
|
||||
private static boolean SUPPORT_TAGS = true;
|
||||
|
@ -147,15 +147,7 @@ public class AllayController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -146,15 +146,7 @@ public class AxolotlController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -127,16 +127,7 @@ public class BatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -124,16 +124,7 @@ public class BeeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -119,15 +119,7 @@ public class BlazeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,15 +140,7 @@ public class CatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,17 +138,7 @@ public class CaveSpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault)) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,15 +148,7 @@ public class ChickenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -173,15 +173,7 @@ public class CodController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -145,15 +145,7 @@ public class CowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,15 +140,7 @@ public class CreeperController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,15 +138,7 @@ public class DolphinController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,15 +138,7 @@ public class DrownedController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,15 +136,7 @@ public class EnderDragonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -141,15 +141,7 @@ public class EndermanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,15 +138,7 @@ public class EndermiteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class EvokerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class FoxController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,15 +137,7 @@ public class FrogController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -119,15 +119,7 @@ public class GhastController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class GiantController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class GlowSquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class GoatController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,15 +138,7 @@ public class GuardianController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,15 +138,7 @@ public class GuardianElderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,15 +138,7 @@ public class HoglinController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -176,15 +176,7 @@ public class HorseController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -175,15 +175,7 @@ public class HorseDonkeyController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -175,15 +175,7 @@ public class HorseMuleController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -175,15 +175,7 @@ public class HorseSkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -175,15 +175,7 @@ public class HorseZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class IllusionerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class IronGolemController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -152,15 +152,7 @@ public class LlamaController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class MagmaCubeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,15 +137,7 @@ public class MushroomCowController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,15 +140,7 @@ public class OcelotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class PandaController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -123,16 +123,7 @@ public class ParrotController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -162,15 +162,7 @@ public class PhantomController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,15 +135,7 @@ public class PigController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -133,15 +133,7 @@ public class PigZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,15 +135,7 @@ public class PiglinBruteController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -135,15 +135,7 @@ public class PiglinController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class PillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,16 +116,7 @@ public class PolarBearController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -176,15 +176,7 @@ public class PufferFishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -144,15 +144,7 @@ public class RabbitController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class RavagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -165,15 +165,7 @@ public class SalmonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class SheepController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,15 +136,7 @@ public class ShulkerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -130,15 +130,7 @@ public class SilverfishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class SkeletonController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class SkeletonStrayController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class SkeletonWitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class SlimeController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -145,15 +145,7 @@ public class SnowmanController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class SpiderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class SquidController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class StriderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -165,15 +165,7 @@ public class TadpoleController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -153,15 +153,7 @@ public class TraderLlamaController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -167,15 +167,7 @@ public class TropicalFishController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -152,15 +152,7 @@ public class TurtleController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -117,16 +117,7 @@ public class VexController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null) {
|
||||
return super.isLeashed();
|
||||
}
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -146,15 +146,7 @@ public class VillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class VindicatorController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -147,15 +147,7 @@ public class WanderingTraderController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,15 +138,7 @@ public class WardenController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class WitchController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -123,15 +123,7 @@ public class WitherController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -136,15 +136,7 @@ public class WolfController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -134,15 +134,7 @@ public class ZoglinController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class ZombieController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class ZombieHuskController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,15 +132,7 @@ public class ZombieVillagerController extends MobEntityController {
|
||||
|
||||
@Override
|
||||
public boolean isLeashed() {
|
||||
if (npc == null)
|
||||
return super.isLeashed();
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return super.isLeashed();
|
||||
if (super.isLeashed()) {
|
||||
dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
return NMSImpl.isLeashed(this, super.isLeashed());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -165,8 +157,9 @@ public class ZombieVillagerController extends MobEntityController {
|
||||
// this method is called by both the entities involved - cancelling
|
||||
// it will not stop the NPC from moving.
|
||||
super.push(entity);
|
||||
if (npc != null)
|
||||
if (npc != null) {
|
||||
Util.callCollisionEvent(npc, entity.getBukkitEntity());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1937,6 +1937,19 @@ public class NMSImpl implements NMSBridge {
|
||||
network.address = socketAddress;
|
||||
}
|
||||
|
||||
public static boolean isLeashed(Mob entity, boolean superLeashed) {
|
||||
NPC npc = ((NPCHolder) entity).getNPC();
|
||||
if (npc == null)
|
||||
return superLeashed;
|
||||
boolean protectedDefault = npc.data().get(NPC.DEFAULT_PROTECTED_METADATA, true);
|
||||
if (!protectedDefault || !npc.data().get(NPC.LEASH_PROTECTED_METADATA, protectedDefault))
|
||||
return superLeashed;
|
||||
if (superLeashed) {
|
||||
entity.dropLeash(true, false); // clearLeash with client update
|
||||
}
|
||||
return false; // shouldLeash
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static void minecartItemLogic(AbstractMinecart minecart) {
|
||||
NPC npc = ((NPCHolder) minecart).getNPC();
|
||||
|
Loading…
Reference in New Issue
Block a user