Skip to content

Commit

Permalink
Updated to BTA 1.7.7.0!
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSVK12 committed Aug 2, 2023
1 parent a717e34 commit 225d039
Show file tree
Hide file tree
Showing 34 changed files with 130 additions and 90 deletions.
58 changes: 29 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'babric-loom' version '1.0.+'
id "org.quiltmc.loom" version "1.+"
id 'java'
}

Expand All @@ -8,10 +8,10 @@ archivesBaseName = project.mod_name
version = project.mod_version

loom {
// gluedMinecraftJar()
noIntermediateMappings()
clientOnlyMinecraftJar()
customMinecraftManifest.set("https://github.com/Turnip-Labs/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json")
//serverOnlyMinecraftJar()
noIntermediateMappings()
customMinecraftManifest.set("https://github.com/MartinSVK12/bta-manifest-repo/releases/download/v${project.bta_version}/${project.bta_version}.json")
}

repositories {
Expand All @@ -35,35 +35,43 @@ repositories {
ivy {
url = "https://github.com/Turnip-Labs"
patternLayout {
artifact "[organisation]/releases/download/v[revision]/[module].jar"
artifact "[organisation]/releases/download/v[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://piston-data.mojang.com"
patternLayout {
artifact "v1/[organisation]/[revision]/[module].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/MartinSVK12"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://piston-data.mojang.com"
patternLayout {
artifact "v1/[organisation]/[revision]/[module].jar"
m2compatible = true
}
metadataSources { artifact() }
}
}

dependencies {
minecraft "bta-download-repo:bta:${project.bta_version}"
mappings loom.layered() {}
mappings loom.layered {}

modRuntimeOnly "objects:client:43db9b498cb67058d2e12d394e6507722e71bb45" // https://piston-data.mojang.com/v1/objects/43db9b498cb67058d2e12d394e6507722e71bb45/client.jar
modImplementation "babric:fabric-loader:${project.loader_version}"

modImplementation "org.slf4j:slf4j-api:1.8.0-beta4"
modImplementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"
modImplementation("quilt-loader:quilt-loader:${project.loader_version}")

implementation include("org.apache.commons:commons-lang3:3.12.0")

implementation include("com.google.guava:guava:28.0-jre")
implementation include(group: 'com.google.code.gson', name: 'gson', version: '2.8.6')
implementation include("com.google.guava:guava:28.0-jre")
implementation include(group: 'com.google.code.gson', name: 'gson', version: '2.8.6')

modImplementation "org.slf4j:slf4j-api:1.8.0-beta4"
modImplementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"
}

java {
Expand All @@ -72,7 +80,7 @@ java {
withSourcesJar()
}

tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.release.set 8
}

Expand All @@ -81,11 +89,3 @@ jar {
rename { "${it}_${archivesBaseName}" }
}
}

processResources {
inputs.property "version", version

filesMatching("fabric.mod.json") {
expand "version": version
}
}
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ org.gradle.jvmargs=-Xmx1G
# Also makes builds more reliable and less likely to randomly fail.
org.gradle.daemon=false

mod_version=2.0.0-beta.1
mod_version=2.0.0
mod_group=io.github.turniplabs
mod_name=modmenu-bta

# yarn_mappings=df0e26c
bta_version=1.7.7.0-pre1
loader_version=0.14.6-babric.1
bta_version=1.7.7.0
loader_version=0.20.0-beta.3-bta
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
6 changes: 5 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ pluginManagement {
name = 'Babric'
url = 'https://maven.glass-launcher.net/babric'
}
maven {
name = 'Quilt'
url = 'https://maven.quiltmc.org/repository/release'
}
}
}
}
5 changes: 3 additions & 2 deletions src/main/java/io/github/prospector/modmenu/ModMenu.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu;


import com.google.common.collect.ImmutableMap;
import com.google.common.collect.LinkedListMultimap;
import com.google.gson.FieldNamingPolicy;
Expand All @@ -14,8 +15,8 @@
import net.fabricmc.loader.api.metadata.CustomValue;
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.minecraft.client.Minecraft;
import net.minecraft.core.gui.GuiScreen;
import net.minecraft.core.gui.options.GuiOptionsPageGeneral;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.options.GuiOptionsPageGeneral;

import java.text.NumberFormat;
import java.util.*;
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/io/github/prospector/modmenu/api/ModMenuApi.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package io.github.prospector.modmenu.api;


import io.github.prospector.modmenu.ModMenu;
import io.github.prospector.modmenu.util.TriConsumer;
import net.minecraft.client.gui.GuiScreen;
import org.jetbrains.annotations.ApiStatus;

import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;

import io.github.prospector.modmenu.util.TriConsumer;
import net.minecraft.core.gui.GuiScreen;
import org.jetbrains.annotations.ApiStatus;

