mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-26 23:13:15 +00:00
62 lines
3.4 KiB
Diff
62 lines
3.4 KiB
Diff
--- a/net/minecraft/client/gui/Gui.java
|
|
+++ b/net/minecraft/client/gui/Gui.java
|
|
@@ -428,6 +_,10 @@
|
|
|
|
for(MobEffectInstance mobeffectinstance : Ordering.natural().reverse().sortedCopy(collection)) {
|
|
MobEffect mobeffect = mobeffectinstance.m_19544_();
|
|
+ var renderer = net.minecraftforge.client.extensions.common.IClientMobEffectExtensions.of(mobeffectinstance);
|
|
+ if (!renderer.isVisibleInGui(mobeffectinstance)) continue;
|
|
+ // Rebind in case previous renderHUDEffect changed texture
|
|
+ RenderSystem.m_157456_(0, AbstractContainerScreen.f_97725_);
|
|
if (mobeffectinstance.m_19575_()) {
|
|
int i = this.f_92977_;
|
|
int j = 1;
|
|
@@ -456,6 +_,7 @@
|
|
}
|
|
}
|
|
|
|
+ if (renderer.renderGuiIcon(mobeffectinstance, this, p_93029_, i, j, 0, f)) continue;
|
|
TextureAtlasSprite textureatlassprite = mobeffecttexturemanager.m_118732_(mobeffect);
|
|
int i1 = j;
|
|
float f1 = f;
|
|
@@ -583,12 +_,13 @@
|
|
public void m_93069_(PoseStack p_93070_) {
|
|
this.f_92986_.m_91307_().m_6180_("selectedItemName");
|
|
if (this.f_92993_ > 0 && !this.f_92994_.m_41619_()) {
|
|
- MutableComponent mutablecomponent = Component.m_237119_().m_7220_(this.f_92994_.m_41786_()).m_130940_(this.f_92994_.m_41791_().f_43022_);
|
|
+ MutableComponent mutablecomponent = Component.m_237119_().m_7220_(this.f_92994_.m_41786_()).m_130938_(this.f_92994_.m_41791_().getStyleModifier());
|
|
if (this.f_92994_.m_41788_()) {
|
|
mutablecomponent.m_130940_(ChatFormatting.ITALIC);
|
|
}
|
|
|
|
- int i = this.m_93082_().m_92852_(mutablecomponent);
|
|
+ Component highlightTip = this.f_92994_.getHighlightTip(mutablecomponent);
|
|
+ int i = this.m_93082_().m_92852_(highlightTip);
|
|
int j = (this.f_92977_ - i) / 2;
|
|
int k = this.f_92978_ - 59;
|
|
if (!this.f_92986_.f_91072_.m_105205_()) {
|
|
@@ -602,7 +_,13 @@
|
|
|
|
if (l > 0) {
|
|
m_93172_(p_93070_, j - 2, k - 2, j + i + 2, k + 9 + 2, this.f_92986_.f_91066_.m_92143_(0));
|
|
- this.m_93082_().m_92763_(p_93070_, mutablecomponent, (float)j, (float)k, 16777215 + (l << 24));
|
|
+ Font font = net.minecraftforge.client.extensions.common.IClientItemExtensions.of(f_92994_).getFont(f_92994_, net.minecraftforge.client.extensions.common.IClientItemExtensions.FontContext.SELECTED_ITEM_NAME);
|
|
+ if (font == null) {
|
|
+ this.m_93082_().m_92763_(p_93070_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
|
|
+ } else {
|
|
+ j = (this.f_92977_ - font.m_92852_(highlightTip)) / 2;
|
|
+ font.m_92763_(p_93070_, highlightTip, (float)j, (float)k, 16777215 + (l << 24));
|
|
+ }
|
|
}
|
|
}
|
|
|
|
@@ -1054,7 +_,7 @@
|
|
ItemStack itemstack = this.f_92986_.f_91074_.m_150109_().m_36056_();
|
|
if (itemstack.m_41619_()) {
|
|
this.f_92993_ = 0;
|
|
- } else if (!this.f_92994_.m_41619_() && itemstack.m_150930_(this.f_92994_.m_41720_()) && itemstack.m_41786_().equals(this.f_92994_.m_41786_())) {
|
|
+ } else if (!this.f_92994_.m_41619_() && itemstack.m_41720_() == this.f_92994_.m_41720_() && (itemstack.m_41786_().equals(this.f_92994_.m_41786_()) && itemstack.getHighlightTip(itemstack.m_41786_()).equals(f_92994_.getHighlightTip(f_92994_.m_41786_())))) {
|
|
if (this.f_92993_ > 0) {
|
|
--this.f_92993_;
|
|
}
|