last???? fixes

This commit is contained in:
Ell 2021-12-02 23:02:58 +01:00
parent ae5128971c
commit 20a69c7ccc
8 changed files with 33 additions and 14 deletions

View file

@ -76,6 +76,12 @@ minecraft {
} }
} }
} }
all {
lazyToken('minecraft_classpath') {
configurations.embed.copyRecursive().resolve().collect { it.absolutePath }.join(File.pathSeparator)
}
}
} }
} }

View file

@ -1,7 +1,6 @@
package de.ellpeck.prettypipes; package de.ellpeck.prettypipes;
import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
@ -14,6 +13,6 @@ public final class PrettyPipes {
public PrettyPipes() { public PrettyPipes() {
var bus = FMLJavaModLoadingContext.get().getModEventBus(); var bus = FMLJavaModLoadingContext.get().getModEventBus();
bus.addListener(Registry::setup); bus.addListener(Registry::setup);
DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> () -> bus.addListener(Registry.Client::setup)); DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> bus.addListener(Registry.Client::setup));
} }
} }

View file

@ -46,10 +46,7 @@ public class ItemTerminalWidget extends AbstractWidget {
renderer.renderGuiItem(this.stack, this.x, this.y); renderer.renderGuiItem(this.stack, this.x, this.y);
var amount = !this.craftable ? this.stack.getCount() : 0; var amount = !this.craftable ? this.stack.getCount() : 0;
var amountStrg = this.stack.getCount() >= 1000 ? amount / 1000 + "k" : String.valueOf(amount); var amountStrg = this.stack.getCount() >= 1000 ? amount / 1000 + "k" : String.valueOf(amount);
matrix.pushPose(); renderer.renderGuiItemDecorations(mc.font, this.stack, this.x, this.y, amountStrg);
matrix.scale(0.8F, 0.8F, 1);
renderer.renderGuiItemDecorations(mc.font, this.stack, (int) (this.x / 0.8F) + 4, (int) (this.y / 0.8F) + 4, amountStrg);
matrix.popPose();
renderer.blitOffset = 0; renderer.blitOffset = 0;
this.setBlitOffset(0); this.setBlitOffset(0);

View file

@ -1,5 +1,6 @@
package de.ellpeck.prettypipes.pipe.containers; package de.ellpeck.prettypipes.pipe.containers;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import de.ellpeck.prettypipes.PrettyPipes; import de.ellpeck.prettypipes.PrettyPipes;
import de.ellpeck.prettypipes.Registry; import de.ellpeck.prettypipes.Registry;
@ -8,6 +9,7 @@ import de.ellpeck.prettypipes.packets.PacketButton;
import de.ellpeck.prettypipes.packets.PacketHandler; import de.ellpeck.prettypipes.packets.PacketHandler;
import net.minecraft.client.gui.components.AbstractWidget; import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.resources.sounds.SimpleSoundInstance; import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -76,7 +78,8 @@ public abstract class AbstractPipeGui<T extends AbstractPipeContainer<?>> extend
@Override @Override
protected void renderBg(PoseStack matrix, float partialTicks, int mouseX, int mouseY) { protected void renderBg(PoseStack matrix, float partialTicks, int mouseX, int mouseY) {
this.getMinecraft().getTextureManager().bindForSetup(TEXTURE); RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, TEXTURE);
this.blit(matrix, this.leftPos, this.topPos + 32, 0, 0, 176, 171); this.blit(matrix, this.leftPos, this.topPos + 32, 0, 0, 176, 171);
for (var tab : this.tabs) for (var tab : this.tabs)
@ -139,7 +142,8 @@ public abstract class AbstractPipeGui<T extends AbstractPipeContainer<?>> extend
AbstractPipeGui.this.blit(matrix, this.x, this.y + y, 176, v, 28, height); AbstractPipeGui.this.blit(matrix, this.x, this.y + y, 176, v, 28, height);
AbstractPipeGui.this.itemRenderer.renderGuiItem(this.moduleStack, this.x + 6, this.y + itemOffset); AbstractPipeGui.this.itemRenderer.renderGuiItem(this.moduleStack, this.x + 6, this.y + itemOffset);
AbstractPipeGui.this.getMinecraft().getTextureManager().bindForSetup(TEXTURE); RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, TEXTURE);
} }
private void drawForeground(PoseStack matrix, int mouseX, int mouseY) { private void drawForeground(PoseStack matrix, int mouseX, int mouseY) {

View file

@ -1,7 +1,9 @@
package de.ellpeck.prettypipes.pipe.modules.craft; package de.ellpeck.prettypipes.pipe.modules.craft;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeGui; import de.ellpeck.prettypipes.pipe.containers.AbstractPipeGui;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
@ -14,7 +16,8 @@ public class CraftingModuleGui extends AbstractPipeGui<CraftingModuleContainer>
@Override @Override
protected void renderBg(PoseStack matrix, float partialTicks, int mouseX, int mouseY) { protected void renderBg(PoseStack matrix, float partialTicks, int mouseX, int mouseY) {
super.renderBg(matrix, partialTicks, mouseX, mouseY); super.renderBg(matrix, partialTicks, mouseX, mouseY);
this.getMinecraft().getTextureManager().bindForSetup(TEXTURE); RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, TEXTURE);
this.blit(matrix, this.leftPos + 176 / 2 - 16 / 2, this.topPos + 32 + 18 * 2, 176, 80, 16, 16); this.blit(matrix, this.leftPos + 176 / 2 - 16 / 2, this.topPos + 32 + 18 * 2, 176, 80, 16, 16);
} }
} }

