不再在武器槽位和按键相同时切换武器
This commit is contained in:
parent
15cd3ac6a4
commit
295a2c3ca0
1 changed files with 5 additions and 2 deletions
|
@ -58,12 +58,15 @@ public class MinecraftMixin {
|
|||
return;
|
||||
}
|
||||
|
||||
var seatIndex = vehicle.getSeatIndex(player);
|
||||
|
||||
// 数字键 武器切换
|
||||
if (vehicle instanceof WeaponVehicleEntity weaponVehicle
|
||||
&& !Screen.hasShiftDown()
|
||||
&& weaponVehicle.hasWeapon(vehicle.getSeatIndex(player))
|
||||
&& weaponVehicle.hasWeapon(seatIndex)
|
||||
&& weaponVehicle.getWeaponType(seatIndex) != index
|
||||
) {
|
||||
ModUtils.PACKET_HANDLER.sendToServer(new SwitchVehicleWeaponMessage(vehicle.getSeatIndex(player), index, false));
|
||||
ModUtils.PACKET_HANDLER.sendToServer(new SwitchVehicleWeaponMessage(seatIndex, index, false));
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue