Skip to content

Commit

Permalink
Updated to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Minenash committed Jun 1, 2023
1 parent fcbf09a commit 333bc97
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
minecraft_version=1.20-rc1
yarn_mappings=1.20-rc1+build.2
loader_version=0.14.21
modmenu_version = 6.2.2
modmenu_version = 7.0.0-beta.2

# Mod Properties
mod_version = 1.0.4+1.19.4
mod_version = 1.0.4+1.20
maven_group = com.minenash
archives_base_name = enhanced_attack_indicator

# Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.83.0+1.19.4
fabric_version=0.83.0+1.20
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.fabricmc.loader.api.FabricLoader;
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.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.screen.Screen;
Expand Down Expand Up @@ -295,10 +295,10 @@ protected void init() {

}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.renderBackground(matrices);
this.list.render(matrices, mouseX, mouseY, delta);
drawCenteredTextWithShadow(matrices, textRenderer, title, width / 2, 15, 0xFFFFFF);
public void render(DrawContext context, int mouseX, int mouseY, float delta) {
this.renderBackground(context);
this.list.render(context, mouseX, mouseY, delta);
context.drawCenteredTextWithShadow(textRenderer, title, width / 2, 15, 0xFFFFFF);

for (EntryInfo info : entries) {
if (info.id.equals(modid)) {
Expand All @@ -308,17 +308,17 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
Text name = Text.translatable(this.translationPrefix + info.field.getName());
String key = translationPrefix + info.field.getName() + ".tooltip";

if (info.error != null && text.equals(name)) renderTooltip(matrices, info.error.getValue(), mouseX, mouseY);
if (info.error != null && text.equals(name)) context.drawTooltip(textRenderer, info.error.getValue(), mouseX, mouseY);
else if (I18n.hasTranslation(key) && text.equals(name)) {
List<Text> list = new ArrayList<>();
for (String str : I18n.translate(key).split("\n"))
list.add(Text.literal(str));
renderTooltip(matrices, list, mouseX, mouseY);
context.drawTooltip(textRenderer, list, mouseX, mouseY);
}
}
}
}
super.render(matrices,mouseX,mouseY,delta);
super.render(context,mouseX,mouseY,delta);
}
}
@Environment(EnvType.CLIENT)
Expand Down Expand Up @@ -363,10 +363,10 @@ private ButtonEntry(List<ClickableWidget> buttons, Text text) {
public static ButtonEntry create(List<ClickableWidget> buttons, Text text) {
return new ButtonEntry(buttons, text);
}
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
buttons.forEach(b -> { b.setY(y); b.render(matrices, mouseX, mouseY, tickDelta); });
public void render(DrawContext context, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
buttons.forEach(b -> { b.setY(y); b.render(context, mouseX, mouseY, tickDelta); });
if (text != null && (!text.getString().contains("spacer") || !buttons.isEmpty()))
DrawableHelper.drawTextWithShadow(matrices,textRenderer, text,12,y+5,0xFFFFFF);
context.drawTextWithShadow(textRenderer, text,12,y+5,0xFFFFFF);
}
public List<? extends Element> children() {return children;}
public List<? extends Selectable> selectableChildren() {return children;}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"depends": {
"fabricloader": ">=0.11.3",
"fabric": "*",
"minecraft": "1.19.x",
"minecraft": ">=1.20-",
"java": ">=17"
}
}

0 comments on commit 333bc97

Please sign in to comment.