Merge pull request #17 from KaiijuMC/master

Add configurable spawn height
This commit is contained in:
Mid 2023-04-27 02:03:19 +07:00 • committed by GitHub
commit 07806d8e6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -10,6 +10,7 @@ public class FoliaFlow extends JavaPlugin {
public static FoliaFlow instance;
public static double horizontalCoefficient;
public static double verticalCoefficient;
public static double spawnHeight;
@Override
public void onEnable() {
@ -23,6 +24,7 @@ public class FoliaFlow extends JavaPlugin {
reloadConfig();
horizontalCoefficient = getConfig().getDouble("horizontal_coefficient");
verticalCoefficient = getConfig().getDouble("vertical_coefficient");
spawnHeight = getConfig().getDouble("spawn_height");
}
private void register() {

View file

@ -28,7 +28,7 @@ public class PortalWatcher implements Listener {
if(movingTo.getType() == Material.END_PORTAL){
Location spawnLoc = movingTo.getLocation();
spawnLoc.add(0.5, 0.5, 0.5);
spawnLoc.add(0.5, FoliaFlow.spawnHeight, 0.5);
FallingBlock dummy = loc.getWorld().spawnFallingBlock(spawnLoc, ((FallingBlock) entity).getBlockData());
Vector dummyVel = vel.clone();

View file

@ -5,3 +5,4 @@
vertical_coefficient: -1.7
horizontal_coefficient: 1.46
spawn_height: 0.08