Skip to content

Commit

Permalink
Merge pull request #97 from Booquefius/master
Browse files Browse the repository at this point in the history
add option to disable movement changes
  • Loading branch information
LielAmar authored Aug 14, 2022
2 parents 9100d12 + 359b0ee commit 8dcda63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ public OnAuthStateChange(@NotNull TwoFactorAuthentication plugin) {
@EventHandler
public void onStateChange(PlayerStateChangeEvent event) {
if (event.getNewAuthState().equals(AuthHandler.AuthState.AUTHENTICATED)) {
event.getPlayer().setFlySpeed((float) 0.1);
event.getPlayer().setWalkSpeed((float) 0.2);

if (plugin.getConfig().getBoolean("change-walking-speed", false)) {
event.getPlayer().setFlySpeed((float) 0.1);
event.getPlayer().setWalkSpeed((float) 0.2);
}

this.plugin.getStorageHandler().setIP(event.getPlayer().getUniqueId(),
this.hash.hash(event.getPlayer().getAddress().getAddress().getHostAddress()));
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ map-ids: []
# - NONE (no hash - not recommended!)
ip-hash: SHA256

# The player walk speed changes on joining
change-walking-speed: true

# How much delay should the plugin apply to loading players when the server reloads
# This is useful when you have multiple databases with different latencies
# You can use it to ensure your permissions plugin loads before the players are reloaded
Expand Down Expand Up @@ -160,4 +163,4 @@ storage-data:

# If you want to use a URI to connect to MongoDB, set the uri here. This will cause the plugin to ignore every other setting
# Leave it empty if you don't want to use a URI.
mongodb-uri: ""
mongodb-uri: ""

0 comments on commit 8dcda63

Please sign in to comment.