Showing Dropping Anvil Something (Ignore)

This commit is contained in:
Driftay
2019-09-15 05:08:00 -04:00
parent 978bcbbb3b
commit e07dc303ef
285 changed files with 28181 additions and 28161 deletions

View File

@@ -8,47 +8,47 @@ import com.massivecraft.factions.zcore.util.TL;
public class CmdShowClaims extends FCommand {
public CmdShowClaims() {
this.aliases.add("showclaims");
this.aliases.add("showclaim");
public CmdShowClaims() {
this.aliases.add("showclaims");
this.aliases.add("showclaim");
this.requirements = new CommandRequirements.Builder(Permission.SHOWCLAIMS)
.playerOnly()
.memberOnly()
.build();
}
this.requirements = new CommandRequirements.Builder(Permission.SHOWCLAIMS)
.playerOnly()
.memberOnly()
.build();
}
@Override
public void perform(CommandContext context) {
context.sendMessage(TL.COMMAND_SHOWCLAIMS_HEADER.toString().replace("{faction}", context.faction.describeTo(context.fPlayer)));
ListMultimap<String, String> chunkMap = ArrayListMultimap.create();
String format = TL.COMMAND_SHOWCLAIMS_CHUNKSFORMAT.toString();
for (FLocation fLocation : context.faction.getAllClaims()) {
chunkMap.put(fLocation.getWorldName(), format.replace("{x}", fLocation.getX() + "").replace("{z}", fLocation.getZ() + ""));
}
for (String world : chunkMap.keySet()) {
String message = TL.COMMAND_SHOWCLAIMS_FORMAT.toString().replace("{world}", world);
// made {chunks} blank as I removed the placeholder and people wont update their config :shrug:
context.sendMessage(message.replace("{chunks}", ""));
StringBuilder chunks = new StringBuilder();
for (String chunkString : chunkMap.get(world)) {
chunks.append(chunkString).append(", ");
if (chunks.toString().length() >= 2000) {
context.sendMessage(chunks.toString());
chunks.setLength(0);
}
}
if (chunks.length() != 0) context.sendMessage(chunks.toString());
context.sendMessage("");
}
@Override
public void perform(CommandContext context) {
context.sendMessage(TL.COMMAND_SHOWCLAIMS_HEADER.toString().replace("{faction}", context.faction.describeTo(context.fPlayer)));
ListMultimap<String, String> chunkMap = ArrayListMultimap.create();
String format = TL.COMMAND_SHOWCLAIMS_CHUNKSFORMAT.toString();
for (FLocation fLocation : context.faction.getAllClaims()) {
chunkMap.put(fLocation.getWorldName(), format.replace("{x}", fLocation.getX() + "").replace("{z}", fLocation.getZ() + ""));
}
for (String world : chunkMap.keySet()) {
String message = TL.COMMAND_SHOWCLAIMS_FORMAT.toString().replace("{world}", world);
// made {chunks} blank as I removed the placeholder and people wont update their config :shrug:
context.sendMessage(message.replace("{chunks}", ""));
StringBuilder chunks = new StringBuilder();
for (String chunkString : chunkMap.get(world)) {
chunks.append(chunkString).append(", ");
if (chunks.toString().length() >= 2000) {
context.sendMessage(chunks.toString());
chunks.setLength(0);
}
}
if (chunks.length() != 0) context.sendMessage(chunks.toString());
context.sendMessage("");
}
}
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_SHOWCLAIMS_DESCRIPTION;
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_SHOWCLAIMS_DESCRIPTION;
}
}