Skip to content

Commit a9b6b4d

Browse files
committed
[ci skip] Update 5.0.9-SNAPSHOT
1 parent ae0f3bb commit a9b6b4d

File tree

18 files changed

+62
-824
lines changed

18 files changed

+62
-824
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
- name: Set up JDK 17
1212
uses: actions/setup-java@v3
1313
with:
14-
java-version: 19
15-
distribution: temurin
14+
java-version: '17'
15+
distribution: 'temurin'
1616
cache: maven
1717
- name: Build with Maven
1818
run: mvn -B package --file pom.xml
1919
- name: Release RandomSpawnPlus5
2020
uses: marvinpinto/action-automatic-releases@latest
2121
with:
22-
title: "RandomSpawnPlus5 v5.0.8"
23-
automatic_release_tag: "5.0.8"
22+
title: "RandomSpawnPlus5 v5.0.9"
23+
automatic_release_tag: "5.0.9"
2424
repo_token: "${{ secrets.GITHUB_TOKEN }}"
2525
files: "target/*.jar"
2626
prerelease: false

pom.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@
4646
</relocation>
4747
<relocation>
4848
<pattern>com.cryptomorin.xseries</pattern>
49-
<!-- Be sure to change the package below -->
5049
<shadedPattern>my.plugin.utils</shadedPattern>
5150
</relocation>
51+
<relocation>
52+
<pattern>org.bstats</pattern>
53+
<shadedPattern>systems.kscott.randomspawnplus.bstats</shadedPattern>
54+
</relocation>
5255
</relocations>
5356
<!-- Here you can remove the classes you don't use. -->
5457
<!-- These are some examples. -->
@@ -171,5 +174,11 @@
171174
<version>1.7.1</version>
172175
<scope>provided</scope>
173176
</dependency>
177+
<dependency>
178+
<groupId>org.bstats</groupId>
179+
<artifactId>bstats-bukkit</artifactId>
180+
<version>3.0.2</version>
181+
<scope>compile</scope>
182+
</dependency>
174183
</dependencies>
175184
</project>

src/main/java/systems/kscott/randomspawnplus/RandomSpawnPlus.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import org.bukkit.configuration.file.FileConfiguration;
99
import org.bukkit.plugin.RegisteredServiceProvider;
1010
import org.bukkit.plugin.java.JavaPlugin;
11+
import org.jetbrains.annotations.NotNull;
1112
import systems.kscott.randomspawnplus.commands.CommandRSP;
1213
import systems.kscott.randomspawnplus.commands.CommandWild;
1314
import systems.kscott.randomspawnplus.listeners.RSPDeathListener;
@@ -17,7 +18,7 @@
1718
import systems.kscott.randomspawnplus.spawn.SpawnFinder;
1819
import systems.kscott.randomspawnplus.util.Chat;
1920
import systems.kscott.randomspawnplus.util.ConfigFile;
20-
import systems.kscott.randomspawnplus.util.Metrics;
21+
import org.bstats.bukkit.Metrics;
2122

