Showing Dropping Anvil Something (Ignore)

This commit is contained in:
Driftay
2019-09-15 05:19:06 -04:00
parent 2feaed0aad
commit 7f988031ca
285 changed files with 28757 additions and 28757 deletions

View File

@@ -9,42 +9,42 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
public class CmdNear extends FCommand {
public CmdNear() {
super();
this.aliases.add("near");
this.aliases.add("nearby");
public CmdNear() {
super();
this.aliases.add("near");
this.aliases.add("nearby");
this.requirements = new CommandRequirements.Builder(Permission.NEAR)
.playerOnly()
.memberOnly()
.build();
}
this.requirements = new CommandRequirements.Builder(Permission.NEAR)
.playerOnly()
.memberOnly()
.build();
}
@Override
public void perform(CommandContext context) {
if (!FactionsPlugin.getInstance().getConfig().getBoolean("fnear.Enabled")) {
context.msg(TL.COMMAND_NEAR_DISABLED_MSG);
return;
}
@Override
public void perform(CommandContext context) {
if (!FactionsPlugin.getInstance().getConfig().getBoolean("fnear.Enabled")) {
context.msg(TL.COMMAND_NEAR_DISABLED_MSG);
return;
}
double range = FactionsPlugin.getInstance().getConfig().getInt("fnear.Radius");
String format = TL.COMMAND_NEAR_FORMAT.toString();
context.msg(TL.COMMAND_NEAR_USE_MSG);
for (Entity e : context.player.getNearbyEntities(range, 255, range)) {
if (e instanceof Player) {
Player player = (((Player) e).getPlayer());
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
if (context.faction == fplayer.getFaction()) {
double distance = context.player.getLocation().distance(player.getLocation());
context.sendMessage(format.replace("{playername}", player.getDisplayName()).replace("{distance}", (int) distance + ""));
}
}
double range = FactionsPlugin.getInstance().getConfig().getInt("fnear.Radius");
String format = TL.COMMAND_NEAR_FORMAT.toString();
context.msg(TL.COMMAND_NEAR_USE_MSG);
for (Entity e : context.player.getNearbyEntities(range, 255, range)) {
if (e instanceof Player) {
Player player = (((Player) e).getPlayer());
FPlayer fplayer = FPlayers.getInstance().getByPlayer(player);
if (context.faction == fplayer.getFaction()) {
double distance = context.player.getLocation().distance(player.getLocation());
context.sendMessage(format.replace("{playername}", player.getDisplayName()).replace("{distance}", (int) distance + ""));
}
}
}
}
}
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_NEAR_DESCRIPTION;
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_NEAR_DESCRIPTION;
}
}