优化NBT#ExplosionDamage
This commit is contained in:
parent
6323be3dc6
commit
a277fb444d
4 changed files with 5 additions and 7 deletions
|
@ -2,7 +2,6 @@ package com.atsuishio.superbwarfare.client.tooltip;
|
||||||
|
|
||||||
import com.atsuishio.superbwarfare.client.tooltip.component.GunImageComponent;
|
import com.atsuishio.superbwarfare.client.tooltip.component.GunImageComponent;
|
||||||
import com.atsuishio.superbwarfare.tools.GunsTool;
|
import com.atsuishio.superbwarfare.tools.GunsTool;
|
||||||
import com.atsuishio.superbwarfare.tools.ItemNBTTool;
|
|
||||||
import com.atsuishio.superbwarfare.tools.TooltipTool;
|
import com.atsuishio.superbwarfare.tools.TooltipTool;
|
||||||
import net.minecraft.ChatFormatting;
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
|
@ -18,7 +17,7 @@ public class ClientLauncherImageTooltip extends ClientGunImageTooltip {
|
||||||
@Override
|
@Override
|
||||||
protected Component getDamageComponent() {
|
protected Component getDamageComponent() {
|
||||||
double damage = GunsTool.getGunDoubleTag(stack, "Damage", 0) * TooltipTool.perkDamage(stack);
|
double damage = GunsTool.getGunDoubleTag(stack, "Damage", 0) * TooltipTool.perkDamage(stack);
|
||||||
double explosionDamage = ItemNBTTool.getDouble(stack, "ExplosionDamage", 0);
|
double explosionDamage = GunsTool.getGunDoubleTag(stack, "ExplosionDamage", 0);
|
||||||
|
|
||||||
return Component.translatable("des.superbwarfare.tips.damage").withStyle(ChatFormatting.GRAY)
|
return Component.translatable("des.superbwarfare.tips.damage").withStyle(ChatFormatting.GRAY)
|
||||||
.append(Component.literal("").withStyle(ChatFormatting.RESET))
|
.append(Component.literal("").withStyle(ChatFormatting.RESET))
|
||||||
|
|
|
@ -371,7 +371,7 @@ public class FireMessage {
|
||||||
Level level = player.level();
|
Level level = player.level();
|
||||||
if (!level.isClientSide()) {
|
if (!level.isClientSide()) {
|
||||||
GunGrenadeEntity gunGrenadeEntity = new GunGrenadeEntity(player, level,
|
GunGrenadeEntity gunGrenadeEntity = new GunGrenadeEntity(player, level,
|
||||||
(float) GunsTool.getGunDoubleTag(stack, "Damage", 0), (float) stack.getOrCreateTag().getDouble("ExplosionDamage"), (float) stack.getOrCreateTag().getDouble("ExplosionRadius"));
|
(float) GunsTool.getGunDoubleTag(stack, "Damage", 0), (float) GunsTool.getGunDoubleTag(stack, "ExplosionDamage", 0), (float) stack.getOrCreateTag().getDouble("ExplosionRadius"));
|
||||||
|
|
||||||
var dmgPerk = PerkHelper.getPerkByType(stack, Perk.Type.DAMAGE);
|
var dmgPerk = PerkHelper.getPerkByType(stack, Perk.Type.DAMAGE);
|
||||||
if (dmgPerk == ModPerks.MONSTER_HUNTER.get()) {
|
if (dmgPerk == ModPerks.MONSTER_HUNTER.get()) {
|
||||||
|
@ -422,7 +422,7 @@ public class FireMessage {
|
||||||
|
|
||||||
if (!level.isClientSide()) {
|
if (!level.isClientSide()) {
|
||||||
RpgRocketEntity rocketEntity = new RpgRocketEntity(player, level,
|
RpgRocketEntity rocketEntity = new RpgRocketEntity(player, level,
|
||||||
(float) GunsTool.getGunDoubleTag(stack, "Damage", 0), (float) tag.getDouble("ExplosionDamage"), (float) tag.getDouble("ExplosionRadius"));
|
(float) GunsTool.getGunDoubleTag(stack, "Damage", 0), (float) GunsTool.getGunDoubleTag(stack, "ExplosionDamage", 0), (float) tag.getDouble("ExplosionRadius"));
|
||||||
|
|
||||||
var dmgPerk = PerkHelper.getPerkByType(stack, Perk.Type.DAMAGE);
|
var dmgPerk = PerkHelper.getPerkByType(stack, Perk.Type.DAMAGE);
|
||||||
if (dmgPerk == ModPerks.MONSTER_HUNTER.get()) {
|
if (dmgPerk == ModPerks.MONSTER_HUNTER.get()) {
|
||||||
|
@ -486,7 +486,7 @@ public class FireMessage {
|
||||||
|
|
||||||
if (!level.isClientSide()) {
|
if (!level.isClientSide()) {
|
||||||
JavelinMissileEntity missileEntity = new JavelinMissileEntity(player, level,
|
JavelinMissileEntity missileEntity = new JavelinMissileEntity(player, level,
|
||||||
(float) GunsTool.getGunDoubleTag(stack, "Damage", 0), (float) tag.getDouble("ExplosionDamage"), (float) tag.getDouble("ExplosionRadius"));
|
(float) GunsTool.getGunDoubleTag(stack, "Damage", 0), (float) GunsTool.getGunDoubleTag(stack, "ExplosionDamage", 0), (float) tag.getDouble("ExplosionRadius"));
|
||||||
|
|
||||||
var dmgPerk = PerkHelper.getPerkByType(stack, Perk.Type.DAMAGE);
|
var dmgPerk = PerkHelper.getPerkByType(stack, Perk.Type.DAMAGE);
|
||||||
if (dmgPerk == ModPerks.MONSTER_HUNTER.get()) {
|
if (dmgPerk == ModPerks.MONSTER_HUNTER.get()) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class GunsTool {
|
||||||
// TODO 临时使用,移植完毕后删除
|
// TODO 临时使用,移植完毕后删除
|
||||||
private static final Set<String> STRING_SET = Set.of("EmptyReloadTime", "FireMode", "Weight", "SoundRadius", "BurstSize", "ProjectileAmount",
|
private static final Set<String> STRING_SET = Set.of("EmptyReloadTime", "FireMode", "Weight", "SoundRadius", "BurstSize", "ProjectileAmount",
|
||||||
"Spread", "NormalReloadTime", "Headshot", "Semi", "Burst", "Auto", "RecoilX", "RecoilY", "Velocity", "Damage", "BypassesArmor",
|
"Spread", "NormalReloadTime", "Headshot", "Semi", "Burst", "Auto", "RecoilX", "RecoilY", "Velocity", "Damage", "BypassesArmor",
|
||||||
"RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom");
|
"RPM", "Magazine", "MinZoom", "MaxZoom", "CustomZoom", "ExplosionDamage");
|
||||||
|
|
||||||
public static void initGun(Level level, ItemStack stack, String location) {
|
public static void initGun(Level level, ItemStack stack, String location) {
|
||||||
if (level.getServer() == null) return;
|
if (level.getServer() == null) return;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"CustomZoom": 1.75,
|
"CustomZoom": 1.75,
|
||||||
"Spread": 5,
|
"Spread": 5,
|
||||||
"zoomSpread": 5,
|
|
||||||
"Magazine": 1,
|
"Magazine": 1,
|
||||||
"Weight": 10,
|
"Weight": 10,
|
||||||
"EmptyReloadTime": 78,
|
"EmptyReloadTime": 78,
|
||||||
|
|
Loading…
Add table
Reference in a new issue