Skip to content

Commit

Permalink
Merge pull request #150 from LewMC/issue-145
Browse files Browse the repository at this point in the history
Issue #145
  • Loading branch information
lewmilburn authored Aug 6, 2024
2 parents 243355d + 9f624e6 commit 6d61d88
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>net.lewmc</groupId>
<artifactId>essence</artifactId>
<name>Essence</name>
<version>1.7.0</version>
<version>1.7.1-SNAPSHOT</version>
<build>
<resources>
<resource>
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>net.lewmc</groupId>
<artifactId>essence</artifactId>
<version>1.7.0</version>
<version>1.7.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Essence</name>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/lewmc/essence/events/RespawnEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public RespawnEvent(Essence plugin) {
*/
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) {
LogUtil log = new LogUtil(this.plugin);
MessageUtil message = new MessageUtil(event.getPlayer(), this.plugin);

FileUtil config = new FileUtil(this.plugin);
Expand All @@ -46,7 +47,7 @@ public void onPlayerRespawn(PlayerRespawnEvent event) {
TeleportUtil tp = new TeleportUtil(plugin);
tp.doTeleport(
event.getPlayer(),
Bukkit.getServer().getWorld("user.last-sleep-location.world"),
Bukkit.getServer().getWorld(playerData.getString("user.last-sleep-location.world")),
playerData.getDouble("user.last-sleep-location.X"),
playerData.getDouble("user.last-sleep-location.Y"),
playerData.getDouble("user.last-sleep-location.Z"),
Expand All @@ -64,7 +65,6 @@ public void onPlayerRespawn(PlayerRespawnEvent event) {
spawns.load("data/spawns.yml");

if (spawns.get("spawn."+spawnName) == null) {
LogUtil log = new LogUtil(this.plugin);
if (
Bukkit.getServer().getWorld(spawnName).getSpawnLocation() != null &&
Bukkit.getServer().getWorld(spawnName).getSpawnLocation().getY() >= 10
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/lewmc/essence/utils/TeleportUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ public void doTeleport(Player player, Location location, int delay) {
FoliaLib flib = new FoliaLib(this.plugin);
MessageUtil message = new MessageUtil(player, this.plugin);
if (location.getWorld() == null) {
message.send("generic","exception");
message.send("teleport","exception");
this.log.severe("Unable to locate world in universe.");
this.log.severe("Details: {\"error\": \"WORLD_IS_NULL\", \"caught\": \"TeleportUtil.java\", \"submitted\": \"null\", \"found\": \"null\"}.");
this.log.severe("Location: "+location);
return;
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/language/en-GB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ teleport:
requestsdisabled: "§4[Essence] §c{{1}} has teleportation requests disabled."
movetocancel: "§6[Essence] §eMove to cancel teleportation."
cancelled: "§4[Essence] §cTeleportation cancelled."
exception: "§4[Essence] §cEssence encountered an issue whilst trying to process this teleportation, please see console for details."
feed:
fed: "§2[Essence] §aYou fed {{1}}."
serverfed: "§2[Essence] §aYou've been fed by a magical force."
Expand Down

0 comments on commit 6d61d88

Please sign in to comment.