修复可换座载具非武器位数字键失效的问题
This commit is contained in:
parent
a33f5f21b3
commit
c0e95ed8fb
1 changed files with 6 additions and 2 deletions
|
@ -39,7 +39,7 @@ public class MinecraftMixin {
|
||||||
|
|
||||||
var index = -1;
|
var index = -1;
|
||||||
for (int i = 0; i < 9; ++i) {
|
for (int i = 0; i < 9; ++i) {
|
||||||
if (options.keyHotbarSlots[i].consumeClick()) {
|
if (options.keyHotbarSlots[i].isDown()) {
|
||||||
index = i;
|
index = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,12 @@ public class MinecraftMixin {
|
||||||
&& index < vehicle.getMaxPassengers()
|
&& index < vehicle.getMaxPassengers()
|
||||||
&& vehicle.getNthEntity(index) == null
|
&& vehicle.getNthEntity(index) == null
|
||||||
) {
|
) {
|
||||||
|
ci.cancel();
|
||||||
|
options.keyHotbarSlots[index].consumeClick();
|
||||||
|
|
||||||
ModUtils.PACKET_HANDLER.sendToServer(new ChangeVehicleSeatMessage(index));
|
ModUtils.PACKET_HANDLER.sendToServer(new ChangeVehicleSeatMessage(index));
|
||||||
vehicle.changeSeat(player, index);
|
vehicle.changeSeat(player, index);
|
||||||
ci.cancel();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +65,7 @@ public class MinecraftMixin {
|
||||||
|
|
||||||
if (vehicle instanceof WeaponVehicleEntity weaponVehicle && weaponVehicle.banHand(player)) {
|
if (vehicle instanceof WeaponVehicleEntity weaponVehicle && weaponVehicle.banHand(player)) {
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
|
options.keyHotbarSlots[index].consumeClick();
|
||||||
|
|
||||||
// 数字键 武器切换
|
// 数字键 武器切换
|
||||||
if (!Screen.hasShiftDown()
|
if (!Screen.hasShiftDown()
|
||||||
|
|
Loading…
Add table
Reference in a new issue