优化NBT#StartCharge

This commit is contained in:
17146 2025-01-04 02:19:52 +08:00
parent 9447216b54
commit 8bc2942316
2 changed files with 3 additions and 4 deletions

View file

@ -821,9 +821,8 @@ public class GunEventHandler {
*/
private static void handleSentinelCharge(Player player) {
ItemStack stack = player.getMainHandItem();
CompoundTag tag = stack.getOrCreateTag();
// 启动换弹
if (tag.getBoolean("start_sentinel_charge")) {
if (GunsTool.getGunBooleanTag(stack, "StartCharge")) {
GunsTool.setGunIntTag(stack, "ChargeTime", 127);
GunsTool.setGunBooleanTag(stack, "Charging", true);
@ -832,7 +831,7 @@ public class GunEventHandler {
SoundTool.playLocalSound(serverPlayer, sound1p, 2f, 1f);
}
tag.putBoolean("start_sentinel_charge", false);
GunsTool.setGunBooleanTag(stack, "StartCharge", false);
}
if (GunsTool.getGunIntTag(stack, "ChargeTime", 0) > 0) {

View file

@ -108,7 +108,7 @@ public class FireModeMessage {
);
if (flag.get()) {
tag.putBoolean("start_sentinel_charge", true);
GunsTool.setGunBooleanTag(stack, "StartCharge", true);
}
}
}