修复无法调节自定义缩放倍率BUG,修复换弹动画BUG

This commit is contained in:
Atsuihsio 2024-10-21 05:26:40 +08:00
parent 0ee40fc10c
commit eecf61168a
3 changed files with 2 additions and 3 deletions

View file

@ -131,7 +131,7 @@ public class ClickHandler {
if (stack.is(ModTags.Items.GUN) && player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zoom) { if (stack.is(ModTags.Items.GUN) && player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zoom) {
var tag = stack.getOrCreateTag(); var tag = stack.getOrCreateTag();
if (tag.getDouble("min_zoom") != 0 && tag.getDouble("max_zoom") != 0) { if (tag.getBoolean("CanAdjustZoomFov")) {
ModUtils.PACKET_HANDLER.sendToServer(new AdjustZoomFovMessage(scroll)); ModUtils.PACKET_HANDLER.sendToServer(new AdjustZoomFovMessage(scroll));
} }
event.setCanceled(true); event.setCanceled(true);

View file

@ -90,7 +90,7 @@ public class AK12Item extends GunItem implements GeoItem, AnimatedItem {
} }
if (stack.getOrCreateTag().getBoolean("is_normal_reloading")) { if (stack.getOrCreateTag().getBoolean("is_normal_reloading")) {
if (stack.getOrCreateTag().getInt("magazine_type") == 2) { if (GunsTool.getAttachmentType(stack, GunsTool.AttachmentType.MAGAZINE) == 2) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.ak12.reload_normal_drum")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.ak12.reload_normal_drum"));
} else { } else {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.ak12.reload_normal")); return event.setAndContinue(RawAnimation.begin().thenPlay("animation.ak12.reload_normal"));

View file

@ -39,7 +39,6 @@ public class AdjustZoomFovMessage {
} }
var tag = stack.getOrCreateTag(); var tag = stack.getOrCreateTag();
if (!tag.getBoolean("CanAdjustZoomFov")) return;
double min_zoom = tag.getDouble("MinZoom") - 1.25; double min_zoom = tag.getDouble("MinZoom") - 1.25;
double max_zoom = tag.getDouble("MaxZoom") - 1.25; double max_zoom = tag.getDouble("MaxZoom") - 1.25;