修复射击bug
This commit is contained in:
parent
7fe770bf1b
commit
066c123252
1 changed files with 4 additions and 1 deletions
|
@ -340,7 +340,6 @@ public class LivingEventHandler {
|
||||||
player.getCapability(ModCapabilities.LASER_CAPABILITY).ifPresent(LaserCapability.ILaserCapability::stop);
|
player.getCapability(ModCapabilities.LASER_CAPABILITY).ifPresent(LaserCapability.ILaserCapability::stop);
|
||||||
|
|
||||||
if (player instanceof ServerPlayer serverPlayer) {
|
if (player instanceof ServerPlayer serverPlayer) {
|
||||||
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new DrawClientMessage(true));
|
|
||||||
if (newStack.getItem() != oldStack.getItem()
|
if (newStack.getItem() != oldStack.getItem()
|
||||||
|| newStack.getTag() == null || oldStack.getTag() == null
|
|| newStack.getTag() == null || oldStack.getTag() == null
|
||||||
|| (newStack.is(ModTags.Items.GUN) && !GunsTool.getGunData(newStack).hasUUID("UUID"))
|
|| (newStack.is(ModTags.Items.GUN) && !GunsTool.getGunData(newStack).hasUUID("UUID"))
|
||||||
|
@ -422,6 +421,10 @@ public class LivingEventHandler {
|
||||||
GunsTool.setPerkIntTag(newStack, "KillingTally", 0);
|
GunsTool.setPerkIntTag(newStack, "KillingTally", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player.level() instanceof ServerLevel) {
|
||||||
|
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new DrawClientMessage(true));
|
||||||
|
}
|
||||||
|
|
||||||
player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
|
||||||
capability.tacticalSprint = false;
|
capability.tacticalSprint = false;
|
||||||
capability.syncPlayerVariables(player);
|
capability.syncPlayerVariables(player);
|
||||||
|
|
Loading…
Add table
Reference in a new issue