Skip to content

Commit 0513e29

Browse files
committed
[ci skip] Update
Code cleanup Optimize jar size Fixed acf error
1 parent 96acb96 commit 0513e29

File tree

5 files changed

+41
-28
lines changed

5 files changed

+41
-28
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
Support 1.7.x - 1.20.x (maybe?)
66

7+
## Building
8+
9+
`./mvn clean package`
710

811
## Contact
912

pom.xml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,30 @@
3232
<plugin>
3333
<groupId>org.apache.maven.plugins</groupId>
3434
<artifactId>maven-shade-plugin</artifactId>
35-
<version>3.5.0</version>
35+
<version>3.5.1</version>
3636
<configuration>
3737
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
38+
<minimizeJar>true</minimizeJar>
3839
<relocations>
3940
<relocation>
4041
<pattern>co.aikar.commands</pattern>
41-
<shadedPattern>systems.kscott.randomspawnplus.acf</shadedPattern>
42+
<shadedPattern>systems.kscott.randomspawnplus.lib.acf.commands</shadedPattern>
4243
</relocation>
4344
<relocation>
4445
<pattern>co.aikar.locales</pattern>
45-
<shadedPattern>systems.kscott.randomspawnplus.locales</shadedPattern>
46+
<shadedPattern>systems.kscott.randomspawnplus.lib.acf.locales</shadedPattern>
47+
</relocation>
48+
<relocation>
49+
<pattern>io.papermc.lib</pattern>
50+
<shadedPattern>systems.kscott.randomspawnplus.lib.paperlib</shadedPattern>
4651
</relocation>
4752
<relocation>
4853
<pattern>com.cryptomorin.xseries</pattern>
49-
<shadedPattern>my.plugin.utils</shadedPattern>
54+
<shadedPattern>systems.kscott.randomspawnplus.lib.xseries</shadedPattern>
5055
</relocation>
5156
<relocation>
5257
<pattern>org.bstats</pattern>
53-
<shadedPattern>systems.kscott.randomspawnplus.bstats</shadedPattern>
58+
<shadedPattern>systems.kscott.randomspawnplus.lib.bstats</shadedPattern>
5459
</relocation>
5560
</relocations>
5661
<!-- Here you can remove the classes you don't use. -->
@@ -121,29 +126,38 @@
121126
<dependency>
122127
<groupId>io.papermc.paper</groupId>
123128
<artifactId>paper-api</artifactId>
124-
<version>1.20.1-R0.1-SNAPSHOT</version>
129+
<version>1.20.2-R0.1-SNAPSHOT</version>
125130
<scope>provided</scope>
126131
</dependency>
127132
<dependency>
128133
<groupId>org.apache.commons</groupId>
129134
<artifactId>commons-lang3</artifactId>
130135
<version>3.13.0</version>
136+
<scope>provided</scope>
131137
</dependency>
132138
<dependency>
133139
<groupId>org.projectlombok</groupId>
134140
<artifactId>lombok</artifactId>
135-
<version>1.18.28</version>
141+
<version>1.18.30</version>
136142
<scope>provided</scope>
137143
</dependency>
138144
<dependency>
139145
<groupId>net.kyori</groupId>
140146
<artifactId>adventure-api</artifactId>
141147
<version>4.14.0</version>
148+
<scope>provided</scope>
142149
</dependency>
150+
<!-- <dependency>-->
151+
<!-- <groupId>co.aikar</groupId>-->
152+
<!-- <artifactId>acf-paper</artifactId>-->
153+
<!-- <version>0.5.1-SNAPSHOT</version>-->
154+
<!-- <scope>compile</scope>-->
155+
<!-- </dependency>-->
143156
<dependency>
144-
<groupId>co.aikar</groupId>
157+
<groupId>com.github.Dreeam-qwq.commands</groupId>
145158
<artifactId>acf-paper</artifactId>
146-
<version>0.5.1-SNAPSHOT</version>
159+
<version>665f076c</version>
160+
<scope>compile</scope>
147161
</dependency>
148162
<dependency>
149163
<groupId>io.papermc</groupId>
@@ -154,7 +168,8 @@
154168
<dependency>
155169
<groupId>com.github.cryptomorin</groupId>
156170
<artifactId>XSeries</artifactId>
157-
<version>9.5.0</version>
171+
<version>9.6.0</version>
172+
<scope>compile</scope>
158173
</dependency>
159174
<dependency>
160175
<groupId>net.essentialsx</groupId>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void _main(CommandSender player) {
2626
Chat.msg(player, "&b/rsp reload &8- &7Reload the plugin configuration.");
2727
Chat.msg(player, "&b/wild &8- &7Randomly teleport yourself.");
2828
Chat.msg(player, "&b/wild <other> &8- &7Randomly teleport another player.");
29-
Chat.msg(player, "&7Need help? Check out &bdocs.randomspawnpl.us&7.");
29+
Chat.msg(player, "&7Need help? Check out &bhttps://github.com/Winds-Studio/RandomSpawnPlus5&7.");
3030
}
3131

3232
@Subcommand("reload")

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,12 @@ public void wild(CommandSender sender) {
6363
return;
6464

6565
}
66-
if (RandomSpawnPlus.getEconomy() != null && plugin.getConfig().getInt("wild-cost") != 0) {
67-
if (!player.hasPermission("randomspawnplus.wild.bypasscost")) {
68-
if (RandomSpawnPlus.getEconomy().has(player, config.getInt("wild-cost"))) {
69-
RandomSpawnPlus.getEconomy().withdrawPlayer(player, config.getInt("wild-cost"));
70-
} else {
71-
Chat.msg(player, Chat.get("wild-no-money"));
72-
return;
73-
}
66+
if (RandomSpawnPlus.getEconomy() != null && plugin.getConfig().getInt("wild-cost") != 0 && !player.hasPermission("randomspawnplus.wild.bypasscost")) {
67+
if (RandomSpawnPlus.getEconomy().has(player, config.getInt("wild-cost"))) {
68+
RandomSpawnPlus.getEconomy().withdrawPlayer(player, config.getInt("wild-cost"));
69+
} else {
70+
Chat.msg(player, Chat.get("wild-no-money"));
71+
return;
7472
}
7573
}
7674

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,14 @@ public void firstJoinHandler(PlayerJoinEvent event) {
5151
prevent = true;
5252
}
5353
}
54-
if(!prevent){
55-
new BukkitRunnable() {
56-
@Override
57-
public void run() {
58-
RandomSpawnEvent randomSpawnEvent = new RandomSpawnEvent(spawnLoc, player, SpawnType.FIRST_JOIN);
54+
if (!prevent) {
55+
Bukkit.getRegionScheduler().runDelayed(plugin, player.getLocation(), task -> {
56+
RandomSpawnEvent randomSpawnEvent = new RandomSpawnEvent(spawnLoc, player, SpawnType.FIRST_JOIN);
5957

60-
Bukkit.getServer().getPluginManager().callEvent(randomSpawnEvent);
61-
PaperLib.teleportAsync(player, spawnLoc.add(0.5, 0, 0.5));
58+
Bukkit.getServer().getPluginManager().callEvent(randomSpawnEvent);
59+
PaperLib.teleportAsync(player, spawnLoc.add(0.5, 0, 0.5));
6260

63-
}
64-
}.runTaskLater(plugin, 3);
61+
}, 3L);
6562
} else {
6663
plugin.getLogger().warning("The spawn finder prevented a teleport for " + player.getUniqueId() + ", since essentials sethome is enabled and the player already had a home (perhaps old player data?).");
6764
}

0 commit comments

Comments
 (0)