BUMP Minecraft version to 1.19.2

BUMP Fabric API to v2
This commit is contained in:
Hiajen Hiajen 2022-09-21 14:39:09 +02:00
parent 30b5888657
commit a31b01aa03
13 changed files with 52 additions and 53 deletions

View file

@ -1,9 +1,9 @@
plugins { plugins {
id 'fabric-loom' version '0.10-SNAPSHOT' id 'fabric-loom' version '1.0-SNAPSHOT'
} }
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name archivesBaseName = project.archives_base_name
version = project.mod_version version = project.mod_version
@ -55,10 +55,11 @@ tasks.withType(JavaCompile).configureEach {
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option. // We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 8 //def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) { //if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion // it.options.release = targetVersion
} //}
it.options.release = 17
} }
java { java {

View file

@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/versions.html # check these on https://fabricmc.net/versions.html
minecraft_version=1.16.5 minecraft_version=1.19.2
yarn_mappings=1.16.5+build.10 yarn_mappings=1.19.2+build.13
loader_version=0.12.11 loader_version=0.14.9
# Mod Properties # Mod Properties
mod_version = 1.1.3 mod_version = 1.1.4
maven_group = net.saltymc.eaa maven_group = net.saltymc.eaa
archives_base_name = EAA_MOD archives_base_name = EAA_MOD
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api (or https://fabricmc.net/versions.html) # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api (or https://fabricmc.net/versions.html)
fabric_version=0.42.0+1.16 fabric_version=0.61.0+1.19.2
#SQL #SQL
jdbc_mysql=8.0.27 jdbc_mysql=8.0.27

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -2,14 +2,14 @@ package net.saltymc.eaa.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.saltymc.eaa.function.LobbyFunction; import net.saltymc.eaa.function.LobbyFunction;
import net.saltymc.eaa.util.database.DB_Tag; import net.saltymc.eaa.util.database.DB_Tag;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
public class CheckLobbyCommand extends EaaModCommand{ public class CheckLobbyCommand extends EaaModCommand{

View file

@ -3,12 +3,12 @@ package net.saltymc.eaa.commands;
import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.command.argument.EntityArgumentType; import net.minecraft.command.argument.EntityArgumentType;
import net.saltymc.eaa.function.CheckFunction; import net.saltymc.eaa.function.CheckFunction;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.argument; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
public class CheckPlayerCommand extends EaaModCommand{ public class CheckPlayerCommand extends EaaModCommand{

View file

@ -3,13 +3,13 @@ package net.saltymc.eaa.commands;
import com.mojang.brigadier.Command; import com.mojang.brigadier.Command;
import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
public abstract class EaaModCommand implements Command<FabricClientCommandSource> { public abstract class EaaModCommand implements Command<FabricClientCommandSource> {
public EaaModCommand() { public EaaModCommand() {
this(ClientCommandManager.DISPATCHER); this(ClientCommandManager.getActiveDispatcher());
} }
public EaaModCommand(CommandDispatcher<FabricClientCommandSource> dispatcher) { public EaaModCommand(CommandDispatcher<FabricClientCommandSource> dispatcher) {

View file

@ -3,14 +3,13 @@ package net.saltymc.eaa.commands;
import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.client.toast.*; import net.minecraft.client.toast.*;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.util.Formatting; import net.minecraft.util.Formatting;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.argument; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
public class EchoCommand extends EaaModCommand{ public class EchoCommand extends EaaModCommand{
@ -22,9 +21,9 @@ public class EchoCommand extends EaaModCommand{
SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.TUTORIAL_HINT, Text.of("ECHO"), Text.of(nachricht)); SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.TUTORIAL_HINT, Text.of("ECHO"), Text.of(nachricht));
source.sendFeedback( source.sendFeedback(
new LiteralText("You said: ") Text.literal("You said: ")
.formatted(Formatting.RED) .formatted(Formatting.RED)
.append(new LiteralText(nachricht + "")) .append(Text.literal(nachricht + ""))
); );
return 1; return 1;
} }

View file

@ -2,12 +2,12 @@ package net.saltymc.eaa.commands;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.saltymc.eaa.function.TagFunction; import net.saltymc.eaa.function.TagFunction;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
public class ReloadCommand extends EaaModCommand{ public class ReloadCommand extends EaaModCommand{

View file

@ -4,16 +4,16 @@ import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.arguments.StringArgumentType; import com.mojang.brigadier.arguments.StringArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.context.CommandContext;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.command.argument.EntityArgumentType; import net.minecraft.command.argument.EntityArgumentType;
import net.saltymc.eaa.function.TagFunction; import net.saltymc.eaa.function.TagFunction;
import net.saltymc.eaa.util.database.DB_Tag; import net.saltymc.eaa.util.database.DB_Tag;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.argument; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.argument;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal;
public class TagCommand extends EaaModCommand{ public class TagCommand extends EaaModCommand {
@Override @Override
public int run(CommandContext<FabricClientCommandSource> context) { public int run(CommandContext<FabricClientCommandSource> context) {

View file

@ -136,8 +136,9 @@ public final class CustomPlayerListHud {
int aa = s + y * r + y * 5; int aa = s + y * r + y * 5;
int ab = t + ai * 9; int ab = t + ai * 9;
DrawableHelper.fill(stack, aa, ab, aa + r, ab + 8, w); DrawableHelper.fill(stack, aa, ab, aa + r, ab + 8, w);
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); //RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.enableAlphaTest(); RenderSystem.clearColor(1.0F, 1.0F, 1.0F, 1.0F);
//RenderSystem.enableAlphaTest();
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc(); RenderSystem.defaultBlendFunc();
if (x < playerList.size()) { if (x < playerList.size()) {
@ -220,7 +221,8 @@ public final class CustomPlayerListHud {
} else { } else {
// If we don't render ping bars, we need to reset the render system color so the rest // If we don't render ping bars, we need to reset the render system color so the rest
// of the player list renders properly // of the player list renders properly
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); // RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.clearColor(1.0F, 1.0F, 1.0F, 1.0F);
} }
} }
} }

View file

@ -1,9 +1,8 @@
package net.saltymc.eaa.function; package net.saltymc.eaa.function;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.toast.SystemToast; import net.minecraft.client.toast.SystemToast;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Style; import net.minecraft.text.Style;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.minecraft.text.TextColor; import net.minecraft.text.TextColor;
@ -57,10 +56,10 @@ public class CheckFunction {
while (it.hasPrevious()) { while (it.hasPrevious()) {
DB_Tag curr = it.previous(); DB_Tag curr = it.previous();
source.sendFeedback(new LiteralText(dateformat.format(curr.getTagDate())).formatted(Formatting.GRAY) source.sendFeedback(Text.literal(dateformat.format(curr.getTagDate())).formatted(Formatting.GRAY)
.append(new LiteralText(" | ")) .append(Text.literal(" | "))
.append(new LiteralText(curr.getType().getTag()).setStyle(Style.EMPTY.withColor(TextColor.fromRgb(curr.getType().getColor())))) .append(Text.literal(curr.getType().getTag()).setStyle(Style.EMPTY.withColor(TextColor.fromRgb(curr.getType().getColor()))))
.append(new LiteralText(" (" + curr.getGrade() + ") ").formatted(getScaleFormat(curr.getGrade()))) .append(Text.literal(" (" + curr.getGrade() + ") ").formatted(getScaleFormat(curr.getGrade())))
); );
} }
} else { } else {

View file

@ -1,6 +1,6 @@
package net.saltymc.eaa.function; package net.saltymc.eaa.function;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.toast.SystemToast; import net.minecraft.client.toast.SystemToast;
import net.minecraft.text.Text; import net.minecraft.text.Text;
@ -44,15 +44,13 @@ public class LobbyFunction {
} }
} }
switch (dangerLvl){ switch (dangerLvl) {
case 0: case 0 ->
SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.WORLD_BACKUP, Text.of("OKAY!"), Text.of("No Hackers found")); SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.WORLD_BACKUP, Text.of("OKAY!"), Text.of("No Hackers found"));
break; case 1 ->
case 1: SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.TUTORIAL_HINT, Text.of("MEH!"), Text.of("There is an Idiot or Noob!"));
SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.TUTORIAL_HINT, Text.of("MEH!"), Text.of("There is an Idiot or Noob!")); case 2 ->
break; SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.WORLD_ACCESS_FAILURE, Text.of("ALARM!"), Text.of("There is a Hacker!"));
case 2:
SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.WORLD_ACCESS_FAILURE, Text.of("ALARM!"), Text.of("There is a Hacker!"));
} }
} catch (Exception e) { } catch (Exception e) {

View file

@ -1,6 +1,6 @@
package net.saltymc.eaa.function; package net.saltymc.eaa.function;
import net.fabricmc.fabric.api.client.command.v1.FabricClientCommandSource; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.minecraft.client.toast.SystemToast; import net.minecraft.client.toast.SystemToast;
import net.minecraft.text.Text; import net.minecraft.text.Text;
import net.saltymc.eaa.custom.ping.TagDTO; import net.saltymc.eaa.custom.ping.TagDTO;