修复波塞科拉弓后切换武器保留拉弓进度的bug
This commit is contained in:
parent
dab59fce2a
commit
7455e08036
2 changed files with 16 additions and 1 deletions
|
@ -1507,6 +1507,10 @@ public class ClientEventHandler {
|
|||
lungeSprint = 0;
|
||||
lungeAttack = 0;
|
||||
burstFireAmount = 0;
|
||||
pullTimer = 0;
|
||||
bowTimer = 0;
|
||||
handTimer = 0;
|
||||
handPos = 0;
|
||||
}
|
||||
|
||||
private static void handleWeaponDraw(LivingEntity entity) {
|
||||
|
|
|
@ -381,6 +381,12 @@ public class LivingEventHandler {
|
|||
|
||||
var cap = player.getData(ModAttachments.PLAYER_VARIABLE).watch();
|
||||
cap.edit = false;
|
||||
|
||||
if (oldStack.is(ModItems.BOCEK)) {
|
||||
oldData.data().putInt("Power", 0);
|
||||
cap.bowPullHold = false;
|
||||
}
|
||||
|
||||
player.setData(ModAttachments.PLAYER_VARIABLE, cap);
|
||||
cap.sync(player);
|
||||
|
||||
|
@ -414,6 +420,12 @@ public class LivingEventHandler {
|
|||
newData.charge.timer.reset();
|
||||
}
|
||||
|
||||
var cap = player.getData(ModAttachments.PLAYER_VARIABLE).watch();
|
||||
if (newStack.is(ModItems.BOCEK)) {
|
||||
newData.data().putInt("Power", 0);
|
||||
cap.bowPullHold = false;
|
||||
}
|
||||
|
||||
int level = newData.perk.getLevel(ModPerks.KILLING_TALLY);
|
||||
if (level != 0) {
|
||||
GunsTool.setPerkIntTag(newTag, "KillingTally", 0);
|
||||
|
@ -423,7 +435,6 @@ public class LivingEventHandler {
|
|||
PacketDistributor.sendToPlayer(serverPlayer, new DrawClientMessage(true));
|
||||
}
|
||||
|
||||
var cap = player.getData(ModAttachments.PLAYER_VARIABLE).watch();
|
||||
cap.tacticalSprint = false;
|
||||
player.setData(ModAttachments.PLAYER_VARIABLE, cap);
|
||||
cap.sync(player);
|
||||
|
|
Loading…
Add table
Reference in a new issue