2223
public final class RandomSpawnPlus extends JavaPlugin {
2324

@@ -105,7 +106,7 @@ public IEssentials getEssentials() {
105106
return (IEssentials) getServer().getPluginManager().getPlugin("Essentials");
106107
}
107108

108-
public FileConfiguration getConfig() {
109+
public @NotNull FileConfiguration getConfig() {
109110
return configManager.getConfig();
110111
}
111112

@@ -119,10 +120,8 @@ public FileConfiguration getSpawns() {
119120

120121
private void setupPermissions() {
121122
RegisteredServiceProvider<LuckPerms> rsp = getServer().getServicesManager().getRegistration(LuckPerms.class);
122-
if (rsp == null) {
123-
luckPerms = null;
124-
}
125-
luckPerms = rsp.getProvider();
123+
if (rsp != null) luckPerms = rsp.getProvider();
124+
if (rsp == null) luckPerms = null;
126125
}
127126

128127
private boolean setupEconomy() {

src/main/java/systems/kscott/randomspawnplus/commands/CommandRSP.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@CommandPermission("randomspawnplus.manage")
1212
public class CommandRSP extends BaseCommand {
1313

14-
private RandomSpawnPlus plugin;
14+
private final RandomSpawnPlus plugin;
1515

1616
public CommandRSP(RandomSpawnPlus plugin) {
1717
this.plugin = plugin;

src/main/java/systems/kscott/randomspawnplus/commands/CommandWild.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
@Description("Teleport to a random location")
2727
public class CommandWild extends BaseCommand {
2828

29-
private RandomSpawnPlus plugin;
30-
private FileConfiguration config;
29+
private final RandomSpawnPlus plugin;
30+
private final FileConfiguration config;
3131

3232
public CommandWild(RandomSpawnPlus plugin) {
3333
this.plugin = plugin;
@@ -56,7 +56,7 @@ public void wild(CommandSender sender) {
5656
plugin.getLogger().info(Long.toString(cooldown));
5757

5858

59-
String message = plugin.getLang().getString("wild-tp-cooldown");
59+
String message = Chat.get("wild-tp-cooldown");
6060
message = message.replace("%delay", Chat.timeLeft(cooldown / 1000 - Instant.now().getEpochSecond()));
6161

6262
Chat.msg(player, message);
@@ -68,7 +68,7 @@ public void wild(CommandSender sender) {
6868
if (RandomSpawnPlus.getEconomy().has(player, config.getInt("wild-cost"))) {
6969
RandomSpawnPlus.getEconomy().withdrawPlayer(player, config.getInt("wild-cost"));
7070
} else {
71-
Chat.msg(player, plugin.getLang().getString("wild-no-money"));
71+
Chat.msg(player, Chat.get("wild-no-money"));
7272
return;
7373
}
7474
}
@@ -111,7 +111,7 @@ public void wildOther(CommandSender sender, String otherPlayerString) {
111111
Player otherPlayer = Bukkit.getPlayer(otherPlayerString);
112112

113113
if (otherPlayer == null) {
114-
Chat.msg(sender, plugin.getLang().getString("invalid-player"));
114+
Chat.msg(sender, Chat.get("invalid-player"));
115115
return;
116116
}
117117

src/main/java/systems/kscott/randomspawnplus/events/RandomSpawnEvent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.bukkit.entity.Player;
66
import org.bukkit.event.Event;
77
import org.bukkit.event.HandlerList;
8+
import org.jetbrains.annotations.NotNull;
89

910
public class RandomSpawnEvent extends Event {
1011

@@ -25,7 +26,7 @@ public RandomSpawnEvent(Location location, Player player, SpawnType spawnType) {
2526
}
2627

2728
@Override
28-
public HandlerList getHandlers() {
29+
public @NotNull HandlerList getHandlers() {
2930
return HANDLERS_LIST;
3031
}
3132
}

src/main/java/systems/kscott/randomspawnplus/events/SpawnCheckEvent.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
import org.bukkit.Location;
55
import org.bukkit.event.Event;
66
import org.bukkit.event.HandlerList;
7+
import org.jetbrains.annotations.NotNull;
78

9+
@Getter
810
public class SpawnCheckEvent extends Event {
911

1012
private static final HandlerList HANDLERS_LIST = new HandlerList();
11-
@Getter
12-
private Location location;
13-
@Getter
13+
private final Location location;
1414
private boolean valid;
15-
@Getter
1615
private String validReason = "UNK";
1716

1817
public SpawnCheckEvent(Location location) {
@@ -25,7 +24,7 @@ public static HandlerList getHandlerList() {
2524
}
2625

2726
@Override
28-
public HandlerList getHandlers() {
27+
public @NotNull HandlerList getHandlers() {
2928
return HANDLERS_LIST;
3029
}
3130

src/main/java/systems/kscott/randomspawnplus/listeners/RSPDeathListener.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
public class RSPDeathListener implements Listener {
1818

19-
private RandomSpawnPlus plugin;
20-
private FileConfiguration config;
19+
private final RandomSpawnPlus plugin;
20+
private final FileConfiguration config;
2121

2222
public RSPDeathListener(RandomSpawnPlus plugin) {
2323
this.plugin = plugin;
@@ -40,7 +40,7 @@ public void onDeath(PlayerRespawnEvent event) {
4040
}
4141
}
4242

43-
Location location = null;
43+
Location location;
4444
try {
4545
location = SpawnFinder.getInstance().findSpawn(true).add(0.5, 0, 0.5);
4646
} catch (FinderTimedOutException e) {

src/main/java/systems/kscott/randomspawnplus/listeners/RSPFirstJoinListener.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
public class RSPFirstJoinListener implements Listener {
2121

22-
private RandomSpawnPlus plugin;
23-
private FileConfiguration config;
22+
private final RandomSpawnPlus plugin;
23+
private final FileConfiguration config;
2424

2525
public RSPFirstJoinListener(RandomSpawnPlus plugin) {
2626
this.plugin = plugin;
@@ -37,7 +37,6 @@ public void firstJoinHandler(PlayerJoinEvent event) {
3737
if (RSPLoginListener.firstJoinPlayers.contains(player.getUniqueId())) {
3838
if (config.getBoolean("use-permission-node") && !player.hasPermission("randomspawnplus.randomspawn")) {
3939
RSPLoginListener.firstJoinPlayers.remove(player.getUniqueId());
40-
return;
4140
} else {
4241
try {
4342
Location spawnLoc = SpawnFinder.getInstance().findSpawn(true);

src/main/java/systems/kscott/randomspawnplus/listeners/RSPLoginListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public class RSPLoginListener implements Listener {
1414

1515
public static ArrayList<UUID> firstJoinPlayers = new ArrayList<>();
16-
private FileConfiguration config;
16+
private final FileConfiguration config;
1717

1818

1919
public RSPLoginListener(RandomSpawnPlus plugin) {

0 commit comments

Comments
 (0)