public interface ModMenuApi {
/**
* Replaced with {@link ModMenuApi#getConfigScreen(net.minecraft.core.gui.GuiScreen)}, with
* Replaced with {@link ModMenuApi#getConfigScreen(GuiScreen)}, with
* the ModMenuApi implemented onto a class that is added as an
* entry point to your fabric mod metadata.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.config;


import io.github.prospector.modmenu.util.HardcodedUtil;
import net.fabricmc.loader.api.ModContainer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.config;


import io.github.prospector.modmenu.ModMenu;
import net.fabricmc.loader.api.FabricLoader;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package io.github.prospector.modmenu.gui;


import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.Minecraft;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package io.github.prospector.modmenu.gui;


import io.github.prospector.modmenu.util.HardcodedUtil;
import io.github.prospector.modmenu.util.RenderUtils;
import net.fabricmc.loader.api.metadata.Person;
import net.minecraft.client.Minecraft;
import net.minecraft.core.render.FontRenderer;
import net.minecraft.client.render.FontRenderer;

import java.util.Collection;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
package io.github.prospector.modmenu.gui;


import com.google.common.collect.Lists;
import java.util.AbstractList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.Minecraft;
import net.minecraft.core.gui.GuiScreen;
import net.minecraft.core.render.Tessellator;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.render.Tessellator;
import net.minecraft.core.util.helper.MathHelper;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;

import javax.annotation.Nullable;
import java.util.AbstractList;
import java.util.Collection;
import java.util.List;
import java.util.Objects;

@SuppressWarnings({"unchecked", "unused"})
@Environment(EnvType.CLIENT)
public abstract class EntryListWidget<E extends EntryListWidget.Entry<E>> extends GuiScreen {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.gui;


import io.github.prospector.modmenu.ModMenu;
import io.github.prospector.modmenu.util.BadgeRenderer;
import io.github.prospector.modmenu.util.HardcodedUtil;
Expand All @@ -8,8 +9,8 @@
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.minecraft.client.Minecraft;
import net.minecraft.core.render.FontRenderer;
import net.minecraft.core.render.Tessellator;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.Tessellator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.opengl.GL11;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.gui;


import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
Expand All @@ -13,10 +14,10 @@
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.fabricmc.loader.api.metadata.Person;
import net.minecraft.client.Minecraft;
import net.minecraft.core.gui.GuiButton;
import net.minecraft.core.gui.GuiScreen;
import net.minecraft.core.render.FontRenderer;
import net.minecraft.core.render.Tessellator;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.Tessellator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.lwjgl.Sys;
Expand Down Expand Up @@ -108,6 +109,7 @@ public void initGui() {
this.descriptionListWidget = new DescriptionListWidget(this.mc, paneWidth, this.height, paneY + 60, this.height - 36, 9 + 1, this);
this.descriptionListWidget.setLeftPos(rightPaneX);
GuiButton configureButton = new ModMenuTexturedButtonWidget(CONFIGURE_BUTTON_ID, width - 24, paneY, 20, 20, 0, 0, CONFIGURE_BUTTON_LOCATION, 32, 64) {

@Override
public void render(Minecraft mc, int mouseX, int mouseY) {
if (selected != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.gui;


import io.github.prospector.modmenu.ModMenu;
import io.github.prospector.modmenu.config.ModMenuConfigManager;
import io.github.prospector.modmenu.gui.entries.ChildEntry;
Expand All @@ -11,7 +12,7 @@
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.metadata.ModMetadata;
import net.minecraft.client.Minecraft;
import net.minecraft.core.render.Tessellator;
import net.minecraft.client.render.Tessellator;
import net.minecraft.core.util.helper.MathHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.prospector.modmenu.gui;


import net.minecraft.core.gui.GuiButton;
import net.minecraft.client.gui.GuiButton;

public class ModMenuButtonWidget extends GuiButton {
public ModMenuButtonWidget(int buttonId, int x, int y, int width, int height, String text) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package io.github.prospector.modmenu.gui;


import net.minecraft.client.Minecraft;
import net.minecraft.core.gui.GuiButton;
import net.minecraft.core.render.FontRenderer;
import net.minecraft.core.render.Tessellator;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.Tessellator;
import org.lwjgl.opengl.GL11;

public class ModMenuTexturedButtonWidget extends GuiButton {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.github.prospector.modmenu.gui;


import io.github.prospector.modmenu.mixin.MinecraftAccessor;
import io.github.prospector.modmenu.mixin.TextFieldEditorAccessor;
import net.minecraft.core.enums.EnumOS2;
import net.minecraft.core.gui.GuiScreen;
import net.minecraft.core.gui.text.ITextField;
import net.minecraft.core.gui.text.TextFieldEditor;
import net.minecraft.core.render.FontRenderer;
import net.minecraft.core.render.Tessellator;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.text.ITextField;
import net.minecraft.client.gui.text.TextFieldEditor;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.Tessellator;
import net.minecraft.core.enums.EnumOS;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

Expand Down Expand Up @@ -693,7 +694,7 @@ public void setVisible(boolean isVisible) {
}

private static boolean isCtrlKeyDown() {
if (MinecraftAccessor.getOS() == EnumOS2.macos) {
if (MinecraftAccessor.getOS() == EnumOS.macos) {
return Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA);
} else {
return Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.gui.entries;


import io.github.prospector.modmenu.gui.ModListEntry;
import io.github.prospector.modmenu.gui.ModListWidget;
import net.fabricmc.loader.api.ModContainer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.gui.entries;


import io.github.prospector.modmenu.gui.ModListEntry;
import io.github.prospector.modmenu.gui.ModListWidget;
import net.fabricmc.loader.api.ModContainer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.github.prospector.modmenu.gui.entries;


import io.github.prospector.modmenu.ModMenu;
import io.github.prospector.modmenu.gui.ModListEntry;
import io.github.prospector.modmenu.gui.ModListWidget;
import io.github.prospector.modmenu.util.ModListSearch;
import net.fabricmc.loader.api.ModContainer;
import net.minecraft.client.Minecraft;
import net.minecraft.core.render.FontRenderer;
import net.minecraft.core.render.Tessellator;
import net.minecraft.client.render.FontRenderer;
import net.minecraft.client.render.Tessellator;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.github.prospector.modmenu.impl;


import io.github.prospector.modmenu.api.ModMenuApi;
import io.github.prospector.modmenu.util.TriConsumer;

Expand Down
Loading

0 comments on commit 225d039

Please sign in to comment.