Update to 1.20.1
This commit is contained in:
parent
8e30d8c2ee
commit
21c32388a6
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
# User-specific stuff
|
||||
.idea/
|
||||
remappedSrc/
|
||||
|
||||
*.iml
|
||||
*.ipr
|
||||
|
@ -2,13 +2,13 @@
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.19.4
|
||||
yarn_mappings=1.19.4+build.1
|
||||
loader_version=0.14.17
|
||||
minecraft_version=1.20.1
|
||||
yarn_mappings=1.20.1+build.10
|
||||
loader_version=0.14.22
|
||||
# Mod Properties
|
||||
mod_version=1.1.0
|
||||
mod_version=1.2.0
|
||||
maven_group=cmods
|
||||
archives_base_name=cmods
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.75.3+1.19.4
|
||||
fabric_version=0.87.0+1.20.1
|
||||
|
@ -3,11 +3,11 @@ package cmods.cmods.client.ui;
|
||||
import cmods.cmods.api.ButtonBuilder;
|
||||
import cmods.cmods.client.CmodsClient;
|
||||
import cmods.cmods.client.options.CmodsOptions;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.GridWidget;
|
||||
import net.minecraft.client.gui.widget.SimplePositioningWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Pair;
|
||||
@ -67,15 +67,15 @@ public class CmodsOptionsScreen extends Screen {
|
||||
extraWidgets.add(newPair);
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
renderBackground(matrices);
|
||||
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||
renderBackground(context);
|
||||
Text versionText = Text.literal("v" + CmodsClient.version);
|
||||
|
||||
|
||||
drawCenteredTextWithShadow(matrices, textRenderer, title, this.width / 2, 15, 0xffffff);
|
||||
drawTextWithShadow(matrices, textRenderer, versionText, this.width - textRenderer.getWidth(versionText) - 2,
|
||||
context.drawCenteredTextWithShadow(textRenderer, title, this.width / 2, 15, 0xffffff);
|
||||
context.drawTextWithShadow(textRenderer, versionText, this.width - textRenderer.getWidth(versionText) - 2,
|
||||
this.height - textRenderer.fontHeight - 2, 0xffffff);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
super.render(context, mouseX, mouseY, delta);
|
||||
}
|
||||
|
||||
public void removed() {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package cmods.cmods.client.ui;
|
||||
|
||||
import cmods.cmods.client.options.BooleanOption;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import org.apache.http.util.TextUtils;
|
||||
|
||||
@ -36,8 +36,8 @@ public class ToggleButton extends ButtonWidget {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||
updateText();
|
||||
super.renderButton(matrices, mouseX, mouseY, delta);
|
||||
super.renderButton(context, mouseX, mouseY, delta);
|
||||
}
|
||||
}
|
||||
|
@ -2,11 +2,11 @@ package cmods.cmods.client.ui;
|
||||
|
||||
import cmods.cmods.api.ButtonBuilder;
|
||||
import cmods.cmods.client.options.CmodsOptions;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.GridWidget;
|
||||
import net.minecraft.client.gui.widget.SimplePositioningWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.screen.ScreenTexts;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Pair;
|
||||
@ -69,10 +69,10 @@ public class UIOptionsScreen extends Screen {
|
||||
extraButtons.add(newPair);
|
||||
}
|
||||
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(matrices);
|
||||
drawCenteredTextWithShadow(matrices, this.textRenderer, this.title, this.width / 2, 15, 0xffffff);
|
||||
super.render(matrices, mouseX, mouseY, delta);
|
||||
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
|
||||
this.renderBackground(context);
|
||||
context.drawCenteredTextWithShadow(this.textRenderer, this.title, this.width / 2, 15, 0xffffff);
|
||||
super.render(context, mouseX, mouseY, delta);
|
||||
}
|
||||
|
||||
public void removed() {
|
||||
|
@ -1,13 +1,12 @@
|
||||
package cmods.cmods.mixin;
|
||||
|
||||
import cmods.cmods.client.options.CmodsOptions;
|
||||
import cmods.cmods.api.HudRenderCallback;
|
||||
import cmods.cmods.client.options.CmodsOptions;
|
||||
import cmods.cmods.client.ui.Line;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.font.TextRenderer;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.hud.InGameHud;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Pair;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@ -22,14 +21,14 @@ import java.util.ArrayList;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
@Mixin(InGameHud.class)
|
||||
public abstract class HudMixin extends DrawableHelper {
|
||||
public abstract class HudMixin {
|
||||
|
||||
@Shadow @Final private MinecraftClient client;
|
||||
@Shadow public abstract TextRenderer getTextRenderer();
|
||||
|
||||
|
||||
@Inject(at = @At("TAIL"), method = "render")
|
||||
private void render(MatrixStack matrices, float tickDelta, CallbackInfo ci) {
|
||||
private void render(DrawContext context, float tickDelta, CallbackInfo ci) {
|
||||
CmodsOptions options = CmodsOptions.getInstance();
|
||||
|
||||
if (this.client.options.debugEnabled || this.client.isPaused() || client.player == null ||
|
||||
@ -66,8 +65,7 @@ public abstract class HudMixin extends DrawableHelper {
|
||||
y += 2;
|
||||
}
|
||||
|
||||
DrawableHelper.drawTextWithShadow(matrices, textRenderer, line.text(), x + (5 * line.indent()), y,
|
||||
line.color());
|
||||
context.drawTextWithShadow(textRenderer, line.text(), x + (5 * line.indent()), y, line.color());
|
||||
y += textRenderer.fontHeight;
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,6 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=0.14.10",
|
||||
"fabric": "*",
|
||||
"minecraft": "1.19.4"
|
||||
"minecraft": "1.20.1"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user