View file

@ -1,9 +1,11 @@
package de.ellpeck.prettypipes.pipe.modules.modifier; package de.ellpeck.prettypipes.pipe.modules.modifier;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import de.ellpeck.prettypipes.packets.PacketButton; import de.ellpeck.prettypipes.packets.PacketButton;
import de.ellpeck.prettypipes.pipe.containers.AbstractPipeGui; import de.ellpeck.prettypipes.pipe.containers.AbstractPipeGui;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.resources.sounds.SimpleSoundInstance; import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -123,7 +125,8 @@ public class FilterModifierModuleGui extends AbstractPipeGui<FilterModifierModul
if (this.tag.equals(FilterModifierModuleItem.getFilterTag(FilterModifierModuleGui.this.menu.moduleStack))) if (this.tag.equals(FilterModifierModuleItem.getFilterTag(FilterModifierModuleGui.this.menu.moduleStack)))
text = ChatFormatting.BOLD + text; text = ChatFormatting.BOLD + text;
FilterModifierModuleGui.this.font.draw(matrix, text, this.x, this.y, color); FilterModifierModuleGui.this.font.draw(matrix, text, this.x, this.y, color);
FilterModifierModuleGui.this.getMinecraft().getTextureManager().bindForSetup(TEXTURE); RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, TEXTURE);
} }
private boolean onClicked(double mouseX, double mouseY, int button) { private boolean onClicked(double mouseX, double mouseY, int button) {

View file

@ -1,8 +1,10 @@
package de.ellpeck.prettypipes.pressurizer; package de.ellpeck.prettypipes.pressurizer;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import de.ellpeck.prettypipes.PrettyPipes; import de.ellpeck.prettypipes.PrettyPipes;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent; import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
@ -35,7 +37,8 @@ public class PressurizerGui extends AbstractContainerScreen<PressurizerContainer
@Override @Override
protected void renderBg(PoseStack matrixStack, float partialTicks, int x, int y) { protected void renderBg(PoseStack matrixStack, float partialTicks, int x, int y) {
this.getMinecraft().getTextureManager().bindForSetup(TEXTURE); RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, TEXTURE);
this.blit(matrixStack, this.leftPos, this.topPos, 0, 0, 176, 137); this.blit(matrixStack, this.leftPos, this.topPos, 0, 0, 176, 137);
var energy = (int) (this.menu.tile.getEnergyPercentage() * 124); var energy = (int) (this.menu.tile.getEnergyPercentage() * 124);
this.blit(matrixStack, this.leftPos + 26, this.topPos + 22, 0, 137, energy, 12); this.blit(matrixStack, this.leftPos + 26, this.topPos + 22, 0, 137, energy, 12);

View file

@ -1,6 +1,7 @@
package de.ellpeck.prettypipes.terminal.containers; package de.ellpeck.prettypipes.terminal.containers;
import com.mojang.blaze3d.platform.InputConstants; import com.mojang.blaze3d.platform.InputConstants;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;
import de.ellpeck.prettypipes.PrettyPipes; import de.ellpeck.prettypipes.PrettyPipes;
import de.ellpeck.prettypipes.misc.ItemTerminalWidget; import de.ellpeck.prettypipes.misc.ItemTerminalWidget;
@ -12,6 +13,7 @@ import joptsimple.internal.Strings;
import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.EditBox; import net.minecraft.client.gui.components.EditBox;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.resources.language.I18n; import net.minecraft.client.resources.language.I18n;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TextComponent; import net.minecraft.network.chat.TextComponent;
@ -298,7 +300,8 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
@Override @Override
protected void renderBg(PoseStack matrix, float partialTicks, int mouseX, int mouseY) { protected void renderBg(PoseStack matrix, float partialTicks, int mouseX, int mouseY) {
this.getMinecraft().getTextureManager().bindForSetup(this.getTexture()); RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, this.getTexture());
this.blit(matrix, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight); this.blit(matrix, this.leftPos, this.topPos, 0, 0, this.imageWidth, this.imageHeight);
if (this.sortedItems != null && this.sortedItems.size() >= 9 * 4) { if (this.sortedItems != null && this.sortedItems.size() >= 9 * 4) {
@ -311,7 +314,8 @@ public class ItemTerminalGui extends AbstractContainerScreen<ItemTerminalContain
// draw the items that are currently crafting // draw the items that are currently crafting
this.hoveredCrafting = ItemStack.EMPTY; this.hoveredCrafting = ItemStack.EMPTY;
if (this.currentlyCrafting != null && !this.currentlyCrafting.isEmpty()) { if (this.currentlyCrafting != null && !this.currentlyCrafting.isEmpty()) {
this.getMinecraft().getTextureManager().bindForSetup(TEXTURE); RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, TEXTURE);
this.blit(matrix, this.leftPos + this.imageWidth, this.topPos + 4, 191, 0, 65, 89); this.blit(matrix, this.leftPos + this.imageWidth, this.topPos + 4, 191, 0, 65, 89);
var x = 0; var x = 0;