Skip to content

Commit

Permalink
Add spawn.schematic and avoid void damage in spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
rlf committed Jul 14, 2018
1 parent 1af3736 commit 3433e07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,18 @@ public void onVisitorDamage(final EntityDamageEvent event) {
}
}

@EventHandler(priority = EventPriority.HIGHEST)
public void onSpawnDamage(final EntityDamageEvent event) {
if (!plugin.isSkyWorld(event.getEntity().getWorld())) {
return;
}
if (event.getEntity() instanceof Player && plugin.playerIsInSpawn((Player) event.getEntity()) && event.getCause() == EntityDamageEvent.DamageCause.VOID) {
event.setDamage(-event.getDamage());
event.setCancelled(true);
plugin.spawnTeleport((Player) event.getEntity(), true);
}
}

@EventHandler
public void onMemberDamage(final EntityDamageByEntityEvent event) {
if (!plugin.isSkyWorld(event.getEntity().getWorld())) {
Expand Down
Binary file not shown.

0 comments on commit 3433e07

Please sign in to comment.