Skip to content

Commit

Permalink
v2.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehum committed Apr 30, 2024
2 parents 330e401 + 4357a8c commit c7bbe3f
Show file tree
Hide file tree
Showing 90 changed files with 669 additions and 255 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/prerelease-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}
distribution: temurin
java-version: |
8
16
17
21
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
distribution: temurin
java-version: |
8
16
17
21
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
Expand All @@ -45,6 +47,9 @@ jobs:
1.20
1.20.1
1.20.2
1.20.3
1.20.4
1.20.5
modrinth-unfeature-mode: 'subset'
modrinth-id: 1bZhdhsH
Expand All @@ -67,6 +72,9 @@ jobs:
1.20
1.20.1
1.20.2
1.20.3
1.20.4
1.20.5
modrinth-unfeature-mode: 'subset'
modrinth-id: 1bZhdhsH
Expand Down
2 changes: 0 additions & 2 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ subprojects {
configurations.api.get().allDependencies.forEach {
if (it is ProjectDependency) return@forEach

println(it.name)

val dependencyNode = dependenciesNode.appendNode("dependency")
dependencyNode.appendNode("groupId", it.group)
dependencyNode.appendNode("artifactId", it.name)
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ plugins {
alias(libs.plugins.idea.ext)
alias(libs.plugins.crowdin.plugin) apply(false)

kotlin("jvm") version("1.6.10")
kotlin("plugin.lombok") version("1.6.10")
kotlin("kapt") version("1.6.10")
kotlin("jvm") version("1.9.23")
kotlin("plugin.lombok") version("1.9.23")
kotlin("kapt") version("1.9.23")

id("gg.essential.multi-version.root") apply(false)
id("su.plo.voice.relocate") version("1.0.1") apply(false)
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

dependencies {
implementation(libs.guava)
implementation(libs.gson) // not sure why, but there is somewhere old gson
}

repositories {
Expand Down
File renamed without changes.
Empty file added client/1.20.6-fabric/.gitkeep
Empty file.
28 changes: 13 additions & 15 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import gg.essential.gradle.multiversion.excludeKotlinDefaultImpls
import gg.essential.gradle.multiversion.mergePlatformSpecifics
import gg.essential.gradle.util.RelocationTransform.Companion.registerRelocationAttribute
import gg.essential.gradle.util.noServerRunConfigs
import gg.essential.util.prebundleNow
import gg.essential.gradle.util.prebundle

val mavenGroup: String by rootProject
val isMainProject = project.name == file("../mainProject").readText().trim()
Expand Down Expand Up @@ -45,16 +45,9 @@ plasmoCrowdin {

val shadowCommon by configurations.creating

val relocatedUC = registerRelocationAttribute("relocate-uc") {
relocate("gg.essential.universal", "su.plo.voice.universal")
}
val universalCraft by configurations.creating {
attributes { attribute(relocatedUC, true) }
}

fun uStatsVersion() = rootProject.libs.versions.ustats.map {
val minecraftVersion = when (platform.mcVersion) {
12001, 12002, 12003 -> "1.20"
12001, 12002, 12004, 12006 -> "1.20"
else -> platform.mcVersionStr
}

Expand All @@ -76,21 +69,25 @@ dependencies {
11904 -> "0.76.0+1.19.4"
12001 -> "0.84.0+1.20.1"
12002 -> "0.89.1+1.20.2"
12003 -> "0.91.1+1.20.3"
12004 -> "0.97.0+1.20.4"
12006 -> "0.97.8+1.20.6"
else -> throw GradleException("Unsupported platform $platform")
}

modImplementation("net.fabricmc.fabric-api:fabric-api:${fabricApiVersion}")
"include"(modImplementation("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")!!)
}

universalCraft(rootProject.libs.versions.universalcraft.map {
rootProject.libs.versions.universalcraft.map {
"gg.essential:universalcraft-$platform:$it"
}) {
isTransitive = false
}.also {
modApi(it) {
isTransitive = false
}
shadowCommon(it) {
isTransitive = false
}
}
modApi(prebundleNow(universalCraft))
shadowCommon(prebundleNow(universalCraft))

"su.plo.ustats:${uStatsVersion()}".also {
modApi(it) {
Expand Down Expand Up @@ -155,6 +152,7 @@ tasks {
configurations = listOf(shadowCommon)

relocate("su.plo.crowdin", "su.plo.voice.libs.crowdin")
relocate("gg.essential.universal", "su.plo.voice.universal")

relocate("su.plo.ustats", "su.plo.voice.ustats")

Expand Down
3 changes: 2 additions & 1 deletion client/changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- 1.20.3 and 1.20.4 support
- Fixed stacktrace spam on bad packets [#397](https://github.com/plasmoapp/plasmo-voice/issues/397)
- 1.20.5, 1.20.6 support
2 changes: 1 addition & 1 deletion client/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
essential.defaults.loom=1
essential.defaults.loom.mappings=official
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.14.22
essential.defaults.loom.fabric-loader=net.fabricmc:fabric-loader:0.15.10

org.gradle.daemon=false
org.gradle.parallel=true
Expand Down
7 changes: 5 additions & 2 deletions client/root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ group = "$mavenGroup.client-root"

preprocess {

val fabric12003 = createNode("1.20.3-fabric", 12003, "official")
val fabric12006 = createNode("1.20.6-fabric", 12006, "official")
val fabric12004 = createNode("1.20.4-fabric", 12004, "official")

// val forge12002 = createNode("1.20.2-forge", 12002, "official")
val fabric12002 = createNode("1.20.2-fabric", 12002, "official")
Expand All @@ -21,7 +22,9 @@ preprocess {
val forge11902 = createNode("1.19.2-forge", 11902, "official")
val fabric11902 = createNode("1.19.2-fabric", 11902, "official")

fabric12003.link(fabric12002)
fabric12006.link(fabric12004)

fabric12004.link(fabric12002)

fabric12002.link(fabric12001, file("1.20.2-1.20.1.txt"))
// forge12002.link(fabric12002)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,39 @@

import java.util.List;

//#if MC>=12005
//$$ import com.mojang.serialization.JsonOps;
//$$ import com.google.gson.*;
//$$ import net.minecraft.network.chat.ComponentSerialization;
//#endif

public final class ComponentTextConverter implements MinecraftTextConverter<Component> {

//#if MC>=12005
//$$ private static final Gson GSON = (new GsonBuilder()).disableHtmlEscaping().create();
//#endif

@Override // todo: legacy
public @NotNull String convertToJson(@NotNull Component text) {
//#if MC>=12005
//$$ return GSON.toJson(
//$$ ComponentSerialization.CODEC.encodeStart(JsonOps.INSTANCE, text)
//$$ .getOrThrow(JsonParseException::new)
//$$ );
//#else
return Component.Serializer.toJson(text);
//#endif
}

@Override // todo: legacy
public Component convertFromJson(@NotNull String json) {
//#if MC>=12005
//$$ JsonElement jsonElement = JsonParser.parseString(json);
//$$ return jsonElement == null ? null : ComponentSerialization.CODEC.parse(JsonOps.INSTANCE, jsonElement)
//$$ .getOrThrow(JsonParseException::new);
//#else
return Component.Serializer.fromJson(json);
//#endif
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package su.plo.lib.mod.client.chat;

import su.plo.voice.universal.UMinecraft;
import gg.essential.universal.UMinecraft;
import lombok.NonNull;
import lombok.experimental.UtilityClass;
import net.minecraft.network.chat.Component;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package su.plo.lib.mod.client.chat;

import su.plo.voice.universal.wrappers.message.UTextComponent;
import gg.essential.universal.wrappers.message.UTextComponent;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import net.minecraft.network.chat.Component;
Expand All @@ -21,12 +21,12 @@ public final class ClientTextConverter extends TranslatableTextConverter<Compone

@Override
public @NotNull String convertToJson(@NotNull Component text) {
return Component.Serializer.toJson(text);
return textConverter.convertToJson(text);
}

@Override
public Component convertFromJson(@NotNull String json) {
return Component.Serializer.fromJson(json);
return textConverter.convertFromJson(json);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package su.plo.lib.mod.client.gui.components;

import su.plo.voice.universal.UKeyboard;
import gg.essential.universal.UKeyboard;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import su.plo.lib.api.chat.MinecraftTextComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package su.plo.lib.mod.client.gui.components;

import com.google.common.collect.Lists;
import su.plo.voice.universal.UGraphics;
import su.plo.voice.universal.UMatrixStack;
import gg.essential.universal.UGraphics;
import gg.essential.universal.UMatrixStack;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
Expand Down Expand Up @@ -203,7 +203,11 @@ public void setScrollTop(double scrollTop) {
}

protected void renderList(@NotNull UMatrixStack stack, int x, int y, int mouseX, int mouseY, float delta) {
//#if MC>=12005
//$$ RenderUtil.enableScissor(0, 0, width, y1 - y0 + 6);
//#else
RenderUtil.enableScissor(0, 0, width, y1 - y0 + 4);
//#endif
for (int index = 0; index < entries.size(); index++) {
Entry entry = entries.get(index);
EntryPosition position = entryPositions.get(index);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package su.plo.lib.mod.client.gui.components;

import su.plo.lib.mod.client.gui.widget.GuiWidgetTexture;
import su.plo.voice.universal.UGraphics;
import su.plo.voice.universal.UKeyboard;
import su.plo.voice.universal.UMatrixStack;
import gg.essential.universal.UGraphics;
import gg.essential.universal.UKeyboard;
import gg.essential.universal.UMatrixStack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import su.plo.lib.api.MathLib;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package su.plo.lib.mod.client.gui.components;

import su.plo.voice.universal.UMatrixStack;
import gg.essential.universal.UMatrixStack;
import org.jetbrains.annotations.NotNull;
import su.plo.lib.api.chat.MinecraftTextComponent;
import su.plo.lib.mod.client.gui.narration.NarrationOutput;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package su.plo.lib.mod.client.gui.components;

import su.plo.voice.universal.UGraphics;
import su.plo.voice.universal.UMatrixStack;
import gg.essential.universal.UGraphics;
import gg.essential.universal.UMatrixStack;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.resources.ResourceLocation;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package su.plo.lib.mod.client.gui.screen;

import com.google.common.collect.Lists;
import su.plo.voice.universal.UMatrixStack;
import su.plo.voice.universal.UMinecraft;
import su.plo.voice.universal.UResolution;
import gg.essential.universal.UMatrixStack;
import gg.essential.universal.UMinecraft;
import gg.essential.universal.UResolution;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.client.gui.screens.Screen;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package su.plo.lib.mod.client.gui.screen;

import su.plo.voice.universal.UKeyboard;
import gg.essential.universal.UKeyboard;
import org.jetbrains.annotations.Nullable;
import su.plo.lib.mod.client.gui.widget.GuiWidgetListener;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package su.plo.lib.mod.client.gui.screen;

import su.plo.voice.universal.*;
import gg.essential.universal.*;
import lombok.Getter;
import lombok.ToString;
import net.minecraft.client.gui.screens.Screen;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package su.plo.lib.mod.client.gui.widget;

import su.plo.voice.universal.UGraphics;
import su.plo.voice.universal.UMatrixStack;
import su.plo.voice.universal.USound;
import gg.essential.universal.UGraphics;
import gg.essential.universal.UMatrixStack;
import gg.essential.universal.USound;
import lombok.Getter;
import lombok.Setter;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
package su.plo.lib.mod.client.gui.widget;

import su.plo.voice.universal.UMatrixStack;
import gg.essential.universal.UMatrixStack;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.NotNull;

public interface GuiWidget {

//#if MC>=12005
//$$ ResourceLocation MENU_LIST_BACKGROUND_LOCATION = new ResourceLocation("textures/gui/menu_list_background.png");
//$$ ResourceLocation INWORLD_MENU_LIST_BACKGROUND_LOCATION = new ResourceLocation("textures/gui/inworld_menu_list_background.png");
//$$
//$$ ResourceLocation FOOTER_SEPARATOR_LOCATION = new ResourceLocation("textures/gui/footer_separator.png");
//$$ ResourceLocation INWORLD_FOOTER_SEPARATOR_LOCATION = new ResourceLocation("textures/gui/inworld_footer_separator.png");
//#else
ResourceLocation BACKGROUND_LOCATION = new ResourceLocation("textures/gui/options_background.png");
//#endif

int getWidth();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package su.plo.lib.mod.client.gui.widget;

import su.plo.voice.universal.UKeyboard;
import gg.essential.universal.UKeyboard;
import org.jetbrains.annotations.Nullable;

public interface GuiWidgetListener {
Expand Down
Loading

0 comments on commit c7bbe3f

Please sign in to comment.