Skip to content

Commit

Permalink
1.20.1 Add UUID Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Satxm committed Aug 18, 2024
1 parent 179cd25 commit ac5095b
Show file tree
Hide file tree
Showing 26 changed files with 1,041 additions and 734 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[3]: https://img.shields.io/curseforge/dt/450250?label=CurseForge%0aDownloads&logo=curseforge&style=flat&color=E36639&labelcolor=2D2D2D
[4]: https://www.curseforge.com/minecraft/mc-mods/mcwifipnp

[5]: https://img.shields.io/badge/Available%20for-%201.15%20to%201.20-47376F?logo=files&color=377BCB&labelcolor=2D2D2D
[5]: https://img.shields.io/badge/Available%20for-%201.15%20to%201.21-47376F?logo=files&color=377BCB&labelcolor=2D2D2D
[6]: https://modrinth.com/mod/mcwifipnp/versions

[7]: https://img.shields.io/github/license/Satxm/mcwifipnp?label=License&logo=github&style=flat&color=E51050&labelcolor=2D2D2D
Expand All @@ -39,13 +39,13 @@ GitHub 源码: [https://github.com/Satxm/mcwifipnp](https://github.com/Satxm/mcw

## Introduction - 简介

**This Branch is for Minecraft 1.20 ~ 1.20.1 only!**
**This Branch is for Minecraft 1.20 - 1.20.1 only!**

**这个分支仅适用于 Minecraft 版本 1.20 ~ 1.20.1 !**
**这个分支仅适用于 Minecraft 版本 1.20 - 1.20.1 !**

Updated to Minecraft 1.20.x, Uses the vanilla Minecraft GUI style, Uses the official mojang mappings.
Uses the vanilla Minecraft GUI style, Uses the official mojang mappings.

已经更新到1.20.x,使用Minecraft原生界面样式,使用Mojang官方混淆表。
使用Minecraft原生界面样式,使用Mojang官方混淆表。

Modified from [TheGlitch76/mcpnp](https://github.com/TheGlitch76/mcpnp) project and UPnP module from [adolfintel/WaifUPnP](https://github.com/adolfintel/WaifUPnP).

Expand All @@ -63,6 +63,8 @@ Modified from [TheGlitch76/mcpnp](https://github.com/TheGlitch76/mcpnp) project

## What Can It Do - 它的作用

添加了 UUID 修复模块,对于离线玩家,可以使离线玩家从mojang服务器获取对应的UUID,使UUID固定,不会因为客户端变化而变化。

Allows you to change the port number of the LAN world and choose whether to map this port to the public network using UPnP (if your router supports UPnP).

允许你修改局域网世界的端口号,并选择是否映射这个端口使用UPnP映射到公网(如果你的路由器支持UPnP)。
Expand Down
4 changes: 2 additions & 2 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17

base {
archivesBaseName = project.archives_base_name
archivesName = project.mod_id
}
version = project.mod_version + "-" + project.minecraft_version + "-fabric"
group = project.maven_group
Expand All @@ -14,8 +14,8 @@ dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}"

modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "com.google.code.findbugs:jsr305:3.0.2"

}

Expand Down
11 changes: 2 additions & 9 deletions fabric/src/main/java/io/github/satxm/mcwifipnp/MCWiFiPnP.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.PauseScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.server.IntegratedServer;
import net.minecraft.network.chat.Component;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.commands.BanIpCommands;
Expand All @@ -19,8 +18,6 @@
import net.minecraft.server.commands.DeOpCommands;
import net.minecraft.server.commands.OpCommand;
import net.minecraft.server.commands.WhitelistCommand;
import net.minecraft.server.players.PlayerList;
import io.github.satxm.mcwifipnp.mixin.PlayerListAccessor;

public class MCWiFiPnP implements ModInitializer {
public static final String MODID = "mcwifipnp";
Expand All @@ -38,7 +35,8 @@ public void onInitialize() {
BanIpCommands.register(dispatcher);
BanListCommands.register(dispatcher);
BanPlayerCommands.register(dispatcher);
});
OfflinePlayerCommand.register(dispatcher);
});
}

public static void afterScreenInit(Minecraft client, Screen screen, int i, int j) {
Expand All @@ -62,9 +60,4 @@ private void onServerStop(MinecraftServer server) {
MCWiFiPnPUnit.CloseUPnPPort(server);
}

public static void setMaxPlayers(IntegratedServer server, int num) {
PlayerList playerList = server.getPlayerList();
((PlayerListAccessor)playerList).setMaxPlayers(num);
}

}
12 changes: 0 additions & 12 deletions fabric/src/main/resources/mcwifipnp.mixins.json

This file was deleted.

20 changes: 15 additions & 5 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ plugins {
id 'eclipse'
id 'idea'
id 'net.minecraftforge.gradle' version '[6.0.16,6.2)'
id 'org.spongepowered.mixin' version '0.7.+'
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"

version = project.mod_version + "-" + project.minecraft_version + "-forge"
group = project.maven_group

base {
archivesBaseName = project.archives_base_name
archivesName = project.mod_id
}
java.toolchain.languageVersion = JavaLanguageVersion.of(17)

println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"

minecraft {

mappings channel: 'official', version: project.minecraft_version
Expand Down Expand Up @@ -60,6 +61,15 @@ sourceSets {
}
}

mixin {
// MixinGradle Settings
add sourceSets.main, 'mcwifipnp.refmap.json'
config 'mcwifipnp.mixins.json'

debug.verbose = true
debug.export = true
}

jar {
manifest {
attributes([
Expand Down
7 changes: 0 additions & 7 deletions forge/src/main/java/io/github/satxm/mcwifipnp/MCWiFiPnP.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.PauseScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.server.IntegratedServer;
import net.minecraft.network.chat.Component;
import net.minecraft.server.commands.BanIpCommands;
import net.minecraft.server.commands.BanListCommands;
import net.minecraft.server.commands.BanPlayerCommands;
import net.minecraft.server.commands.DeOpCommands;
import net.minecraft.server.commands.OpCommand;
import net.minecraft.server.commands.WhitelistCommand;
import net.minecraft.server.players.PlayerList;
import net.minecraftforge.client.event.ScreenEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegisterCommandsEvent;
Expand Down Expand Up @@ -59,11 +57,6 @@ public void onServerStopping(ServerStoppingEvent event) {
MCWiFiPnPUnit.CloseUPnPPort(event.getServer());
}

public static void setMaxPlayers(IntegratedServer server, int num) {
PlayerList playerList = server.getPlayerList();
playerList.maxPlayers = num;
}

public static void onAfterInitScreen(Minecraft minecraft, Screen screen, List<GuiEventListener> children,
Consumer<GuiEventListener> add, Consumer<GuiEventListener> remove) {
if (screen instanceof PauseScreen pauseScreen && screen.getClass() == PauseScreen.class) {
Expand Down
1 change: 0 additions & 1 deletion forge/src/main/resources/META-INF/accesstransformer.cfg

This file was deleted.

6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ org.gradle.jvmargs = -Xmx4G
org.gradle.daemon = true

# Mod Properties
mod_version = 1.7.1
mod_version = 1.7.2
maven_group = io.github.satxm.mcwifipnp
archives_base_name = mcwifipnp
mod_id = mcwifipnp

minecraft_version = 1.20.1

# Forge Properties on https://files.minecraftforge.net/net/minecraftforge/forge/promotions_slim.json
forge_version = 47.3.0
forge_version = 47.3.6

# Fabric Properties on https://fabricmc.net/develop/
fabric_loader_version = 0.15.11
Expand Down
3 changes: 2 additions & 1 deletion quilt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
}

base {
archivesBaseName = project.archives_base_name
archivesName = project.mod_id
}
version = project.mod_version + "-" + project.minecraft_version + "-quilt"
group = project.maven_group
Expand All @@ -15,6 +15,7 @@ dependencies {
}
modImplementation "org.quiltmc:quilt-loader:${project.quilt_loader_version}"
modImplementation "org.quiltmc:qsl:${qsl_version}"
modImplementation "com.google.code.findbugs:jsr305:3.0.2"
}

sourceSets {
Expand Down
8 changes: 0 additions & 8 deletions quilt/src/main/java/io/github/satxm/mcwifipnp/MCWiFiPnP.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.PauseScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.server.IntegratedServer;
import net.minecraft.network.chat.Component;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.commands.BanIpCommands;
Expand All @@ -20,8 +19,6 @@
import net.minecraft.server.commands.DeOpCommands;
import net.minecraft.server.commands.OpCommand;
import net.minecraft.server.commands.WhitelistCommand;
import net.minecraft.server.players.PlayerList;
import io.github.satxm.mcwifipnp.mixin.PlayerListAccessor;

public class MCWiFiPnP implements ModInitializer {
public static final String MODID = "mcwifipnp";
Expand Down Expand Up @@ -63,9 +60,4 @@ private void onServerStop(MinecraftServer server) {
MCWiFiPnPUnit.CloseUPnPPort(server);
}

public static void setMaxPlayers(IntegratedServer server, int num) {
PlayerList playerList = server.getPlayerList();
((PlayerListAccessor)playerList).setMaxPlayers(num);
}

}

This file was deleted.

12 changes: 0 additions & 12 deletions quilt/src/main/resources/mcwifipnp.mixins.json

This file was deleted.

Loading

0 comments on commit ac5095b

Please sign in to comment.