优化NBT#StartCharge
This commit is contained in:
parent
9447216b54
commit
8bc2942316
2 changed files with 3 additions and 4 deletions
|
@ -821,9 +821,8 @@ public class GunEventHandler {
|
||||||
*/
|
*/
|
||||||
private static void handleSentinelCharge(Player player) {
|
private static void handleSentinelCharge(Player player) {
|
||||||
ItemStack stack = player.getMainHandItem();
|
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.setGunIntTag(stack, "ChargeTime", 127);
|
||||||
GunsTool.setGunBooleanTag(stack, "Charging", true);
|
GunsTool.setGunBooleanTag(stack, "Charging", true);
|
||||||
|
|
||||||
|
@ -832,7 +831,7 @@ public class GunEventHandler {
|
||||||
SoundTool.playLocalSound(serverPlayer, sound1p, 2f, 1f);
|
SoundTool.playLocalSound(serverPlayer, sound1p, 2f, 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
tag.putBoolean("start_sentinel_charge", false);
|
GunsTool.setGunBooleanTag(stack, "StartCharge", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GunsTool.getGunIntTag(stack, "ChargeTime", 0) > 0) {
|
if (GunsTool.getGunIntTag(stack, "ChargeTime", 0) > 0) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class FireModeMessage {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (flag.get()) {
|
if (flag.get()) {
|
||||||
tag.putBoolean("start_sentinel_charge", true);
|
GunsTool.setGunBooleanTag(stack, "StartCharge", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue