Tick attackStrengthTicker and item cooldowns

This commit is contained in:
fullwall 2024-06-07 00:36:27 +08:00
parent 613770bd4e
commit 8f3a396198
15 changed files with 30 additions and 8 deletions

View File

@ -297,6 +297,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
}
}
aF++;
df().a();
cJ();
}

View File

@ -361,6 +361,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
}
}
aE++;
di().a();
cL();
}

View File

@ -372,6 +372,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
}
}
aE++;
getCooldownTracker().a();
cT();
}

View File

@ -354,6 +354,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
}
}
aH++;
getCooldownTracker().a();
dh();
}

View File

@ -360,6 +360,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
}
}
aD++;
getCooldownTracker().a();
if (!npc.hasTrait(EntityPoseTrait.class) || npc.getTraitNullable(EntityPoseTrait.class).getPose() == null) {
dB();
}

View File

@ -406,6 +406,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
}
}
aB++;
getCooldownTracker().a();
if (!npc.hasTrait(EntityPoseTrait.class) || npc.getTraitNullable(EntityPoseTrait.class).getPose() == null) {
dX();
}

View File

@ -371,6 +371,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
}
}
at++;
getCooldownTracker().a();
if (!npc.hasTrait(EntityPoseTrait.class) || npc.getTraitNullable(EntityPoseTrait.class).getPose() == null) {
eu();
}

View File

@ -163,6 +163,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
entity.playerTouch(this);
}
}
++attackStrengthTicker;
getCooldowns().tick();
if (!npc.hasTrait(EntityPoseTrait.class) || npc.getTraitNullable(EntityPoseTrait.class).getPose() == null) {
updatePlayerPose();
}

View File

@ -382,8 +382,8 @@ public class NMSImpl implements NMSBridge {
public void attack(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity btarget) {
LivingEntity handle = getHandle(attacker);
LivingEntity target = getHandle(btarget);
if (handle instanceof ServerPlayer) {
((ServerPlayer) handle).attack(target);
if (handle instanceof net.minecraft.world.entity.player.Player) {
((net.minecraft.world.entity.player.Player) handle).attack(target);
PlayerAnimation.ARM_SWING.play((Player) handle.getBukkitEntity());
return;
}

View File

@ -164,6 +164,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
entity.playerTouch(this);
}
}
++attackStrengthTicker;
getCooldowns().tick();
if (!npc.hasTrait(EntityPoseTrait.class) || npc.getTraitNullable(EntityPoseTrait.class).getPose() == null) {
updatePlayerPose();
}

View File

@ -386,8 +386,8 @@ public class NMSImpl implements NMSBridge {
public void attack(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity btarget) {
LivingEntity source = getHandle(attacker);
LivingEntity target = getHandle(btarget);
if (source instanceof ServerPlayer) {
((ServerPlayer) source).attack(target);
if (source instanceof net.minecraft.world.entity.player.Player) {
((net.minecraft.world.entity.player.Player) source).attack(target);
PlayerAnimation.ARM_SWING.play((Player) source.getBukkitEntity());
return;
}

View File

@ -157,6 +157,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
entity.playerTouch(this);
}
}
++attackStrengthTicker;
getCooldowns().tick();
if (!npc.hasTrait(EntityPoseTrait.class) || npc.getTraitNullable(EntityPoseTrait.class).getPose() == null) {
updatePlayerPose();
}

View File

@ -425,8 +425,8 @@ public class NMSImpl implements NMSBridge {
public void attack(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity btarget) {
LivingEntity source = getHandle(attacker);
LivingEntity target = getHandle(btarget);
if (source instanceof ServerPlayer) {
((ServerPlayer) source).attack(target);
if (source instanceof net.minecraft.world.entity.player.Player) {
((net.minecraft.world.entity.player.Player) source).attack(target);
PlayerAnimation.ARM_SWING.play((Player) source.getBukkitEntity());
return;
}

View File

@ -159,6 +159,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
entity.playerTouch(this);
}
}
++attackStrengthTicker;
getCooldowns().tick();
if (!npc.hasTrait(EntityPoseTrait.class) || npc.getTraitNullable(EntityPoseTrait.class).getPose() == null) {
updatePlayerPose();
}

View File

@ -416,8 +416,8 @@ public class NMSImpl implements NMSBridge {
public void attack(org.bukkit.entity.LivingEntity attacker, org.bukkit.entity.LivingEntity btarget) {
LivingEntity source = getHandle(attacker);
LivingEntity target = getHandle(btarget);
if (source instanceof ServerPlayer) {
((ServerPlayer) source).attack(target);
if (source instanceof net.minecraft.world.entity.player.Player) {
((net.minecraft.world.entity.player.Player) source).attack(target);
PlayerAnimation.ARM_SWING.play((Player) source.getBukkitEntity());
return;
}