Fix crash
This commit is contained in:
parent
c5b554f4c6
commit
db4cdee44f
51044
javascript/classes.js
51044
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -894,32 +894,10 @@ public class GuiIngame extends Gui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void attemptSwing() {
|
|
||||||
if(ModManager.animations.isEnabled()) {
|
|
||||||
if (this.mc.thePlayer.getItemInUseCount() > 0) {
|
|
||||||
final boolean mouseDown = this.mc.gameSettings.keyBindAttack.isKeyDown() && this.mc.gameSettings.keyBindUseItem.isKeyDown();
|
|
||||||
if (mouseDown && this.mc.objectMouseOver != null && this.mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
|
|
||||||
this.swingItem(this.mc.thePlayer);
|
|
||||||
}else if(mouseDown) {
|
|
||||||
this.swingItem(this.mc.thePlayer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void swingItem(EntityPlayerSP entityplayersp) {
|
|
||||||
final int swingAnimationEnd = entityplayersp.isPotionActive(Potion.digSpeed) ? (6 - (1 + entityplayersp.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1) : (entityplayersp.isPotionActive(Potion.digSlowdown) ? (6 + (1 + entityplayersp.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2) : 6);
|
|
||||||
if (!entityplayersp.isSwingInProgress || entityplayersp.swingProgressInt >= swingAnimationEnd / 2 || entityplayersp.swingProgressInt < 0) {
|
|
||||||
entityplayersp.swingProgressInt = -1;
|
|
||||||
entityplayersp.isSwingInProgress = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**+
|
/**+
|
||||||
* The update tick for the ingame UI
|
* The update tick for the ingame UI
|
||||||
*/
|
*/
|
||||||
public void updateTick() {
|
public void updateTick() {
|
||||||
attemptSwing();
|
|
||||||
if (this.recordPlayingUpFor > 0) {
|
if (this.recordPlayingUpFor > 0) {
|
||||||
--this.recordPlayingUpFor;
|
--this.recordPlayingUpFor;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user