Начинающий
- Статус
- Оффлайн
- Регистрация
- 19 Янв 2024
- Сообщения
- 214
- Реакции
- 0
бля я думал пастеры хоть умеют поменять цвет кейбиндов и зарендерить иконкинемного кривые но кому не трудно исправит и немного сломал картинки кто захочет пофиксит
Пожалуйста, авторизуйтесь для просмотра ссылки.
potion:package wtf.resolute.ui.HUD.impl; import com.google.common.collect.Lists; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.platform.GlStateManager; import com.mojang.blaze3d.systems.RenderSystem; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.DisplayEffectsScreen; import net.minecraft.client.gui.IngameGui; import net.minecraft.client.renderer.texture.PotionSpriteUploader; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.potion.Effect; import net.optifine.reflect.Reflector; import wtf.resolute.evented.EventDisplay; import wtf.resolute.ui.DisplayElement.ElementRenderer; import wtf.resolute.manage.drag.Dragging; import wtf.resolute.utiled.render.ColorUtils; import wtf.resolute.utiled.render.DisplayUtils; import wtf.resolute.utiled.render.Scissor; import wtf.resolute.utiled.render.font.Fonts; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.experimental.FieldDefaults; import net.minecraft.client.resources.I18n; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.EffectUtils; import java.awt.*; import java.util.ArrayList; import java.util.Collection; import java.util.Comparator; import java.util.Iterator; @FieldDefaults(level = AccessLevel.PRIVATE) @RequiredArgsConstructor public class PotionRender implements HudElement { final Dragging dragging; float width; float height; @Override public void render(EventDisplay eventDisplay) { MatrixStack ms = eventDisplay.getMatrixStack(); float posX = dragging.getX(); float posY = dragging.getY(); float fontSize = 6.5f; float padding = 5; int color = ThemePiccer.color; int color2 = ThemePiccer.color2; DisplayUtils.drawShadow(posX, posY, width + 8, height, 8, new Color(16, 16, 16).getRGB()); DisplayUtils.drawRoundedRect(posX, posY, width + 8, height, 3, DisplayUtils.reAlphaInt(new Color(8, 8, 8).getRGB(), 210)); Scissor.push(); Scissor.setFromComponentCoordinates(posX, posY, width + 8, height); Fonts.sfbold.drawCenteredText(ms, "Potions", posX + (width + 8) / 2, posY + padding + 0.5f,-1, fontSize); posY += fontSize + padding * 2; float maxWidth = Fonts.sfbold.getWidth("Potions", fontSize) + padding * 2; float localHeight = fontSize + padding * 2; DisplayUtils.drawRectHorizontalW(posX + 0.5f, posY, width - 1 + 8, 2.5f, 3, ColorUtils.rgba(0, 0, 0, (int) (255 * 0.25f))); posY += 3f; for (EffectInstance ef : mc.player.getActivePotionEffects()) { int amp = ef.getAmplifier(); String ampStr = ""; if (amp >= 1 && amp <= 9) { ampStr = " " + I18n.format("enchantment.level." + (amp + 1)); } String nameText = I18n.format(ef.getEffectName()) + ampStr; float nameWidth = Fonts.sfMedium.getWidth(nameText, fontSize); String bindText = EffectUtils.getPotionDurationString(ef, 1); float bindWidth = Fonts.sfMedium.getWidth(bindText, fontSize); float localWidth = nameWidth + bindWidth + padding * 3; Fonts.sfMedium.drawText(ms, I18n.format(ef.getEffectName(), new Object[0]), posX + padding + 8, posY, ColorUtils.rgba(210, 210, 210, 255), fontSize); Fonts.sfMedium.drawText(ms, bindText, posX + width - padding - bindWidth + 8, posY, ColorUtils.rgba(210, 210, 210, 255), fontSize); Effect effect = ef.getPotion(); PotionSpriteUploader potionspriteuploader = mc.getPotionSpriteUploader(); TextureAtlasSprite textureatlassprite = potionspriteuploader.getSprite(effect); mc.getTextureManager().bindTexture(textureatlassprite.getAtlasTexture()); DisplayEffectsScreen.blit(ms, (int) (posX + padding), (int) posY - 1, 10, 8, 8, textureatlassprite); if (localWidth > maxWidth) { maxWidth = localWidth; } posY += (fontSize + padding); localHeight += (fontSize + padding); } Scissor.unset(); Scissor.pop(); width = Math.max(maxWidth, 80); height = localHeight + 2.5f; dragging.setWidth(width); dragging.setHeight(height); } }