优化NBT#CanSwitchScope
This commit is contained in:
parent
49789548b8
commit
c442d25d1d
3 changed files with 3 additions and 5 deletions
|
@ -157,7 +157,7 @@ public class ClickHandler {
|
|||
|
||||
if (stack.is(ModTags.Items.GUN) && ClientEventHandler.zoom) {
|
||||
var tag = stack.getOrCreateTag();
|
||||
if (tag.getBoolean("CanSwitchScope")) {
|
||||
if (GunsTool.getGunBooleanTag(stack, "CanSwitchScope", false)) {
|
||||
ModUtils.PACKET_HANDLER.sendToServer(new SwitchScopeMessage(scroll));
|
||||
} else if (tag.getBoolean("CanAdjustZoomFov") || stack.is(ModItems.MINIGUN.get())) {
|
||||
ModUtils.PACKET_HANDLER.sendToServer(new AdjustZoomFovMessage(scroll));
|
||||
|
|
|
@ -265,7 +265,6 @@ public class Trachelium extends GunItem implements GeoItem, AnimatedItem {
|
|||
int stockType = GunsTool.getAttachmentType(stack, GunsTool.AttachmentType.STOCK);
|
||||
CompoundTag tags = stack.getOrCreateTag().getCompound("Attachments");
|
||||
|
||||
|
||||
if (stockType == 1) {
|
||||
tags.putInt("Stock", 2);
|
||||
}
|
||||
|
@ -292,8 +291,7 @@ public class Trachelium extends GunItem implements GeoItem, AnimatedItem {
|
|||
default -> 1;
|
||||
};
|
||||
|
||||
stack.getOrCreateTag().putBoolean("CanSwitchScope", scopeType == 2);
|
||||
|
||||
GunsTool.setGunBooleanTag(stack, "CanSwitchScope", scopeType == 2);
|
||||
GunsTool.setGunDoubleTag(stack, "CustomZoom", customZoom);
|
||||
}
|
||||
|
||||
|
|
|
@ -194,7 +194,7 @@ public class M4Item extends GunItem implements GeoItem, AnimatedItem {
|
|||
default -> GunsTool.getGunDoubleTag(stack, "CustomZoom", 0);
|
||||
};
|
||||
|
||||
stack.getOrCreateTag().putBoolean("CanSwitchScope", scopeType == 2);
|
||||
GunsTool.setGunBooleanTag(stack, "CanSwitchScope", scopeType == 2);
|
||||
stack.getOrCreateTag().putBoolean("CanAdjustZoomFov", scopeType == 3);
|
||||
GunsTool.setGunDoubleTag(stack, "CustomZoom", customZoom);
|
||||
stack.getOrCreateTag().putInt("customMag", customMag);
|
||||
|
|
Loading…
Add table
Reference in a new issue