Fixes a bunch of grammatical errors, and some warnings

This commit is contained in:
2023-06-23 21:35:02 +02:00
parent fd8cce63ee
commit 645d59d06e
41 changed files with 135 additions and 174 deletions

View File

@@ -58,7 +58,7 @@ public class CmdFactionsCreate extends FactionsCommand {
EventFactionsMembershipChange joinEvent = new EventFactionsMembershipChange(sender, msender, faction, MembershipChangeReason.CREATE);
joinEvent.run();
// NOTE: join event cannot be cancelled or you'll have an empty faction
// NOTE: join event cannot be cancelled, or you'll have an empty faction
// Inform
msg("<i>You created the faction %s", faction.getName(msender));

View File

@@ -32,7 +32,7 @@ public class CmdFactionsFlagSet extends FactionsCommand {
boolean value = this.readArg();
Faction faction = this.readArg(msenderFaction);
// Do the sender have the right to change flags for this faction?
// Does the sender have the right to change flags for this faction?
if (!MPerm.getPermFlags().has(msender, faction, true)) {
return;
}

View File

@@ -37,7 +37,7 @@ public class CmdFactionsPermSet extends FactionsCommand {
MPerm.MPermable permable = TypeMPermable.get(faction).read(this.argAt(1), sender);
// Do the sender have the right to change perms for this faction?
// Does the sender have the right to change perms for this faction?
if (!MPerm.getPermPerms().has(msender, faction, true)) {
return;
}

View File

@@ -60,8 +60,7 @@ public class CmdFactionsPermView extends FactionsCommand {
String permissionSingularPlural = permNames.size() == 1 ? "permission" : "permissions";
msg("<i>In <reset>%s <reset>%s <i>specifically has the %s: <reset>%s<i>.", faction.describeTo(msender), permable.getDisplayName(sender), permissionSingularPlural, names);
}
if (permable instanceof MPlayer) {
MPlayer mplayer = (MPlayer) permable;
if (permable instanceof MPlayer mplayer) {
msg("<i>They may have other permissions through their faction membership, rank or relation to <reset>%s<i>.", faction.describeTo(msender));
List<Mson> msons = new MassiveList<>();
@@ -76,15 +75,13 @@ public class CmdFactionsPermView extends FactionsCommand {
Mson msons2 = Mson.implode(msons, Mson.SPACE);
message(mson(mson("Commands: ").color(ChatColor.YELLOW), msons2));
}
if (permable instanceof Faction) {
Faction faction1 = (Faction) permable;
if (permable instanceof Faction faction1) {
msg("<i>They may have other permissions through their relation to <reset>%s<i>.", faction.describeTo(msender));
Mson msonRelation = Mson.parse("<command>[relation]").command(this, faction.getRelationTo(faction1).toString(), faction.getName());
Mson msons = Mson.implode(MUtil.list(msonRelation), Mson.SPACE);
message(mson(mson("Commands: ").color(ChatColor.YELLOW), msons));
}
if (permable instanceof Rank && !faction.hasRank((Rank) permable)) {
Rank rank = (Rank) permable;
if (permable instanceof Rank rank && !faction.hasRank((Rank) permable)) {
msg("<i>They may have other permissions thorugh their faction membership or relation to <reset>%s<i>.", faction.describeTo(msender));
Mson msonFaction = Mson.parse("<command>[faction]").command(this, rank.getFaction().getName(), faction.getName());
Mson msonRelation = Mson.parse("<command>[relation]").command(this, faction.getRelationTo(rank.getFaction()).toString(), faction.getName());

View File

@@ -45,18 +45,15 @@ public class CmdFactionsPermViewall extends FactionsCommand {
List<MPermable> permables = new MassiveList<>();
permables.add(permable);
if (permable instanceof MPlayer) {
MPlayer mplayer = (MPlayer) permable;
if (permable instanceof MPlayer mplayer) {
permables.add(mplayer.getFaction());
permables.add(mplayer.getRank());
permables.add(faction.getRelationTo(mplayer));
}
if (permable instanceof Faction) {
Faction faction1 = (Faction) permable;
if (permable instanceof Faction faction1) {
permables.add(faction.getRelationTo(faction1));
}
if (permable instanceof Rank && !faction.hasRank((Rank) permable)) {
Rank rank = (Rank) permable;
if (permable instanceof Rank rank && !faction.hasRank((Rank) permable)) {
Faction faction1 = rank.getFaction();
permables.add(faction1);
permables.add(faction.getRelationTo(faction1));

View File

@@ -59,7 +59,7 @@ public class CmdFactionsPlayer extends FactionsCommand {
}
// INFO: Power per Hour
// If the player is not at maximum we wan't to display how much time left.
// If the player is not at maximum we want to display how much time left.
String stringTillMax = "";
double powerTillMax = mplayer.getPowerMax() - mplayer.getPower();

View File

@@ -163,12 +163,12 @@ public class CmdFactionsRankSet extends FactionsCommand {
// The following two if statements could be merged.
// But isn't for the sake of nicer error messages.
if (senderRank == targetRank) {
// You can't change someones rank if it is equal to yours.
// You can't change someone's rank if it is equal to yours.
throw new MassiveException().addMsg("<h>%s <b>can't manage eachother.", senderRank.getName() + "s");
}
if (senderRank.isLessThan(targetRank)) {
// You can't change someones rank if it is higher than yours.
// You can't change someone's rank if it is higher than yours.
throw new MassiveException().addMsg("<b>You can't manage people of higher rank.");
}
@@ -259,7 +259,7 @@ public class CmdFactionsRankSet extends FactionsCommand {
// Inform & demote the old leader.
targetFactionCurrentLeader.setRank(rank.getRankBelow());
if (targetFactionCurrentLeader != msender) {
// They kinda know if they fired the command themself.
// They kinda know if they fired the command themselves.
targetFactionCurrentLeader.msg("<i>You have been demoted from the position of faction leader by %s<i>.", msender.describeTo(targetFactionCurrentLeader, true));
}
}

View File

@@ -41,7 +41,7 @@ public class CmdFactionsTitle extends FactionsCommand {
return;
}
// Rank Check
// Check Rank
if (!msender.isOverriding() && you.getRank().isMoreThan(msender.getRank())) {
throw new MassiveException().addMsg("<b>You can not edit titles for higher ranks.");
}

View File

@@ -80,20 +80,14 @@ public class CmdFactionsTop extends FactionsCommand {
private static String getValue(TopCategory category, Faction faction, MPlayer mplayer) {
String ret = Txt.parse("%s<i>: ", faction.getName(mplayer));
switch (category) {
case MONEY:
ret += Money.format(Econ.getMoney(faction), true);
break;
case MEMBERS:
ret += faction.getMPlayers().size() + " members";
break;
case TERRITORY:
ret += faction.getLandCount() + " chunks";
break;
case AGE:
case MONEY -> ret += Money.format(Econ.getMoney(faction), true);
case MEMBERS -> ret += faction.getMPlayers().size() + " members";
case TERRITORY -> ret += faction.getLandCount() + " chunks";
case AGE -> {
long ageMillis = faction.getAge();
LinkedHashMap<TimeUnit, Long> ageUnitcounts = TimeDiffUtil.limit(TimeDiffUtil.unitcounts(ageMillis, TimeUnit.getAllButMillis()), 3);
ret += TimeDiffUtil.formatedVerboose(ageUnitcounts);
break;
}
}
return ret;
}

View File

@@ -54,7 +54,7 @@ public class TypeFaction extends TypeAbstract<Faction> {
return FactionColl.get().getNone();
}
// Faction Id Exact
// Faction id Exact
if (FactionColl.get().containsId(str)) {
ret = FactionColl.get().get(str);
if (ret != null) {