18 lines
875 B
Java
18 lines
875 B
Java
package online.astradev.weapons.mixin;
|
|||
|
|
|
||
|
|
import net.minecraft.server.level.ServerPlayer;
|
||
|
|
import org.spongepowered.asm.mixin.Mixin;
|
||
|
|
import org.spongepowered.asm.mixin.injection.At;
|
||
|
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||
|
|
import online.astradev.weapons.behavior.GauntletCombat;
|
||
|
|
import online.astradev.weapons.behavior.TwinbladeCombat;
|
||
|
|
|
||
|
|
/** Charge belongs to accepted custom strikes, not rejected/duplicate animation packets. */
|
||
|
|
@Mixin(ServerPlayer.class)
|
||
|
|
public abstract class WeaponSwingChargeMixin {
|
||
|
|
@Redirect(method="swing(Lnet/minecraft/world/InteractionHand;)V",at=@At(value="INVOKE",target="Lnet/minecraft/server/level/ServerPlayer;resetAttackStrengthTicker()V"))
|
||
|
|
private void astraweapons$charge(ServerPlayer player) {
|
||
|
|
if(!GauntletCombat.holds(player) && !TwinbladeCombat.holdsTwinblade(player)) player.resetAttackStrengthTicker();
|
||
|
|
}
|
||
|
|
}
|