Skip to content

Commit 776f15a

Browse files
authored
Merge pull request #84 from TheNextLvl-net/delombok
Removed `@RequiredArgsConstructor` and adjusted constructor usage
2 parents f6220fd + f251969 commit 776f15a

103 files changed

Lines changed: 1103 additions & 884 deletions

File tree

Some content is hidden

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

build.gradle.kts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ repositories {
2929
}
3030

3131
dependencies {
32-
compileOnly("org.projectlombok:lombok:1.18.36")
3332
compileOnly("net.thenextlvl.services:service-io:2.2.0")
3433
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
3534

@@ -39,8 +38,6 @@ dependencies {
3938
implementation("net.thenextlvl.core:nbt:2.3.1")
4039
implementation("net.thenextlvl.core:paper:2.0.4")
4140
implementation("org.bstats:bstats-bukkit:3.1.0")
42-
43-
annotationProcessor("org.projectlombok:lombok:1.18.36")
4441
}
4542

4643
tasks.shadowJar {

src/main/java/net/thenextlvl/tweaks/TweaksPlugin.java

Lines changed: 160 additions & 124 deletions
Large diffs are not rendered by default.

src/main/java/net/thenextlvl/tweaks/command/environment/WorldCommand.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
import io.papermc.paper.command.brigadier.CommandSourceStack;
77
import io.papermc.paper.command.brigadier.Commands;
88
import io.papermc.paper.command.brigadier.argument.ArgumentTypes;
9-
import lombok.RequiredArgsConstructor;
109
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
1110
import net.thenextlvl.tweaks.TweaksPlugin;
1211
import net.thenextlvl.tweaks.command.suggestion.WorldSuggestionProvider;
1312
import org.bukkit.World;
1413
import org.bukkit.command.CommandSender;
1514

16-
@RequiredArgsConstructor
1715
public abstract class WorldCommand {
1816
protected final TweaksPlugin plugin;
1917

18+
protected WorldCommand(TweaksPlugin plugin) {
19+
this.plugin = plugin;
20+
}
21+
2022
public LiteralCommandNode<CommandSourceStack> create(String command, String permission) {
2123
return Commands.literal(command)
2224
.requires(stack -> stack.getSender().hasPermission(permission))

src/main/java/net/thenextlvl/tweaks/command/environment/time/DayCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public DayCommand(TweaksPlugin plugin) {
1515
}
1616

1717
public void register(Commands registrar) {
18-
var command = create(plugin.commands().day().command(), "tweaks.command.time.day");
19-
registrar.register(command, "Set the time to day", plugin.commands().day().aliases());
18+
var command = create(plugin.commands().day.command, "tweaks.command.time.day");
19+
registrar.register(command, "Set the time to day", plugin.commands().day.aliases);
2020
}
2121

2222
@Override

src/main/java/net/thenextlvl/tweaks/command/environment/time/MidnightCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public MidnightCommand(TweaksPlugin plugin) {
1515
}
1616

1717
public void register(Commands registrar) {
18-
var command = create(plugin.commands().midnight().command(), "tweaks.command.time.midnight");
19-
registrar.register(command, "Set the time to midnight", plugin.commands().midnight().aliases());
18+
var command = create(plugin.commands().midnight.command, "tweaks.command.time.midnight");
19+
registrar.register(command, "Set the time to midnight", plugin.commands().midnight.aliases);
2020
}
2121

2222
@Override

src/main/java/net/thenextlvl/tweaks/command/environment/time/NightCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public NightCommand(TweaksPlugin plugin) {
1515
}
1616

1717
public void register(Commands registrar) {
18-
var command = create(plugin.commands().night().command(), "tweaks.command.time.night");
19-
registrar.register(command, "Set the time to night", plugin.commands().night().aliases());
18+
var command = create(plugin.commands().night.command, "tweaks.command.time.night");
19+
registrar.register(command, "Set the time to night", plugin.commands().night.aliases);
2020
}
2121

2222
@Override

src/main/java/net/thenextlvl/tweaks/command/environment/time/NoonCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public NoonCommand(TweaksPlugin plugin) {
1515
}
1616

1717
public void register(Commands registrar) {
18-
var command = create(plugin.commands().noon().command(), "tweaks.command.time.noon");
19-
registrar.register(command, "Set the time to noon", plugin.commands().noon().aliases());
18+
var command = create(plugin.commands().noon.command, "tweaks.command.time.noon");
19+
registrar.register(command, "Set the time to noon", plugin.commands().noon.aliases);
2020
}
2121

2222
@Override

src/main/java/net/thenextlvl/tweaks/command/environment/time/TimeCommand.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import io.papermc.paper.command.brigadier.CommandSourceStack;
88
import io.papermc.paper.command.brigadier.Commands;
99
import io.papermc.paper.command.brigadier.argument.ArgumentTypes;
10-
import lombok.RequiredArgsConstructor;
1110
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
1211
import net.thenextlvl.tweaks.TweaksPlugin;
1312
import org.bukkit.World;
@@ -16,12 +15,15 @@
1615
import java.util.function.Function;
1716

1817
@NullMarked
19-
@RequiredArgsConstructor
2018
public class TimeCommand {
2119
private final TweaksPlugin plugin;
2220

21+
public TimeCommand(TweaksPlugin plugin) {
22+
this.plugin = plugin;
23+
}
24+
2325
public void register(Commands registrar) {
24-
var command = Commands.literal(plugin.commands().time().command())
26+
var command = Commands.literal(plugin.commands().time.command)
2527
.requires(stack -> stack.getSender().hasPermission("tweaks.command.time"))
2628
.then(Commands.literal("set")
2729
.then(setTime("afternoon", "tweaks.command.time.afternoon", 9000))
@@ -45,7 +47,7 @@ public void register(Commands registrar) {
4547
.then(query("daytime", world -> world.getFullTime() % 24000L))
4648
.then(query("gametime", world -> world.getGameTime() % 2147483647L)))
4749
.build();
48-
registrar.register(command, "Manage the time on your server", plugin.commands().time().aliases());
50+
registrar.register(command, "Manage the time on your server", plugin.commands().time.aliases);
4951
}
5052

5153
private LiteralArgumentBuilder<CommandSourceStack> query(String literal, Function<World, Long> function) {

src/main/java/net/thenextlvl/tweaks/command/environment/weather/RainCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public RainCommand(TweaksPlugin plugin) {
1313
}
1414

1515
public void register(Commands registrar) {
16-
var command = create(plugin.commands().rain().command(), "tweaks.command.weather.rain");
17-
registrar.register(command, "Let it rain", plugin.commands().rain().aliases());
16+
var command = create(plugin.commands().rain.command, "tweaks.command.weather.rain");
17+
registrar.register(command, "Let it rain", plugin.commands().rain.aliases);
1818
}
1919

2020
@Override

src/main/java/net/thenextlvl/tweaks/command/environment/weather/SunCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public SunCommand(TweaksPlugin plugin) {
1313
}
1414

1515
public void register(Commands registrar) {
16-
var command = create(plugin.commands().sun().command(), "tweaks.command.weather.sun");
17-
registrar.register(command, "Let the sun shine", plugin.commands().sun().aliases());
16+
var command = create(plugin.commands().sun.command, "tweaks.command.weather.sun");
17+
registrar.register(command, "Let the sun shine", plugin.commands().sun.aliases);
1818
}
1919

2020
@Override

0 commit comments

Comments
 (0)