Configurable FoliaOffset
This commit is contained in:
parent
07806d8e6f
commit
c9a8159ea8
3 changed files with 4 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ public class FoliaFlow extends JavaPlugin {
|
||||||
public static double horizontalCoefficient;
|
public static double horizontalCoefficient;
|
||||||
public static double verticalCoefficient;
|
public static double verticalCoefficient;
|
||||||
public static double spawnHeight;
|
public static double spawnHeight;
|
||||||
|
public static double foliaOffset;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
|
@ -25,6 +26,7 @@ public class FoliaFlow extends JavaPlugin {
|
||||||
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");
|
spawnHeight = getConfig().getDouble("spawn_height");
|
||||||
|
foliaOffset = getConfig().getDouble("folia_offset");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void register() {
|
private void register() {
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public class PortalWatcher implements Listener {
|
||||||
// Add vector seems vanilla.
|
// Add vector seems vanilla.
|
||||||
SchedulerUtil.runLaterEntity(dummy, FoliaFlow.instance, () -> {
|
SchedulerUtil.runLaterEntity(dummy, FoliaFlow.instance, () -> {
|
||||||
// Portal teleportation on Folia is a bit below vanilla, so we teleport it above
|
// Portal teleportation on Folia is a bit below vanilla, so we teleport it above
|
||||||
if (SchedulerUtil.isFolia()) dummy.teleportAsync(dummy.getLocation().add(0, 0.5, 0));
|
if (SchedulerUtil.isFolia()) dummy.teleportAsync(dummy.getLocation().add(0, FoliaFlow.foliaOffset, 0));
|
||||||
dummy.setVelocity(dummyVel);
|
dummy.setVelocity(dummyVel);
|
||||||
},
|
},
|
||||||
2
|
2
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,4 @@
|
||||||
vertical_coefficient: -1.7
|
vertical_coefficient: -1.7
|
||||||
horizontal_coefficient: 1.46
|
horizontal_coefficient: 1.46
|
||||||
spawn_height: 0.08
|
spawn_height: 0.08
|
||||||
|
folia_offset: 0.08
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue