Merge pull request #18 from KaiijuMC/master

Configurable FoliaOffset
This commit is contained in:
Mid 2023-04-27 03:44:27 +07:00 • committed by GitHub
commit 1a3d65b782
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -11,6 +11,7 @@ public class FoliaFlow extends JavaPlugin {
public static double horizontalCoefficient;
public static double verticalCoefficient;
public static double spawnHeight;
public static double foliaOffset;
@Override
public void onEnable() {
@ -25,6 +26,7 @@ public class FoliaFlow extends JavaPlugin {
horizontalCoefficient = getConfig().getDouble("horizontal_coefficient");
verticalCoefficient = getConfig().getDouble("vertical_coefficient");
spawnHeight = getConfig().getDouble("spawn_height");
foliaOffset = getConfig().getDouble("folia_offset");
}
private void register() {

View file

@ -39,7 +39,7 @@ public class PortalWatcher implements Listener {
// Add vector seems vanilla.
SchedulerUtil.runLaterEntity(dummy, FoliaFlow.instance, () -> {
// 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);
},
2

View file

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