From c0df25a8fd0d1b3263d4e27a691f538082e08352 Mon Sep 17 00:00:00 2001 From: MidnightTale Date: Tue, 11 Apr 2023 18:40:47 +0700 Subject: [PATCH] spawnlocation --- src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java b/src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java index cce0fa6..327eca4 100644 --- a/src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java +++ b/src/main/java/xyz/hynse/bbsdfia/Bbsdfia.java @@ -42,6 +42,7 @@ public class Bbsdfia extends JavaPlugin implements Listener { // Get the entity and its location and velocity Entity entity = e.getEntity(); Location loc = entity.getLocation(); + Location spawnlocation = new Location(Bukkit.getWorld("world_the_end"), 100, 50, 0); Vector vel = entity.getVelocity(); // Get the block that the entity is moving towards @@ -49,14 +50,9 @@ public class Bbsdfia extends JavaPlugin implements Listener { // If the block it's moving towards is an end portal block if (movingTo != null && movingTo.getType() == Material.END_PORTAL) { - // Get the location of the block and center it - Location spawnLoc = movingTo.getLocation(); - spawnLoc.setX(spawnLoc.getX() + 0.5); - spawnLoc.setY(spawnLoc.getY() + 0.5); - spawnLoc.setZ(spawnLoc.getZ() + 0.5); // Spawn a new falling block entity at the center of the end portal block - FallingBlock dummy = Bukkit.getServer().getWorld("world_the_end").spawnFallingBlock(spawnLoc, ((FallingBlock) entity).getBlockData()); + FallingBlock dummy = Bukkit.getServer().getWorld("world_the_end").spawnFallingBlock(spawnlocation, ((FallingBlock) entity).getBlockData()); // Copy the velocity of the original entity and invert the y component Vector dummyVel = vel.clone();