Skip to content

Commit

Permalink
1.0.2 bug fix
Browse files Browse the repository at this point in the history
Corrects issues still prevalent with dying in a dimension other than the overworld.
  • Loading branch information
griimnak committed Aug 15, 2019
1 parent 10a790c commit 22770bc
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,17 @@ public void onPlayerDamage(EntityDamageEvent event) {
damaged.setFoodLevel(20);

// respawn
if(damaged.getBedSpawnLocation() != null) {
damaged.teleport(damaged.getBedSpawnLocation());
damaged.sendMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + ConfigManager.config.getString("RespawnBedText"));
} else {
damaged.teleport(damaged.getServer().getWorlds().get(0).getSpawnLocation());
damaged.sendMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + ConfigManager.config.getString("RespawnWildText"));
}
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
public void run() {
if(damaged.getBedSpawnLocation() != null) {
damaged.teleport(damaged.getBedSpawnLocation());
damaged.sendMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + ConfigManager.config.getString("RespawnBedText"));
} else {
damaged.teleport(damaged.getServer().getWorlds().get(0).getSpawnLocation());
damaged.sendMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + ConfigManager.config.getString("RespawnWildText"));
}
}
}, 5);

// trippy effects if enabled
if(ConfigManager.config.getBoolean("RespawnSoundEnabled")) {
Expand All @@ -151,7 +155,7 @@ public void onPlayerDamage(EntityDamageEvent event) {
public void run() {
plugin.getServer().dispatchCommand(plugin.getServer().getConsoleSender(), "tempban " + damaged.getName() + " " + ConfigManager.config.getString("BanOnDeathHoursAmmount") + "h1s " + ConfigManager.config.getString("BanOnDeathText"));
}
}, 50);
}, 20);
}
}

Expand Down

0 comments on commit 22770bc

Please sign in to comment.