diff --git a/build.gradle b/build.gradle index d38c837..6a04a5e 100644 --- a/build.gradle +++ b/build.gradle @@ -15,12 +15,12 @@ apply plugin: 'net.minecraftforge.gradle' group = "com.unascribed" archivesBaseName = "BlockRenderer" -version = "1.16.3-1.3.0" +version = "1.16.1-1.3.0" sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaVersion.VERSION_1_8 minecraft { - mappings channel: 'snapshot', version: '20200723-1.16.1' + mappings channel: 'snapshot', version: '20200820-1.16.1' // accessTransformer = file('src/main/resources/META-INF/block_renderer_at.cfg') @@ -54,7 +54,7 @@ minecraft { } dependencies { - minecraft 'net.minecraftforge:forge:1.16.2-33.0.19' + minecraft 'net.minecraftforge:forge:1.16.1-32.0.108' // Javax Annotations (N.B. ForgeGradle currently provides this) implementation 'com.google.code.findbugs:jsr305:3+' diff --git a/src/main/java/com/unascribed/blockrenderer/render/impl/ItemStackRenderer.java b/src/main/java/com/unascribed/blockrenderer/render/impl/ItemStackRenderer.java index 4dad92a..5971829 100644 --- a/src/main/java/com/unascribed/blockrenderer/render/impl/ItemStackRenderer.java +++ b/src/main/java/com/unascribed/blockrenderer/render/impl/ItemStackRenderer.java @@ -1,6 +1,5 @@ package com.unascribed.blockrenderer.render.impl; -import com.google.common.collect.Lists; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.unascribed.blockrenderer.lib.TileRenderer; @@ -12,10 +11,10 @@ import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; -import net.minecraft.util.IReorderingProcessor; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Util; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.ITextProperties; import net.minecraftforge.registries.ForgeRegistries; import org.lwjgl.opengl.GL11; @@ -79,12 +78,12 @@ public void render(ItemStack value) { renderer.beginTile(); RenderSystem.pushMatrix(); - /* Clear Framebuffer */ - RenderSystem.clearColor(0, 0, 0, 0); - RenderSystem.clear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT, Minecraft.IS_RUNNING_ON_MAC); + /* Clear Framebuffer */ + RenderSystem.clearColor(0, 0, 0, 0); + RenderSystem.clear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT, Minecraft.IS_RUNNING_ON_MAC); - /* Render */ - itemRenderer.renderItemAndEffectIntoGUI(value, 0, 0); + /* Render */ + itemRenderer.renderItemAndEffectIntoGUI(value, 0, 0); RenderSystem.popMatrix(); } while (renderer.endTile()); @@ -133,8 +132,8 @@ public void renderTooltip(MatrixStack stack, ItemStack value, int displayWidth, if (font == null) font = client.fontRenderer; int width = 0; - for (IReorderingProcessor s : Lists.transform(list, ITextComponent::func_241878_f)) { - int j = font.func_243245_a(s); + for (ITextProperties s : list) { + int j = font.func_238414_a_(s); if (j > width) width = j; } // End copied code. diff --git a/src/main/java/com/unascribed/blockrenderer/screens/widgets/UpdateableSliderWidget.java b/src/main/java/com/unascribed/blockrenderer/screens/widgets/UpdateableSliderWidget.java index 19eff62..1486e90 100644 --- a/src/main/java/com/unascribed/blockrenderer/screens/widgets/UpdateableSliderWidget.java +++ b/src/main/java/com/unascribed/blockrenderer/screens/widgets/UpdateableSliderWidget.java @@ -14,11 +14,13 @@ public UpdateableSliderWidget(GameSettings settings, int x, int y, int width, in } public void update(double desired) { - /* mcp: value */ field_230683_b_ = option.normalizeValue(desired); + sliderValue = option.normalizeValue(desired); - /* mcp: applyValue */ func_230972_a_(); + /* mcp: applyValue */ + func_230972_a_(); - /* mcp: updateMessage */ func_230979_b_(); + /* mcp: updateMessage */ + func_230979_b_(); } } diff --git a/src/main/java/com/unascribed/blockrenderer/screens/widgets/options/ExtendedSliderPercentageOption.java b/src/main/java/com/unascribed/blockrenderer/screens/widgets/options/ExtendedSliderPercentageOption.java index cd556ea..71c7b23 100644 --- a/src/main/java/com/unascribed/blockrenderer/screens/widgets/options/ExtendedSliderPercentageOption.java +++ b/src/main/java/com/unascribed/blockrenderer/screens/widgets/options/ExtendedSliderPercentageOption.java @@ -15,6 +15,6 @@ public ExtendedSliderPercentageOption(String translationKey, double minValueIn, } public ITextComponent getDisplayPrefix() { - return super.func_243220_a(); + return super.func_238238_a_(); } } diff --git a/src/main/java/com/unascribed/blockrenderer/utils/Rendering.java b/src/main/java/com/unascribed/blockrenderer/utils/Rendering.java index b0c0cda..95978b2 100644 --- a/src/main/java/com/unascribed/blockrenderer/utils/Rendering.java +++ b/src/main/java/com/unascribed/blockrenderer/utils/Rendering.java @@ -21,73 +21,73 @@ * Static versions of AbstractGui and Screen utility methods. */ public interface Rendering { - class DummyScreen extends Screen { - - protected DummyScreen() { - super(new StringTextComponent(NAME + " Dummy Screen")); - } - - @Override - public List getTooltipFromItem(ItemStack p_231151_1_) { - return super.getTooltipFromItem(p_231151_1_); - } - } - - DummyScreen GUI = new DummyScreen(); - - - static void drawCenteredString(MatrixStack stack, FontRenderer fontRendererIn, String text, int x, int y, int color) { - AbstractGui.drawCenteredString(stack, fontRendererIn, text, x, y, color); - } - - static void drawRect(MatrixStack stack, int left, int top, int right, int bottom, int color) { - AbstractGui.fill(stack, left, top, right, bottom, color); - } - - static void drawHoveringText(MatrixStack stack, List textLines, int x, int y) { - GUI./* mcp: renderTooltip */func_243308_b(stack, textLines, x, y); - } - - static void drawHoveringText(Screen owner, MatrixStack stack, List textLines, int x, int y) { - GUI.init(Minecraft.getInstance(), owner.width, owner.height); - GUI./* mcp: renderTooltip */func_243308_b(stack, textLines, x, y); - } - - static void drawBackground(int width, int height) { - GUI.init(Minecraft.getInstance(), width, height); - GUI.renderDirtBackground(0); - } - - static void setupOverlayRendering() { - Minecraft client = Minecraft.getInstance(); - MainWindow window = client.getMainWindow(); - double scaleFactor = window.getGuiScaleFactor(); - - RenderSystem.clear(GL11.GL_DEPTH_BUFFER_BIT, Minecraft.IS_RUNNING_ON_MAC); - RenderSystem.matrixMode(GL11.GL_PROJECTION); - RenderSystem.loadIdentity(); - RenderSystem.ortho(0.0D, window.getFramebufferWidth() / scaleFactor, window.getFramebufferHeight() / scaleFactor, 0.0D, 1000.0D, 3000.0D); - RenderSystem.matrixMode(GL11.GL_MODELVIEW); - RenderSystem.loadIdentity(); - RenderSystem.translatef(0.0F, 0.0F, -2000.0F); - } - - static void setupOverlayRendering(TileRenderer renderer) { - RenderSystem.clear(GL11.GL_DEPTH_BUFFER_BIT, Minecraft.IS_RUNNING_ON_MAC); - - /* Projection */ - RenderSystem.matrixMode(GL11.GL_PROJECTION); - RenderSystem.loadIdentity(); - - /* We flip the bottom and top parameters here so we don't need to process the image just fix a culling issue */ - /* This results in a minor speed up / lower memory usage */ - renderer.ortho(0.0D, renderer.imageWidth, 0.0D, renderer.imageHeight, 1000.0D, 3000.0D); - - /* Model View */ - RenderSystem.matrixMode(GL11.GL_MODELVIEW); - RenderSystem.loadIdentity(); - RenderSystem.translatef(0.0F, 0.0F, -2000.0F); - } + class DummyScreen extends Screen { + + protected DummyScreen() { + super(new StringTextComponent(NAME + " Dummy Screen")); + } + + @Override + public List getTooltipFromItem(ItemStack p_231151_1_) { + return super.getTooltipFromItem(p_231151_1_); + } + } + + DummyScreen GUI = new DummyScreen(); + + + static void drawCenteredString(MatrixStack stack, FontRenderer fontRendererIn, String text, int x, int y, int color) { + GUI.drawCenteredString(stack, fontRendererIn, text, x, y, color); + } + + static void drawRect(MatrixStack stack, int left, int top, int right, int bottom, int color) { + AbstractGui.fill(stack, left, top, right, bottom, color); + } + + static void drawHoveringText(MatrixStack stack, List textLines, int x, int y) { + GUI.renderTooltip(stack, textLines, x, y); + } + + static void drawHoveringText(Screen owner, MatrixStack stack, List textLines, int x, int y) { + GUI.init(Minecraft.getInstance(), owner.width, owner.height); + GUI.renderTooltip(stack, textLines, x, y); + } + + static void drawBackground(int width, int height) { + GUI.init(Minecraft.getInstance(), width, height); + GUI.renderDirtBackground(0); + } + + static void setupOverlayRendering() { + Minecraft client = Minecraft.getInstance(); + MainWindow window = client.getMainWindow(); + double scaleFactor = window.getGuiScaleFactor(); + + RenderSystem.clear(GL11.GL_DEPTH_BUFFER_BIT, Minecraft.IS_RUNNING_ON_MAC); + RenderSystem.matrixMode(GL11.GL_PROJECTION); + RenderSystem.loadIdentity(); + RenderSystem.ortho(0.0D, window.getFramebufferWidth() / scaleFactor, window.getFramebufferHeight() / scaleFactor, 0.0D, 1000.0D, 3000.0D); + RenderSystem.matrixMode(GL11.GL_MODELVIEW); + RenderSystem.loadIdentity(); + RenderSystem.translatef(0.0F, 0.0F, -2000.0F); + } + + static void setupOverlayRendering(TileRenderer renderer) { + RenderSystem.clear(GL11.GL_DEPTH_BUFFER_BIT, Minecraft.IS_RUNNING_ON_MAC); + + /* Projection */ + RenderSystem.matrixMode(GL11.GL_PROJECTION); + RenderSystem.loadIdentity(); + + /* We flip the bottom and top parameters here so we don't need to process the image just fix a culling issue */ + /* This results in a minor speed up / lower memory usage */ + renderer.ortho(0.0D, renderer.imageWidth, 0.0D, renderer.imageHeight, 1000.0D, 3000.0D); + + /* Model View */ + RenderSystem.matrixMode(GL11.GL_MODELVIEW); + RenderSystem.loadIdentity(); + RenderSystem.translatef(0.0F, 0.0F, -2000.0F); + } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 75cd820..24589e3 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,26 +1,26 @@ -modLoader="javafml" -license="MIT License" -loaderVersion="[32,35)" -issueTrackerURL="https://github.com/AterAnimAvis/BlockRenderer/issues" +modLoader = "javafml" +license = "MIT License" +loaderVersion = "[32,33)" +issueTrackerURL = "https://github.com/AterAnimAvis/BlockRenderer/issues" [[mods]] -modId="block_renderer" -version="${file.jarVersion}" -displayName="BlockRenderer" -displayURL="https://unascribed.com" -logoFile="logo-blockrenderer.png" -credits="Una, xbony2, modmuss50, AterAnimAvis, Brian Paul (TR Library)" -authors="Una" -description="It renders blocks and items." +modId = "block_renderer" +version = "${file.jarVersion}" +displayName = "BlockRenderer" +displayURL = "https://unascribed.com" +logoFile = "logo-blockrenderer.png" +credits = "Una, xbony2, modmuss50, AterAnimAvis, Brian Paul (TR Library)" +authors = "Una" +description = "It renders blocks and items." [[dependencies.block_renderer]] - modId="forge" - mandatory=true - versionRange="[32,35)" - ordering="NONE" - side="BOTH" +modId = "forge" +mandatory = true +versionRange = "[32,33)" +ordering = "NONE" +side = "BOTH" [[dependencies.block_renderer]] - modId="minecraft" - mandatory=true - versionRange="[1.16,1.17)" - ordering="NONE" - side="BOTH" +modId = "minecraft" +mandatory = true +versionRange = "[1.16.1]" +ordering = "NONE" +side = "BOTH"