Skip to content

Commit

Permalink
Fix Paper method use
Browse files Browse the repository at this point in the history
from dev branch of 89apt89
  • Loading branch information
Dreeam-qwq committed Sep 25, 2022
1 parent c16531a commit fbe4a3b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
- name: Upload RandomSpawnPlus5
uses: actions/upload-artifact@v3
with:
name: RandomSpawnPlus5-maven
name: RandomSpawnPlus5
path: target/
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

.gradle
build/
target/

# Ignore Gradle GUI config
gradle-app.setting
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>systems.kscott</groupId>
<artifactId>randomspawnplus</artifactId>
<version>5.0.0</version>
<version>5.0.1</version>
<packaging>jar</packaging>

<name>RandomSpawnPlus</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void firstJoinHandler(PlayerJoinEvent event) {
} else {
try {
Location spawnLoc = SpawnFinder.getInstance().findSpawn(true);
//by quiquelhappy - Prevent essentials home replace
// quiquelhappy start - Prevent essentials home replace
boolean prevent = false;
if (config.getBoolean("essentials-home-on-first-spawn")) {
User user = plugin.getEssentials().getUser(player);
Expand All @@ -66,6 +66,7 @@ public void run() {
} else {
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?).");
}
// quiquelhappy end
} catch (FinderTimedOutException e) {
plugin.getLogger().warning("The spawn finder failed to find a valid spawn, and has not given " + player.getUniqueId() + " a random spawn. If you find this happening a lot, then raise the 'spawn-finder-tries-before-timeout' key in the config.");
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ public boolean checkSpawn(Location location) {
if (locClone == null) {
return false;
}
if (!location.isChunkLoaded()) {
// 89apt89 start - Fix Paper method use
if (!location.getChunk().isLoaded()) {
location.getChunk().load();
}
// 89apt89 end

Block block0 = locClone.getBlock();
Block block1 = locClone.add(0, 1, 0).getBlock();
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#############################
# RandomSpawnPlus5 #
# Version 5.0.1 #
# by @89apt89 & @Dreeam #
#############################

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/lang.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#############################
# RandomSpawnPlus5 #
# Version 5.0.0 #
# Version 5.0.1 #
# by @89apt89 & @Dreeam #
#############################

Expand Down

0 comments on commit fbe4a3b

Please sign in to comment.