use of io.icker.factions.util.Message in project factions by ickerio.
the class ModifyCommand method color.
public static int color(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
Formatting color = ColorArgumentType.getColor(context, "color");
ServerCommandSource source = context.getSource();
ServerPlayerEntity player = source.getPlayer();
Member.get(player.getUuid()).getFaction().setColor(color);
new Message("Successfully updated faction color").send(player, false);
return 1;
}
use of io.icker.factions.util.Message in project factions by ickerio.
the class AllyCommand method list.
public static int list(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
ServerCommandSource source = context.getSource();
ServerPlayerEntity player = source.getPlayer();
Faction faction = Member.get(player.getUuid()).getFaction();
ArrayList<Ally> invites = Ally.getAllyInvites(faction.name);
for (Ally ally : invites) {
new Message(ally.source + " has invited you").format(Formatting.YELLOW).hover("Click to accept them as an ally").click("/factions ally accept " + ally.source).send(player, false);
}
return 1;
}
use of io.icker.factions.util.Message in project factions by ickerio.
the class AllyCommand method remove.
public static int remove(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
ServerPlayerEntity target = EntityArgumentType.getPlayer(context, "player");
ServerCommandSource source = context.getSource();
ServerPlayerEntity player = source.getPlayer();
Faction sourceFaction = Member.get(player.getUuid()).getFaction();
Faction targetFaction = Member.get(target.getUuid()).getFaction();
if (!Ally.checkIfAlly(sourceFaction.name, targetFaction.name)) {
new Message(targetFaction.name + " is not allied").format(Formatting.RED).send(player, false);
} else {
Ally.remove(sourceFaction.name, targetFaction.name);
new Message(target.getName().getString() + " is no longer allied").send(sourceFaction);
new Message("You are no longer allies with " + sourceFaction.name).format(Formatting.YELLOW).send(target, false);
}
return 1;
}
use of io.icker.factions.util.Message in project factions by ickerio.
the class BypassCommand method run.
@Override
public int run(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
ServerCommandSource source = context.getSource();
ServerPlayerEntity player = source.getPlayer();
PlayerConfig config = PlayerConfig.get(player.getUuid());
boolean bypass = !config.bypass;
config.setBypass(bypass);
new Message("Successfully toggled claim bypass").filler("ยท").add(new Message(bypass ? "ON" : "OFF").format(bypass ? Formatting.GREEN : Formatting.RED)).send(player, false);
return 1;
}
use of io.icker.factions.util.Message in project factions by ickerio.
the class CreateCommand method run.
@Override
public int run(CommandContext<ServerCommandSource> context) throws CommandSyntaxException {
String name = StringArgumentType.getString(context, "name");
ServerCommandSource source = context.getSource();
ServerPlayerEntity player = source.getPlayer();
if (Faction.get(name) != null) {
new Message("Cannot create a faction as a one with that name already exists").fail().send(player, false);
return 0;
}
Faction.add(name, "No description set", Formatting.WHITE.getName(), false, Config.BASE_POWER + Config.MEMBER_POWER).addMember(player.getUuid(), Member.Rank.OWNER);
source.getServer().getPlayerManager().sendCommandTree(player);
new Message("Successfully created faction").send(player, false);
return 1;
}
Aggregations