Don't keep old velocity changes, prevent 2 velocities
This commit is contained in:
parent
4f140fce9b
commit
7f725d26bd
@ -78,7 +78,8 @@ public class DisguiseUtilities {
|
||||
private static File profileCache = new File("plugins/LibsDisguises/GameProfiles"), savedDisguises = new File(
|
||||
"plugins/LibsDisguises/SavedDisguises");
|
||||
private static Gson gson;
|
||||
private static boolean pluginsUsed, commandsUsed, copyDisguiseCommandUsed, grabSkinCommandUsed, saveDisguiseCommandUsed;
|
||||
private static boolean pluginsUsed, commandsUsed, copyDisguiseCommandUsed, grabSkinCommandUsed,
|
||||
saveDisguiseCommandUsed;
|
||||
private static long libsDisguisesCalled;
|
||||
/**
|
||||
* Keeps track of what tick this occured
|
||||
@ -94,8 +95,13 @@ public class DisguiseUtilities {
|
||||
}
|
||||
|
||||
public static void setPlayerVelocity(Player player) {
|
||||
velocityID = player.getEntityId();
|
||||
velocityTime = player.getWorld().getTime();
|
||||
if (player == null) {
|
||||
velocityID = 0;
|
||||
velocityTime = 0;
|
||||
} else {
|
||||
velocityID = player.getEntityId();
|
||||
velocityTime = player.getWorld().getTime();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -180,6 +180,8 @@ public class PacketListenerViewSelfDisguise extends PacketAdapter {
|
||||
// The player only sees velocity changes when there is a velocity event. As the method claims there
|
||||
// was no velocity event...
|
||||
event.setCancelled(true);
|
||||
// Clear old velocity, this should only occur once.
|
||||
DisguiseUtilities.setPlayerVelocity(null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user