Skip to content

Commit 6e7559b

Browse files
committed
Change mixin names and reformat
1 parent f5a74c1 commit 6e7559b

58 files changed

Lines changed: 347 additions & 246 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/io/icker/factions/FactionsMod.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import net.minecraft.commands.CommandBuildContext;
4343
import net.minecraft.commands.CommandSourceStack;
4444
import net.minecraft.commands.Commands;
45+
4546
import org.slf4j.Logger;
4647
import org.slf4j.LoggerFactory;
4748

@@ -81,8 +82,7 @@ private static void registerCommands(
8182
CommandDispatcher<CommandSourceStack> dispatcher,
8283
CommandBuildContext registryAccess,
8384
Commands.CommandSelection environment) {
84-
LiteralCommandNode<CommandSourceStack> factions =
85-
Commands.literal("factions").build();
85+
LiteralCommandNode<CommandSourceStack> factions = Commands.literal("factions").build();
8686

8787
LiteralCommandNode<CommandSourceStack> alias = Commands.literal("f").build();
8888

src/main/java/io/icker/factions/api/events/PlayerEvents.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ public class PlayerEvents {
103103
callbacks ->
104104
(source, target) -> {
105105
for (IsInvulnerable callback : callbacks) {
106-
InteractionResult result = callback.isInvulnerable(source, target);
106+
InteractionResult result =
107+
callback.isInvulnerable(source, target);
107108
if (result != InteractionResult.PASS) {
108109
return result;
109110
}

src/main/java/io/icker/factions/api/persistents/Faction.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
import io.icker.factions.database.Field;
77
import io.icker.factions.database.Name;
88
import io.icker.factions.util.WorldUtils;
9+
10+
import net.minecraft.ChatFormatting;
11+
import net.minecraft.core.NonNullList;
12+
import net.minecraft.world.SimpleContainer;
13+
import net.minecraft.world.item.ItemStack;
14+
915
import org.jetbrains.annotations.Nullable;
1016

1117
import java.util.ArrayList;
@@ -14,10 +20,6 @@
1420
import java.util.List;
1521
import java.util.UUID;
1622
import java.util.stream.Stream;
17-
import net.minecraft.ChatFormatting;
18-
import net.minecraft.core.NonNullList;
19-
import net.minecraft.world.SimpleContainer;
20-
import net.minecraft.world.item.ItemStack;
2123

2224
@Name("Faction")
2325
public class Faction {

src/main/java/io/icker/factions/api/persistents/Relationship.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.icker.factions.api.persistents;
22

3-
import io.icker.factions.FactionsMod;
43
import io.icker.factions.database.Field;
54

65
import java.util.ArrayList;

src/main/java/io/icker/factions/api/persistents/User.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
import io.icker.factions.database.Field;
66
import io.icker.factions.database.Name;
77
import io.icker.factions.util.WorldUtils;
8+
9+
import net.minecraft.server.level.ServerPlayer;
10+
811
import org.jetbrains.annotations.NotNull;
912
import org.jetbrains.annotations.Nullable;
1013

1114
import java.util.Collection;
1215
import java.util.HashMap;
1316
import java.util.List;
1417
import java.util.UUID;
15-
import net.minecraft.server.level.ServerPlayer;
1618

1719
@Name("User")
1820
public class User {

src/main/java/io/icker/factions/command/AdminCommand.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
import io.icker.factions.ui.AdminGui;
1515
import io.icker.factions.util.Command;
1616
import io.icker.factions.util.Message;
17-
import java.util.Optional;
18-
import java.util.UUID;
17+
1918
import net.minecraft.ChatFormatting;
2019
import net.minecraft.commands.CommandSourceStack;
2120
import net.minecraft.commands.Commands;
2221
import net.minecraft.network.chat.Component;
2322
import net.minecraft.server.level.ServerPlayer;
2423

24+
import java.util.Optional;
25+
import java.util.UUID;
26+
2527
public class AdminCommand implements Command {
2628
private int gui(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
2729
ServerPlayer player = context.getSource().getPlayerOrException();
@@ -84,7 +86,9 @@ private int power(CommandContext<CommandSourceStack> context) throws CommandSynt
8486
player.getName().getString(),
8587
power))
8688
.send(target);
87-
new Message(Component.translatable("factions.gui.power.success.removed.admin", power))
89+
new Message(
90+
Component.translatable(
91+
"factions.gui.power.success.removed.admin", power))
8892
.send(player, false);
8993
}
9094
} else {
@@ -190,8 +194,7 @@ public LiteralCommandNode<CommandSourceStack> getNode() {
190194
"factions.admin.power",
191195
FactionsMod.CONFIG.REQUIRED_BYPASS_LEVEL))
192196
.then(
193-
Commands.argument(
194-
"power", IntegerArgumentType.integer())
197+
Commands.argument("power", IntegerArgumentType.integer())
195198
.then(
196199
Commands.argument(
197200
"faction",
@@ -206,8 +209,7 @@ public LiteralCommandNode<CommandSourceStack> getNode() {
206209
"factions.admin.spoof",
207210
FactionsMod.CONFIG.REQUIRED_BYPASS_LEVEL))
208211
.then(
209-
Commands.argument(
210-
"player", StringArgumentType.string())
212+
Commands.argument("player", StringArgumentType.string())
211213
.suggests(Suggests.allPlayers())
212214
.executes(this::spoof))
213215
.executes(this::clearSpoof))

src/main/java/io/icker/factions/command/ClaimCommand.java

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
import io.icker.factions.api.persistents.User;
1212
import io.icker.factions.util.Command;
1313
import io.icker.factions.util.Message;
14-
import java.util.ArrayList;
15-
import java.util.HashMap;
16-
import java.util.List;
17-
import java.util.stream.Collectors;
14+
1815
import net.minecraft.ChatFormatting;
1916
import net.minecraft.commands.CommandSourceStack;
2017
import net.minecraft.commands.Commands;
@@ -23,6 +20,11 @@
2320
import net.minecraft.server.level.ServerPlayer;
2421
import net.minecraft.world.level.ChunkPos;
2522

23+
import java.util.ArrayList;
24+
import java.util.HashMap;
25+
import java.util.List;
26+
import java.util.stream.Collectors;
27+
2628
public class ClaimCommand implements Command {
2729
private int list(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
2830
CommandSourceStack source = context.getSource();
@@ -34,7 +36,8 @@ private int list(CommandContext<CommandSourceStack> context) throws CommandSynta
3436
new Message(
3537
Component.translatable(
3638
"factions.command.claim.list",
37-
Component.literal(String.valueOf(count)).withStyle(ChatFormatting.YELLOW)))
39+
Component.literal(String.valueOf(count))
40+
.withStyle(ChatFormatting.YELLOW)))
3841
.send(source.getPlayerOrException(), false);
3942

4043
if (count == 0) return 1;
@@ -168,7 +171,9 @@ private int addSize(CommandContext<CommandSourceStack> context) throws CommandSy
168171
+ faction.getAdminPower();
169172

170173
if (maxPower < requiredPower) {
171-
new Message(Component.translatable("factions.command.claim.add.fail.lacks_power.multiple"))
174+
new Message(
175+
Component.translatable(
176+
"factions.command.claim.add.fail.lacks_power.multiple"))
172177
.fail()
173178
.send(player, false);
174179
return 0;
@@ -282,7 +287,9 @@ private int auto(CommandContext<CommandSourceStack> context) throws CommandSynta
282287
new Message(Component.translatable("factions.command.claim.auto.toggled"))
283288
.filler("·")
284289
.add(
285-
new Message(Component.translatable("options." + (user.autoclaim ? "on" : "off")))
290+
new Message(
291+
Component.translatable(
292+
"options." + (user.autoclaim ? "on" : "off")))
286293
.format(user.autoclaim ? ChatFormatting.GREEN : ChatFormatting.RED))
287294
.send(player, false);
288295

@@ -303,7 +310,9 @@ private int setAccessLevel(CommandContext<CommandSourceStack> context, boolean i
303310
Claim claim = Claim.get(chunkPos.x, chunkPos.z, dimension);
304311

305312
if (claim == null) {
306-
new Message(Component.translatable("factions.command.claim.set_access_level.fail.unclaimed"))
313+
new Message(
314+
Component.translatable(
315+
"factions.command.claim.set_access_level.fail.unclaimed"))
307316
.fail()
308317
.send(player, false);
309318
return 0;
@@ -394,8 +403,7 @@ public LiteralCommandNode<CommandSourceStack> getNode() {
394403
Commands.literal("add")
395404
.requires(Requires.hasPerms("factions.claim.add", 0))
396405
.then(
397-
Commands.argument(
398-
"size", IntegerArgumentType.integer(1, 7))
406+
Commands.argument("size", IntegerArgumentType.integer(1, 7))
399407
.requires(
400408
Requires.hasPerms(
401409
"factions.claim.add.size", 0))
@@ -428,8 +436,7 @@ public LiteralCommandNode<CommandSourceStack> getNode() {
428436
Requires.hasPerms("factions.claim.remove", 0)
429437
.and(Requires.isLeader()))
430438
.then(
431-
Commands.argument(
432-
"size", IntegerArgumentType.integer(1, 7))
439+
Commands.argument("size", IntegerArgumentType.integer(1, 7))
433440
.requires(
434441
Requires.hasPerms(
435442
"factions.claim.remove.size", 0))

src/main/java/io/icker/factions/command/CreateCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@
1010
import io.icker.factions.api.persistents.User;
1111
import io.icker.factions.util.Command;
1212
import io.icker.factions.util.Message;
13-
import xyz.nucleoid.server.translations.api.Localization;
1413

15-
import java.util.Locale;
1614
import net.minecraft.ChatFormatting;
1715
import net.minecraft.commands.CommandSourceStack;
1816
import net.minecraft.commands.Commands;
1917
import net.minecraft.network.chat.Component;
2018
import net.minecraft.server.level.ServerPlayer;
2119

20+
import xyz.nucleoid.server.translations.api.Localization;
21+
22+
import java.util.Locale;
23+
2224
public class CreateCommand implements Command {
2325
private int run(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
2426
String name = StringArgumentType.getString(context, "name");

src/main/java/io/icker/factions/command/DeclareCommand.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
import io.icker.factions.api.persistents.Relationship;
1111
import io.icker.factions.util.Command;
1212
import io.icker.factions.util.Message;
13-
import java.util.Locale;
13+
1414
import net.minecraft.ChatFormatting;
1515
import net.minecraft.commands.CommandSourceStack;
1616
import net.minecraft.commands.Commands;
1717
import net.minecraft.network.chat.Component;
1818
import net.minecraft.network.chat.MutableComponent;
1919
import net.minecraft.server.level.ServerPlayer;
2020

21+
import java.util.Locale;
22+
2123
public class DeclareCommand implements Command {
2224
private int ally(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
2325
return updateRelationship(context, Relationship.Status.ALLY);
@@ -81,7 +83,8 @@ private int updateRelationship(
8183
? Component.translatable("factions.command.declare.success.status.ally")
8284
.withStyle(ChatFormatting.GREEN)
8385
: rel.status == Relationship.Status.ENEMY
84-
? Component.translatable("factions.command.declare.success.status.enemy")
86+
? Component.translatable(
87+
"factions.command.declare.success.status.enemy")
8588
.withStyle(ChatFormatting.RED)
8689
: Component.translatable(
8790
"factions.command.declare.success.status.neutral");

src/main/java/io/icker/factions/command/DisbandCommand.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import io.icker.factions.api.persistents.User;
99
import io.icker.factions.util.Command;
1010
import io.icker.factions.util.Message;
11+
1112
import net.minecraft.ChatFormatting;
1213
import net.minecraft.commands.CommandSourceStack;
1314
import net.minecraft.commands.Commands;
@@ -71,9 +72,7 @@ public LiteralCommandNode<CommandSourceStack> getNode() {
7172
Requires.multiple(
7273
Requires.isOwner(), Requires.hasPerms("factions.disband", 0)))
7374
.executes(context -> this.run(context, false))
74-
.then(
75-
Commands.literal("confirm")
76-
.executes(context -> this.run(context, true)))
75+
.then(Commands.literal("confirm").executes(context -> this.run(context, true)))
7776
.build();
7877
}
7978
}

0 commit comments

Comments
 (0)