Archiviert
13
0
Dieser Commit ist enthalten in:
Yaruma3341 2020-01-19 19:25:08 +01:00
Ursprung 7a6b079b9d
Commit f635b386f7
2 geänderte Dateien mit 15 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -6,11 +6,14 @@ import de.steamwar.lobby.utils.LobbyPlayer;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.EnderPearl; import org.bukkit.entity.EnderPearl;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority; import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.event.vehicle.VehicleExitEvent; import org.bukkit.event.vehicle.VehicleExitEvent;
@ -61,5 +64,16 @@ public class EnderPearlListener implements Listener {
event.setCancelled(true); event.setCancelled(true);
} }
@EventHandler
public void handleProjectileHit(ProjectileHitEvent event) {
Entity entity = event.getEntity();
if(entity.getType() != EntityType.ENDER_PEARL)
return;
if(!(entity.getPassenger() instanceof Player))
return;
Player player = (Player) entity;
player.teleport(event.getHitBlock().getLocation());
}
} }

Datei anzeigen

@ -59,7 +59,7 @@ public class ShieldListener implements Listener {
if(!entityPlayerLP.isShield()) if(!entityPlayerLP.isShield())
continue; continue;
world.playEffect(playerLocation, Effect.ENDER_SIGNAL, 1); world.playEffect(entityPlayer.getLocation(), Effect.ENDER_SIGNAL, 1);
Location location = entityPlayer.getLocation(); Location location = entityPlayer.getLocation();