Merge pull request #17 from KaiijuMC/master
Add configurable spawn height
This commit is contained in:
commit
07806d8e6f
3 changed files with 4 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ public class FoliaFlow extends JavaPlugin {
|
||||||
public static FoliaFlow instance;
|
public static FoliaFlow instance;
|
||||||
public static double horizontalCoefficient;
|
public static double horizontalCoefficient;
|
||||||
public static double verticalCoefficient;
|
public static double verticalCoefficient;
|
||||||
|
public static double spawnHeight;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
|
@ -23,6 +24,7 @@ public class FoliaFlow extends JavaPlugin {
|
||||||
reloadConfig();
|
reloadConfig();
|
||||||
horizontalCoefficient = getConfig().getDouble("horizontal_coefficient");
|
horizontalCoefficient = getConfig().getDouble("horizontal_coefficient");
|
||||||
verticalCoefficient = getConfig().getDouble("vertical_coefficient");
|
verticalCoefficient = getConfig().getDouble("vertical_coefficient");
|
||||||
|
spawnHeight = getConfig().getDouble("spawn_height");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void register() {
|
private void register() {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class PortalWatcher implements Listener {
|
||||||
|
|
||||||
if(movingTo.getType() == Material.END_PORTAL){
|
if(movingTo.getType() == Material.END_PORTAL){
|
||||||
Location spawnLoc = movingTo.getLocation();
|
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());
|
FallingBlock dummy = loc.getWorld().spawnFallingBlock(spawnLoc, ((FallingBlock) entity).getBlockData());
|
||||||
Vector dummyVel = vel.clone();
|
Vector dummyVel = vel.clone();
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,4 @@
|
||||||
|
|
||||||
vertical_coefficient: -1.7
|
vertical_coefficient: -1.7
|
||||||
horizontal_coefficient: 1.46
|
horizontal_coefficient: 1.46
|
||||||
|
spawn_height: 0.08
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue