Skip to content

Commit

Permalink
chore: cleaned up some comments, also bump to neo 20.6.100-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Jun 3, 2024
1 parent bdc1db5 commit 8da32df
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 83 deletions.
76 changes: 0 additions & 76 deletions common/src/main/java/dev/ftb/mods/ftblibrary/ui/GuiHelper.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
package dev.ftb.mods.ftblibrary.ui;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.platform.Lighting;
import com.mojang.blaze3d.platform.Window;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.*;
import dev.ftb.mods.ftblibrary.icon.Color4I;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.util.Mth;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -184,74 +176,6 @@ public static void drawItem(GuiGraphics graphics, ItemStack stack, int hash, boo
graphics.renderItemDecorations(mc.font, stack, 0, 0, text);
}
graphics.pose().popPose();

// var itemRenderer = mc.getItemRenderer();
// var bakedModel = itemRenderer.getModel(stack, null, mc.player, hash);
//
// Minecraft.getInstance().getTextureManager().getTexture(InventoryMenu.BLOCK_ATLAS).setFilter(false, false);
// RenderSystem.setShaderTexture(0, InventoryMenu.BLOCK_ATLAS);
// RenderSystem.enableBlend();
// RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
// RenderSystem.setShaderColor(1F, 1F, 1F, 1F);
// PoseStack modelViewStack = RenderSystem.getModelViewStack();
// modelViewStack.pushPose();
// modelViewStack.mulPoseMatrix(graphics.pose().last().pose());
// // modelViewStack.translate(x, y, 100.0D + this.blitOffset);
// modelViewStack.scale(1F, -1F, 1F);
// modelViewStack.scale(16F, 16F, 16F);
// RenderSystem.applyModelViewMatrix();
// MultiBufferSource.BufferSource bufferSource = Minecraft.getInstance().renderBuffers().bufferSource();
// var flatLight = !bakedModel.usesBlockLight();
//
// if (flatLight) {
// Lighting.setupForFlatItems();
// }
//
// itemRenderer.render(stack, ItemDisplayContext.GUI, false, new PoseStack(), bufferSource, 0xF000F0, OverlayTexture.NO_OVERLAY, bakedModel);
// bufferSource.endBatch();
// RenderSystem.enableDepthTest();
//
// if (flatLight) {
// Lighting.setupFor3DItems();
// }
//
// modelViewStack.popPose();
// RenderSystem.applyModelViewMatrix();
//
// if (renderOverlay) {
// var t = Tesselator.getInstance();
// var font = mc.font;
//
// if (stack.getCount() != 1 || text != null) {
// var s = text == null ? String.valueOf(stack.getCount()) : text;
// graphics.pose().pushPose();
// graphics.pose().translate(9D - font.width(s), 1D, 20D);
// font.drawInBatch(s, 0F, 0F, 0xFFFFFF, true, graphics.pose().last().pose(), bufferSource, Font.DisplayMode.NORMAL, 0, 0xF000F0);
// bufferSource.endBatch();
// graphics.pose().popPose();
// }
//
// if (stack.isBarVisible()) {
// RenderSystem.disableDepthTest();
// RenderSystem.disableBlend();
// var barWidth = stack.getBarWidth();
// var barColor = stack.getBarColor();
// draw(graphics, t, -6, 5, 13, 2, 0, 0, 0, 255);
// draw(graphics, t, -6, 5, barWidth, 1, barColor >> 16 & 255, barColor >> 8 & 255, barColor & 255, 255);
// RenderSystem.enableBlend();
// RenderSystem.enableDepthTest();
// }
//
// var cooldown = mc.player == null ? 0F : mc.player.getCooldowns().getCooldownPercent(stack.getItem(), mc.getFrameTime());
//
// if (cooldown > 0F) {
// RenderSystem.disableDepthTest();
// RenderSystem.enableBlend();
// RenderSystem.defaultBlendFunc();
// draw(graphics, t, -8, Mth.floor(16F * (1F - cooldown)) - 8, 16, Mth.ceil(16F * cooldown), 255, 255, 255, 127);
// RenderSystem.enableDepthTest();
// }
// }
}

private static void draw(GuiGraphics graphics, Tesselator t, int x, int y, int width, int height, int red, int green, int blue, int alpha) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,10 @@ protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY) {
graphics.renderTooltip(theme.getFont(), lines, DefaultTooltipPositioner.INSTANCE, mouseX, Math.max(mouseY, 18));
graphics.setColor(1f, 1f, 1f, 1f);
graphics.pose().translate(0, 0, -600);
// tooltipList.render(graphics, mouseX, Math.max(mouseY, 18), wrappedGui.getScreen().getGuiScaledWidth(), wrappedGui.getScreen().getGuiScaledHeight(), theme.getFont());
}

tooltipList.reset();

// if (wrappedGui.getContextMenu().isEmpty()) {
// renderTooltip(graphics, mouseX, mouseY);
// }

graphics.pose().popPose();
}

Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ minecraft_version=1.20.6

# Deps
forge_version=49.0.31
# note: can't use a newer NF version until https://github.com/architectury/architectury-loom/pull/207 is merged
neoforge_version=20.6.72-beta
neoforge_version=20.6.100-beta
neoforge_loader_version=1
fabric_loader_version=0.15.10
fabric_api_version=0.99.0+1.20.6
Expand Down

0 comments on commit 8da32df

Please sign in to comment.