From 3433e074405d5bb8ceb4502f748d8e91a66b07c6 Mon Sep 17 00:00:00 2001 From: rlf Date: Sat, 14 Jul 2018 14:18:43 +0200 Subject: [PATCH] Add spawn.schematic and avoid void damage in spawn --- .../ultimateskyblock/event/PlayerEvents.java | 12 ++++++++++++ .../main/resources/schematics/spawn.schematic | Bin 0 -> 2270 bytes 2 files changed, 12 insertions(+) create mode 100644 uSkyBlock-Core/src/main/resources/schematics/spawn.schematic diff --git a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java index 633e69205..dbd24bd5c 100644 --- a/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java +++ b/uSkyBlock-Core/src/main/java/us/talabrek/ultimateskyblock/event/PlayerEvents.java @@ -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())) { diff --git a/uSkyBlock-Core/src/main/resources/schematics/spawn.schematic b/uSkyBlock-Core/src/main/resources/schematics/spawn.schematic new file mode 100644 index 0000000000000000000000000000000000000000..05ea3316e3a93e14e30e114687db62004e02f12e GIT binary patch literal 2270 zcmV<42qE_$iwFP!000001MHpeZ`;Nh$1j%UNJ(1P?%H(Ni*YKjp>47xPUdaifJ~0P zL}+XWkx{Sf3W1_d5+RCINh*pL6xctzH+#2Ndzqaiijt_~9Z9LOWPU$y9#fC*`24u% z?#LX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