重新添加弹匣为空左键直接换弹
This commit is contained in:
parent
ccc26f58df
commit
4db8d97bc6
2 changed files with 9 additions and 10 deletions
|
@ -206,19 +206,11 @@ public class ClientEventHandler {
|
|||
|
||||
if (-0.8 < velocity + 0.078 && velocity + 0.078 < 0.8) {
|
||||
if (data.getDouble("vy") < entity.getDeltaMovement().y() + 0.078) {
|
||||
data.putDouble("vy",
|
||||
((data.getDouble("vy") + 0.35 * Math.pow((velocity + 0.078) - data.getDouble("vy"), 2)) * (1 - 0.3 * data.getDouble("zoom_time"))));
|
||||
data.putDouble("vy",Mth.clamp(((data.getDouble("vy") + 0.35 * Math.pow((velocity + 0.078) - data.getDouble("vy"), 2)) * (1 - 0.8 * data.getDouble("zoom_time"))),-0.8,0.8));
|
||||
} else {
|
||||
data.putDouble("vy",
|
||||
((data.getDouble("vy") - 0.35 * Math.pow((velocity + 0.078) - data.getDouble("vy"), 2)) * (1 - 0.3 * data.getDouble("zoom_time"))));
|
||||
data.putDouble("vy",Mth.clamp(((data.getDouble("vy") - 0.35 * Math.pow((velocity + 0.078) - data.getDouble("vy"), 2)) * (1 - 0.8 * data.getDouble("zoom_time"))),-0.8,0.8));
|
||||
}
|
||||
}
|
||||
if (data.getDouble("vy") > 0.8) {
|
||||
data.putDouble("vy", 0.8);
|
||||
}
|
||||
if (data.getDouble("vy") < -0.8) {
|
||||
data.putDouble("vy", (-0.8));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.mcreator.target.network.message;
|
||||
|
||||
import net.mcreator.target.TargetMod;
|
||||
import net.mcreator.target.entity.*;
|
||||
import net.mcreator.target.event.GunEventHandler;
|
||||
import net.mcreator.target.init.*;
|
||||
|
@ -48,6 +49,8 @@ public class FireMessage {
|
|||
context.setPacketHandled(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void pressAction(Player player, int type) {
|
||||
Level world = player.level();
|
||||
|
||||
|
@ -80,6 +83,10 @@ public class FireMessage {
|
|||
|
||||
var tag = handItem.getOrCreateTag();
|
||||
|
||||
if (tag.getInt("ammo") == 0) {
|
||||
TargetMod.PACKET_HANDLER.sendToServer(new ReloadMessage(0));
|
||||
}
|
||||
|
||||
if (handItem.getItem() == TargetModItems.TASER.get()) {
|
||||
handleTaserFire(player);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue