修改显示bug
This commit is contained in:
parent
1e98444321
commit
abb42ed4ca
2 changed files with 3 additions and 4 deletions
|
@ -41,7 +41,7 @@ public class KillMessageOverlay {
|
||||||
private static final ResourceLocation SHOCK = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/shock.png");
|
private static final ResourceLocation SHOCK = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/shock.png");
|
||||||
private static final ResourceLocation BLOOD_CRYSTAL = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/blood_crystal.png");
|
private static final ResourceLocation BLOOD_CRYSTAL = new ResourceLocation(ModUtils.MODID, "textures/screens/damage_types/blood_crystal.png");
|
||||||
|
|
||||||
private static final ResourceLocation WORLD_PEACE_STAFF = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/registerCompatPerks/world_peace_staff.png");
|
private static final ResourceLocation WORLD_PEACE_STAFF = new ResourceLocation(ModUtils.MODID, "textures/gun_icon/compat/world_peace_staff.png");
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.NORMAL)
|
@SubscribeEvent(priority = EventPriority.NORMAL)
|
||||||
public static void eventHandler(RenderGuiEvent.Pre event) {
|
public static void eventHandler(RenderGuiEvent.Pre event) {
|
||||||
|
|
|
@ -80,15 +80,14 @@ public class TooltipTool {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addBypassTips(List<Component> tooltip, ItemStack stack) {
|
private static void addBypassTips(List<Component> tooltip, ItemStack stack) {
|
||||||
|
|
||||||
double perkbypassArmorRate = 0;
|
double perkbypassArmorRate = 0;
|
||||||
var perk = PerkHelper.getPerkByType(stack, Perk.Type.AMMO);
|
var perk = PerkHelper.getPerkByType(stack, Perk.Type.AMMO);
|
||||||
|
|
||||||
if (perk instanceof AmmoPerk ammoPerk) {
|
if (perk instanceof AmmoPerk ammoPerk) {
|
||||||
int level = PerkHelper.getItemPerkLevel(perk, stack);
|
int level = PerkHelper.getItemPerkLevel(perk, stack);
|
||||||
perkbypassArmorRate = ammoPerk.bypassArmorRate + (perk == ModPerks.AP_BULLET.get()? 0.05f * (level - 1) : 0);
|
perkbypassArmorRate = ammoPerk.bypassArmorRate + (perk == ModPerks.AP_BULLET.get() ? 0.05f * (level - 1) : 0);
|
||||||
}
|
}
|
||||||
double byPassRate = ItemNBTTool.getDouble(stack, "BypassesArmor", 0) + perkbypassArmorRate;
|
double byPassRate = Math.max(ItemNBTTool.getDouble(stack, "BypassesArmor", 0) + perkbypassArmorRate, 0);
|
||||||
|
|
||||||
tooltip.add(Component.translatable("des.superbwarfare.tips.bypass").withStyle(ChatFormatting.GRAY)
|
tooltip.add(Component.translatable("des.superbwarfare.tips.bypass").withStyle(ChatFormatting.GRAY)
|
||||||
.append(Component.literal("").withStyle(ChatFormatting.RESET))
|
.append(Component.literal("").withStyle(ChatFormatting.RESET))
|
||||||
|
|
Loading…
Add table
Reference in a new issue