fix: changed enable/disable task order
This commit is contained in:
parent
0184889798
commit
c55013ffcd
3 changed files with 9 additions and 10 deletions
|
@ -70,11 +70,11 @@ public abstract class AbstractModule implements IModule {
|
|||
}
|
||||
|
||||
public void enable() {
|
||||
IModule.super.enable();
|
||||
if (!this.enabled.get()) {
|
||||
this.enabled.set(true);
|
||||
this.enabled.save();
|
||||
}
|
||||
IModule.super.enable();
|
||||
log(String.format("%s ON", this.getName()));
|
||||
}
|
||||
|
||||
|
|
|
@ -108,24 +108,23 @@ public class VanillaFlight extends QuickModule implements ICommons {
|
|||
|
||||
@Override
|
||||
public void enable() {
|
||||
super.enable();
|
||||
this.tick = 0;
|
||||
if (MC.player != null) {
|
||||
this.couldFlyBefore = MC.player.abilities.mayfly;
|
||||
this.flyingSpeedBefore = MC.player.abilities.getFlyingSpeed();
|
||||
}
|
||||
super.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disable() {
|
||||
super.disable();
|
||||
ClientPlayerEntity player = MC.player;
|
||||
if (player != null) {
|
||||
player.abilities.mayfly = this.couldFlyBefore;
|
||||
player.abilities.setFlyingSpeed(this.flyingSpeedBefore);
|
||||
if (MC.player != null) {
|
||||
MC.player.abilities.mayfly = this.couldFlyBefore;
|
||||
MC.player.abilities.setFlyingSpeed(this.flyingSpeedBefore);
|
||||
if (this.force.get()) {
|
||||
player.abilities.flying = false;
|
||||
MC.player.abilities.flying = false;
|
||||
}
|
||||
}
|
||||
super.disable();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,10 +78,9 @@ public class Freecam extends QuickModule implements ICommons {
|
|||
|
||||
@Override
|
||||
public void enable() {
|
||||
super.enable();
|
||||
if (MC.player == null) {
|
||||
Boscovicino.log("[!] Can only enable freecam while in-game");
|
||||
this.disable();
|
||||
return;
|
||||
}
|
||||
|
||||
this.prev_speed = MC.player.abilities.getFlyingSpeed();
|
||||
|
@ -100,6 +99,7 @@ public class Freecam extends QuickModule implements ICommons {
|
|||
this.mock_player.setPosAndOldPos(this.prev_pos.x, this.prev_pos.y, this.prev_pos.z);
|
||||
this.mock_player.setYBodyRot(MC.player.yBodyRot);
|
||||
MC.level.addPlayer(-666, this.mock_player);
|
||||
super.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue