EntityScheduler
This commit is contained in:
parent
776f46653b
commit
edb8a106ea
1 changed files with 3 additions and 8 deletions
|
|
@ -5,7 +5,6 @@ import com.tcoded.folialib.FoliaLib;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
@ -38,13 +37,9 @@ public class Bbsdfia extends JavaPlugin implements Listener {
|
||||||
Location loc = entity.getLocation();
|
Location loc = entity.getLocation();
|
||||||
Vector vel = entity.getVelocity();
|
Vector vel = entity.getVelocity();
|
||||||
Block movingTo = getBlockMovingTo(loc, vel);
|
Block movingTo = getBlockMovingTo(loc, vel);
|
||||||
foliaLib.getImpl().runAtEntity(entity, () -> {/* Code */
|
|
||||||
if(movingTo != null && movingTo.getType() == Material.END_PORTAL){
|
if(movingTo != null && movingTo.getType() == Material.END_PORTAL){
|
||||||
Location spawnLoc = movingTo.getLocation();
|
Location spawnLoc = new Location(Bukkit.getWorld("world_the_end"), 100, 50 ,0);
|
||||||
spawnLoc.setX(spawnLoc.getX()+0.5);
|
foliaLib.getImpl().runAtEntity(entity, () -> {
|
||||||
spawnLoc.setY(spawnLoc.getY()+0.5);
|
|
||||||
spawnLoc.setZ(spawnLoc.getZ()+0.5);
|
|
||||||
|
|
||||||
FallingBlock dummy = loc.getWorld().spawnFallingBlock(spawnLoc, ((FallingBlock) entity).getBlockData());
|
FallingBlock dummy = loc.getWorld().spawnFallingBlock(spawnLoc, ((FallingBlock) entity).getBlockData());
|
||||||
Vector dummyVel = vel.clone();
|
Vector dummyVel = vel.clone();
|
||||||
dummyVel.setY(-dummyVel.getY());
|
dummyVel.setY(-dummyVel.getY());
|
||||||
|
|
@ -54,8 +49,8 @@ public class Bbsdfia extends JavaPlugin implements Listener {
|
||||||
dummyVel.add(new Vector(0, 0.3, 0));
|
dummyVel.add(new Vector(0, 0.3, 0));
|
||||||
|
|
||||||
dummy.setVelocity(dummyVel);
|
dummy.setVelocity(dummyVel);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue