Skip to content

Commit

Permalink
Update to 1.20.3
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCartes committed Dec 3, 2023
1 parent 3e3b4a7 commit e608ee9
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 30 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 3.0.20
##### Minecraft 1.20.3

Update dependencies

### 3.0.19
##### Minecraft 1.20[.1], 1.20.2

Expand Down
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ dependencies {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Translations
include modImplementation("xyz.nucleoid:server-translations-api:${project.server_translations_version}+${project.server_translations_branch}")
include modImplementation("xyz.nucleoid:server-translations-api:${project.server_translations_version}")

// Permissions
include modImplementation("me.lucko:fabric-permissions-api:${project.fabric_permissions_version}")

// Placeholder API
include modImplementation("eu.pb4:placeholder-api:${project.placeholder_api_version}+${project.placeholder_api_branch}")
include modImplementation("eu.pb4:placeholder-api:${project.placeholder_api_version}")

// Mods
modCompileOnly "org.geysermc.floodgate:api:${floodgate_api_version}"
Expand Down Expand Up @@ -104,11 +104,11 @@ modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("aZj58GfX")
versionNumber.set("${project.version}")
versionName = "[1.20.2] ${project.version}"
versionName = "[1.20.3] ${project.version}"
versionType = "beta"
changelog.set("Release notes:\nhttps://github.com/NikitaCartes/EasyAuth/releases/tag/${project.version}\n\nChangelog:\nhttps://github.com/NikitaCartes/EasyAuth/tree/HEAD/CHANGELOG.md")
uploadFile = remapJar
gameVersions.addAll("1.20.2")
gameVersions.addAll("1.20.3")
loaders = ["fabric", "quilt"]
dependencies {
required.project("P7dR8mSH") // Fabric API
Expand All @@ -129,10 +129,10 @@ curseforge {
addGameVersion("Java 18")
addGameVersion("Java 17")

addGameVersion("1.20.2")
addGameVersion("1.20.3")

mainArtifact(remapJar) {
displayName = "[1.20.2] ${project.version}"
displayName = "[1.20.3] ${project.version}"
relations {
requiredDependency("fabric-api")
embeddedLibrary 'server-translation-api'
Expand Down
26 changes: 12 additions & 14 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
# Mod
mod_name=EasyAuth
mod_id=easyauth
mod_version=3.0.19
mod_version=3.0.20

# Fabric
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.1
loader_version=0.14.22
fabric_version=0.89.1+1.20.2
minecraft_version=1.20.3-rc1
yarn_mappings=1.20.3-rc1+build.2
loader_version=0.15.0
fabric_version=0.91.1+1.20.3

# Dependencies
server_translations_version=2.1.0
server_translations_branch=1.20.2-rc2
server_translations_version=2.2.0+1.20.3-rc1
fabric_permissions_version=0.2-SNAPSHOT
floodgate_api_version=2.2.0-20220810.210256-12
placeholder_api_version=2.2.0
placeholder_api_branch=1.20.2
placeholder_api_version=2.3.0+1.20.3

argon2_version=2.11
bcrypt_version=0.9.0
bytes_version=1.5.0
bcrypt_version=0.10.2
bytes_version=1.6.1
leveldb_version=0.12
mongodb_version=4.7.2
mysql_version=8.0.33
jna_version=5.12.1
mongodb_version=4.11.1
mysql_version=8.2.0
jna_version=5.13.0

# Other
org.gradle.jvmargs=-Xmx1G
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.TypedActionResult;
import net.minecraft.util.Uuids;
import net.minecraft.util.math.BlockPos;
import xyz.nikitacartes.easyauth.storage.AuthConfig;
import xyz.nikitacartes.easyauth.storage.PlayerCache;
Expand Down Expand Up @@ -286,8 +287,8 @@ public static ActionResult onUseEntity(PlayerEntity player) {
}

public static void onPreLogin(ServerLoginNetworkHandler netHandler, MinecraftServer server, PacketSender packetSender, ServerLoginNetworking.LoginSynchronizer sync) {
if (config.experimental.forcedOfflineUuids) {
netHandler.profile = ServerLoginNetworkHandler.createOfflineProfile(netHandler.profile.getName());
if (config.experimental.forcedOfflineUuids && netHandler.profile != null) {
netHandler.profile = Uuids.getOfflinePlayerProfile(netHandler.profile.getName());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import xyz.nikitacartes.easyauth.event.AuthEventHandler;

import static xyz.nikitacartes.easyauth.utils.TranslationHelper.getLoginRequired;

@Mixin(CommandManager.class)
public class CommandManagerMixin {
@Inject(method = "execute(Lcom/mojang/brigadier/ParseResults;Ljava/lang/String;)I", at = @At("HEAD"), cancellable = true)
private void checkCanUseCommands(ParseResults<ServerCommandSource> parseResults, String command, CallbackInfoReturnable<Integer> cir) {
@Inject(method = "execute(Lcom/mojang/brigadier/ParseResults;Ljava/lang/String;)V", at = @At("HEAD"), cancellable = true)
private void checkCanUseCommands(ParseResults<ServerCommandSource> parseResults, String command, CallbackInfo ci) {
ActionResult result = AuthEventHandler.onPlayerCommand(parseResults.getContext().getSource().getPlayer(), command);
if (result == ActionResult.FAIL) {
cir.setReturnValue(1);
parseResults.getContext().getSource().sendError(getLoginRequired());
ci.cancel();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public abstract class ServerPlayNetworkHandlerMixin {
method = "onChatMessage(Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;validateMessage(Ljava/lang/String;Ljava/time/Instant;Lnet/minecraft/network/message/LastSeenMessageList$Acknowledgment;)Ljava/util/Optional;",
target = "Lnet/minecraft/server/network/ServerPlayNetworkHandler;validateMessage(Lnet/minecraft/network/message/LastSeenMessageList$Acknowledgment;)Ljava/util/Optional;",
shift = At.Shift.BEFORE
),
cancellable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtIo;
import net.minecraft.nbt.NbtTagSizeTracker;
import net.minecraft.util.Uuids;
import net.minecraft.world.WorldSaveHandler;
import org.spongepowered.asm.mixin.Final;
Expand Down Expand Up @@ -75,7 +76,7 @@ private NbtCompound migratePlayerData(NbtCompound compoundTag, PlayerEntity play
File file = new File(this.playerDataDir, Uuids.getOfflinePlayerUuid(player.getGameProfile().getName()) + ".dat");
if (file.exists() && file.isFile())
try {
compoundTag = NbtIo.readCompressed(new FileInputStream(file));
compoundTag = NbtIo.readCompressed(new FileInputStream(file), NbtTagSizeTracker.ofUnlimitedBytes());
} catch (IOException e) {
LogWarn(String.format("Failed to load player data for: %s", playername));
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/easyauth.accesswidener
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
accessWidener v1 named

accessible class net/minecraft/server/network/ServerLoginNetworkHandler$State
accessible method net/minecraft/server/network/ServerLoginNetworkHandler createOfflineProfile (Ljava/lang/String;)Lcom/mojang/authlib/GameProfile;
accessible field net/minecraft/server/network/ServerLoginNetworkHandler profile Lcom/mojang/authlib/GameProfile;
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"depends": {
"fabric-api": "*",
"fabricloader": "*",
"minecraft": ">=1.20.2-"
"minecraft": ">=1.20.3-"
},
"suggests": {
"fabric-permissions-api-v0": "*"
Expand Down

0 comments on commit e608ee9

Please sign in to comment.