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