Makes the delay to prevent client errors configurable
This commit is contained in:
parent
497551d889
commit
6c32de59a8
@ -112,6 +112,13 @@ public enum ConfigOption {
|
|||||||
"Whether to enable a fix that causes loss of NBT data, but allows vehicle teleportation to work " +
|
"Whether to enable a fix that causes loss of NBT data, but allows vehicle teleportation to work " +
|
||||||
"when CraftBook's remove minecart/boat on eject setting is enabled", false),
|
"when CraftBook's remove minecart/boat on eject setting is enabled", false),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The delay between teleporting a vehicle and adding the player as passenger
|
||||||
|
*/
|
||||||
|
WAIT_FOR_PLAYER_AFTER_TELEPORT_DELAY("advanced.waitForPlayerAfterTeleportDelay",
|
||||||
|
"The amount of ticks to wait before adding a player as passenger of a vehicle. On slow servers, " +
|
||||||
|
"a value of 6 is required to avoid client glitches after teleporting on a vehicle.", 1),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to enable economy support for taking payment from players creating/destroying/using stargates
|
* Whether to enable economy support for taking payment from players creating/destroying/using stargates
|
||||||
*/
|
*/
|
||||||
|
@ -136,6 +136,15 @@ public final class StargateGateConfig {
|
|||||||
return (boolean) configOptions.get(ConfigOption.ENABLE_CRAFT_BOOK_REMOVE_ON_EJECT_FIX);
|
return (boolean) configOptions.get(ConfigOption.ENABLE_CRAFT_BOOK_REMOVE_ON_EJECT_FIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the delay to use before adding a player as passenger of a teleported vehicle
|
||||||
|
*
|
||||||
|
* @return <p>The delay to use before adding a player as passenger of a teleported vehicle</p>
|
||||||
|
*/
|
||||||
|
public int waitForPlayerAfterTeleportDelay() {
|
||||||
|
return (int) configOptions.get(ConfigOption.WAIT_FOR_PLAYER_AFTER_TELEPORT_DELAY);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets whether the list of destinations within a network should be sorted
|
* Gets whether the list of destinations within a network should be sorted
|
||||||
*
|
*
|
||||||
|
@ -115,7 +115,7 @@ public final class TeleportHelper {
|
|||||||
teleportLeashedCreatures(player, origin, target);
|
teleportLeashedCreatures(player, origin, target);
|
||||||
}
|
}
|
||||||
TeleportHelper.teleportAndAddPassenger(entity, passenger, exitRotation);
|
TeleportHelper.teleportAndAddPassenger(entity, passenger, exitRotation);
|
||||||
}, passenger instanceof Player ? 6 : 0);
|
}, passenger instanceof Player ? Stargate.getGateConfig().waitForPlayerAfterTeleportDelay() : 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,7 +144,8 @@ public final class TeleportHelper {
|
|||||||
creature.setLeashHolder(null);
|
creature.setLeashHolder(null);
|
||||||
scheduler.scheduleSyncDelayedTask(Stargate.getInstance(), () -> {
|
scheduler.scheduleSyncDelayedTask(Stargate.getInstance(), () -> {
|
||||||
new EntityTeleporter(target, creature).teleportEntity(origin);
|
new EntityTeleporter(target, creature).teleportEntity(origin);
|
||||||
scheduler.scheduleSyncDelayedTask(Stargate.getInstance(), () -> creature.setLeashHolder(player), 6);
|
scheduler.scheduleSyncDelayedTask(Stargate.getInstance(), () -> creature.setLeashHolder(player),
|
||||||
|
Stargate.getGateConfig().waitForPlayerAfterTeleportDelay());
|
||||||
}, 2);
|
}, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,3 +86,6 @@ debugging:
|
|||||||
debug: false
|
debug: false
|
||||||
# permissionDebug - This will output any and all Permissions checks to console, used for permissions debugging (Requires debug: true)
|
# permissionDebug - This will output any and all Permissions checks to console, used for permissions debugging (Requires debug: true)
|
||||||
permissionDebug: false
|
permissionDebug: false
|
||||||
|
advanced:
|
||||||
|
# waitForPlayerAfterTeleportDelay - The amount of ticks to wait before adding a player as passenger of a vehicle. On slow servers, a value of 6 is required to avoid client glitches after teleporting on a vehicle.
|
||||||
|
waitForPlayerAfterTeleportDelay: 6
|
Loading…
x
Reference in New Issue
Block a user