优化NBT#CustomSoundRadius
This commit is contained in:
parent
e7971c812f
commit
d35bcb3092
2 changed files with 2 additions and 2 deletions
|
@ -129,7 +129,7 @@ public class GunEventHandler {
|
|||
player.playSound(ModSounds.HENG.get(), 4f, 1f);
|
||||
}
|
||||
|
||||
float soundRadius = (float) (stack.getOrCreateTag().getDouble("SoundRadius") * stack.getOrCreateTag().getDouble("CustomSoundRadius"));
|
||||
float soundRadius = (float) (GunsTool.getGunDoubleTag(stack, "SoundRadius") * GunsTool.getGunDoubleTag(stack, "CustomSoundRadius", 1));
|
||||
|
||||
int barrelType = GunsTool.getAttachmentType(stack, GunsTool.AttachmentType.BARREL);
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ public abstract class GunItem extends Item {
|
|||
double soundRadius = tag.getInt("Barrel") == 2 ? 0.6 : 1;
|
||||
|
||||
GunsTool.setGunDoubleTag(stack, "CustomWeight", scopeWeight + barrelWeight + magazineWeight + stockWeight + gripWeight);
|
||||
stack.getOrCreateTag().putDouble("CustomSoundRadius", soundRadius);
|
||||
GunsTool.setGunDoubleTag(stack, "CustomSoundRadius", soundRadius);
|
||||
}
|
||||
|
||||
public boolean canApplyPerk(Perk perk) {
|
||||
|
|
Loading…
Add table
Reference in a new issue