This commit is contained in:
MidnightTale 2023-04-11 17:04:39 +07:00
commit db1ab0e889

View file

@ -1,6 +1,6 @@
package xyz.hynse.bbsdfia; package xyz.hynse.bbsdfia;
import io.papermc.paper.threadedregions.scheduler.ScheduledTask; import io.papermc.paper.threadedregions.scheduler.EntityScheduler;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -44,10 +44,7 @@ public class Bbsdfia extends JavaPlugin implements Listener {
World world = Bukkit.getServer().getWorld("world"); World world = Bukkit.getServer().getWorld("world");
Location spawnLoc = new Location(world, 100, 50, 0); Location spawnLoc = new Location(world, 100, 50, 0);
*/ */
Bukkit.getAsyncScheduler().runNow(this, new Consumer<ScheduledTask>() { FallingBlock dummy = (FallingBlock) loc2.getWorld().spawnFallingBlock(loc2, ((FallingBlock) entity).getBlockData()).getScheduler().run(plu);
@Override
public void accept(ScheduledTask task) {
FallingBlock dummy = (FallingBlock) loc2.getWorld().spawnFallingBlock(loc2, ((FallingBlock) entity).getBlockData()).getScheduler();
Vector dummyVel = vel.clone(); Vector dummyVel = vel.clone();
dummyVel.setY(-dummyVel.getY()); dummyVel.setY(-dummyVel.getY());
dummyVel.multiply(new Vector(2, 2, 2)); // double the velocity dummyVel.multiply(new Vector(2, 2, 2)); // double the velocity
@ -56,8 +53,7 @@ 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);
}
}).isCancelled();
} }
} }
} }