Skip to content

Commit

Permalink
cleanup lol
Browse files Browse the repository at this point in the history
  • Loading branch information
TAKfsg committed Apr 7, 2022
1 parent 78879da commit 0a66e67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ private void getSwingProgress(float f, CallbackInfo ci) {
@Inject(method = "method_9873", at = @At(value = "HEAD"))
private void useSwing(CallbackInfo ci) {
if (field_1876.options.keyAttack.isPressed() && field_1876.options.keyUse.isPressed() && field_1876.result.type == HitResult.Type.BLOCK) {
Material targetedMaterial = field_1876.world.getBlockState(field_1876.result.getBlockPos()).getBlock().getMaterial();
if (targetedMaterial != Material.WATER && targetedMaterial != Material.LAVA && targetedMaterial != Material.AIR) {
ClientPlayerEntity player = field_1876.player;
int swingAnimationEnd = player.hasStatusEffect(StatusEffect.HASTE) ? (6 - (1 +
player.getEffectInstance(StatusEffect.HASTE).getAmplifier())) : (player.hasStatusEffect(StatusEffect.MINING_FATIGUE) ? (6 + (1 +
player.getEffectInstance(StatusEffect.MINING_FATIGUE).getAmplifier()) * 2) : 6);
if (!player.handSwinging || player.handSwingTicks >= swingAnimationEnd / 2 || player.handSwingTicks < 0) {
player.handSwingTicks = -1;
player.handSwinging = true;
}
ClientPlayerEntity player = field_1876.player;
int swingAnimationEnd = player.hasStatusEffect(StatusEffect.HASTE) ? (6 - (1 +
player.getEffectInstance(StatusEffect.HASTE).getAmplifier())) : (player.hasStatusEffect(StatusEffect.MINING_FATIGUE) ? (6 + (1 +
player.getEffectInstance(StatusEffect.MINING_FATIGUE).getAmplifier()) * 2) : 6);
if (!player.handSwinging || player.handSwingTicks >= swingAnimationEnd / 2 || player.handSwingTicks < 0) {
player.handSwingTicks = -1;
player.handSwinging = true;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class PlayerEntityMixin {
private float currentHeight = 1.62F;
private long lastChangeTime = System.currentTimeMillis();

// TODO: Faster Upsneak Animation
/**
* @author TAKfsg
* @reason Semi-old Sneak Animation
Expand Down

0 comments on commit 0a66e67

Please sign in to comment.