Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Update to fabric 1.16.4 and fix config screen crash #306

Open
wants to merge 1 commit into
base: 1.16_fabric
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.matthewprenger.cursegradle" version "1.3.0"
id 'fabric-loom' version '0.4-SNAPSHOT'
id 'fabric-loom' version '0.5-SNAPSHOT'
id "maven-publish"
}

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package_group=mcp.mobius.waila
mod_version=1.9.23
curse_id=253449

mc_version=1.16.2
mappings_version=1
loader_version=0.9.1+build.205
mc_version=1.16.4
mappings_version=7
loader_version=0.10.8
api_version=0.1.3+
api_commands_version=1.0.8+
api_keybinding_version=1.0.0+
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/mcp/mobius/waila/gui/GuiConfigPlugins.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.LiteralText;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;

Expand All @@ -25,7 +26,7 @@ public OptionsListWidget getOptions() {
PluginConfig.INSTANCE.getNamespaces().forEach(namespace -> {
String translationKey = "config.waila.plugin_" + namespace;
Set<Identifier> keys = PluginConfig.INSTANCE.getKeys(namespace);
options.add(new OptionsEntryButton(translationKey, new ButtonWidget(0, 0, 100, 20, null, w -> {
options.add(new OptionsEntryButton(translationKey, new ButtonWidget(0, 0, 100, 20, LiteralText.EMPTY, w -> {
client.openScreen(new GuiOptions(GuiConfigPlugins.this, new TranslatableText(translationKey)) {
@Override
public OptionsListWidget getOptions() {
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/mcp/mobius/waila/gui/GuiConfigWaila.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import mcp.mobius.waila.gui.config.value.OptionsEntryValueInput;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.LiteralText;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
Expand All @@ -23,7 +24,7 @@ public GuiConfigWaila(Screen parent) {
@Override
public OptionsListWidget getOptions() {
OptionsListWidget options = new OptionsListWidget(this, client, width + 45, height, 32, height - 32, 30, Waila.CONFIG::save);
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "general")), new ButtonWidget(0, 0, 100, 20, null, w -> {
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "general")), new ButtonWidget(0, 0, 100, 20, LiteralText.EMPTY, w -> {
client.openScreen(new GuiOptions(GuiConfigWaila.this, new TranslatableText(Util.createTranslationKey("config", new Identifier(Waila.MODID, "general")))) {
@Override
public OptionsListWidget getOptions() {
Expand Down Expand Up @@ -56,7 +57,7 @@ public OptionsListWidget getOptions() {
}
});
})));
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay")), new ButtonWidget(0, 0, 100, 20, null, w -> {
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay")), new ButtonWidget(0, 0, 100, 20, LiteralText.EMPTY, w -> {
client.openScreen(new GuiOptions(GuiConfigWaila.this, new TranslatableText(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay")))) {
@Override
public OptionsListWidget getOptions() {
Expand All @@ -70,7 +71,7 @@ public OptionsListWidget getOptions() {
options.add(new OptionsEntryValueEnum<>(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay_size")), WailaConfig.ConfigOverlay.SizeChoice.values(), Waila.CONFIG.get().getOverlay().getOverlaySize(), val ->
Waila.CONFIG.get().getOverlay().setOverlaySize(val)
));
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay_color")), new ButtonWidget(0, 0, 100, 20, null, w -> {
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay_color")), new ButtonWidget(0, 0, 100, 20, LiteralText.EMPTY, w -> {
client.openScreen(new GuiOptions(GuiConfigWaila.this, new TranslatableText(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay_color")))) {
@Override
public OptionsListWidget getOptions() {
Expand All @@ -92,7 +93,7 @@ public OptionsListWidget getOptions() {
}
});
})));
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "formatting")), new ButtonWidget(0, 0, 100, 20, null, w -> {
options.add(new OptionsEntryButton(Util.createTranslationKey("config", new Identifier(Waila.MODID, "formatting")), new ButtonWidget(0, 0, 100, 20, LiteralText.EMPTY, w -> {
client.openScreen(new GuiOptions(GuiConfigWaila.this, new TranslatableText(Util.createTranslationKey("config", new Identifier(Waila.MODID, "overlay")))) {
@Override
public OptionsListWidget getOptions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
int j = scrollPosX + 6;
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
this.client.getTextureManager().bindTexture(DrawableHelper.BACKGROUND_TEXTURE);
this.client.getTextureManager().bindTexture(DrawableHelper.OPTIONS_BACKGROUND_TEXTURE);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
int rowLeft = this.getRowLeft();
int scrollJump = this.top + 4 - (int)this.getScrollAmount();

this.renderList(matrices, rowLeft, scrollJump, mouseX, mouseY, delta);
this.client.getTextureManager().bindTexture(DrawableHelper.BACKGROUND_TEXTURE);
this.client.getTextureManager().bindTexture(DrawableHelper.OPTIONS_BACKGROUND_TEXTURE);
RenderSystem.enableDepthTest();
RenderSystem.depthFunc(519);
bufferBuilder.begin(7, VertexFormats.POSITION_TEXTURE_COLOR);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/mcp/mobius/waila/overlay/RayTracing.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.RayTraceContext;
import net.minecraft.world.RaycastContext;
import net.minecraft.world.World;

import java.util.Collection;
Expand Down Expand Up @@ -64,9 +64,9 @@ public HitResult rayTrace(Entity entity, double playerReach, float partialTicks)
Vec3d lookVector = entity.getRotationVec(partialTicks);
Vec3d traceEnd = eyePosition.add(lookVector.x * playerReach, lookVector.y * playerReach, lookVector.z * playerReach);

RayTraceContext.FluidHandling fluidView = Waila.CONFIG.get().getGeneral().shouldDisplayFluids() ? RayTraceContext.FluidHandling.SOURCE_ONLY : RayTraceContext.FluidHandling.NONE;
RayTraceContext context = new RayTraceContext(eyePosition, traceEnd, RayTraceContext.ShapeType.OUTLINE, fluidView, entity);
return entity.getEntityWorld().rayTrace(context);
RaycastContext.FluidHandling fluidView = Waila.CONFIG.get().getGeneral().shouldDisplayFluids() ? RaycastContext.FluidHandling.SOURCE_ONLY : RaycastContext.FluidHandling.NONE;
RaycastContext context = new RaycastContext(eyePosition, traceEnd, RaycastContext.ShapeType.OUTLINE, fluidView, entity);
return entity.getEntityWorld().raycast(context);
}

public ItemStack getIdentifierStack() {
Expand Down