mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Update to Fabric 1.20.2
This commit is contained in:
1 parent
743ea6e057
commit
861a81f501
4 files changed
+19
-12
No files matched your search
@@ -15,8 +15,8 @@ dependencies {
|
|||||||
minecraft(libs.fabricMinecraft)
|
minecraft(libs.fabricMinecraft)
|
||||||
mappings(loom.officialMojangMappings())
|
mappings(loom.officialMojangMappings())
|
||||||
modImplementation(libs.fabricLoader)
|
modImplementation(libs.fabricLoader)
|
||||||
modImplementation("net.fabricmc.fabric-api:fabric-api:0.83.0+1.20.1")
|
modImplementation("net.fabricmc.fabric-api:fabric-api:0.89.3+1.20.2")
|
||||||
modImplementation("net.fabricmc.fabric-api:fabric-api-deprecated:0.83.0+1.20.1") // LuckPerms needs to work at dev time
|
modImplementation("net.fabricmc.fabric-api:fabric-api-deprecated:0.89.3+1.20.2") // LuckPerms needs to work at dev time
|
||||||
|
|
||||||
carbon(projects.carbonchatCommon) {
|
carbon(projects.carbonchatCommon) {
|
||||||
exclude("net.kyori", "adventure-api")
|
exclude("net.kyori", "adventure-api")
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import net.minecraft.network.Connection;
|
|||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
|
import net.minecraft.server.network.CommonListenerCookie;
|
||||||
import net.minecraft.server.players.PlayerList;
|
import net.minecraft.server.players.PlayerList;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
@@ -52,7 +53,7 @@ abstract class PlayerListMixin {
|
|||||||
public Map<Thread, Pair<Component, Boolean>> carbon$joinMsg = new ConcurrentHashMap<>();
|
public Map<Thread, Pair<Component, Boolean>> carbon$joinMsg = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
@Redirect(
|
@Redirect(
|
||||||
method = "placeNewPlayer(Lnet/minecraft/network/Connection;Lnet/minecraft/server/level/ServerPlayer;)V",
|
method = "placeNewPlayer",
|
||||||
at = @At(
|
at = @At(
|
||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lnet/minecraft/server/players/PlayerList;broadcastSystemMessage(Lnet/minecraft/network/chat/Component;Z)V"
|
target = "Lnet/minecraft/server/players/PlayerList;broadcastSystemMessage(Lnet/minecraft/network/chat/Component;Z)V"
|
||||||
@@ -64,10 +65,10 @@ abstract class PlayerListMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Inject(
|
@Inject(
|
||||||
method = "placeNewPlayer(Lnet/minecraft/network/Connection;Lnet/minecraft/server/level/ServerPlayer;)V",
|
method = "placeNewPlayer",
|
||||||
at = @At("RETURN")
|
at = @At("RETURN")
|
||||||
)
|
)
|
||||||
public void injectJoin(final Connection connection, final ServerPlayer serverPlayer, final CallbackInfo ci) {
|
public void injectJoin(final Connection connection, final ServerPlayer serverPlayer, final CommonListenerCookie cookie, final CallbackInfo ci) {
|
||||||
final @Nullable Pair<Component, Boolean> remove = this.carbon$joinMsg.remove(Thread.currentThread());
|
final @Nullable Pair<Component, Boolean> remove = this.carbon$joinMsg.remove(Thread.currentThread());
|
||||||
if (remove != null) {
|
if (remove != null) {
|
||||||
final PlayerStatusMessageEvents.MessageEvent event = PlayerStatusMessageEvents.MessageEvent.of(
|
final PlayerStatusMessageEvents.MessageEvent event = PlayerStatusMessageEvents.MessageEvent.of(
|
||||||
|
|||||||
+10
-4
@@ -21,28 +21,34 @@ package net.draycia.carbon.fabric.mixin;
|
|||||||
|
|
||||||
import net.draycia.carbon.fabric.callback.PlayerStatusMessageEvents;
|
import net.draycia.carbon.fabric.callback.PlayerStatusMessageEvents;
|
||||||
import net.kyori.adventure.platform.fabric.FabricServerAudiences;
|
import net.kyori.adventure.platform.fabric.FabricServerAudiences;
|
||||||
|
import net.minecraft.network.Connection;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
import net.minecraft.network.protocol.game.ServerGamePacketListener;
|
import net.minecraft.network.protocol.game.ServerGamePacketListener;
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
|
import net.minecraft.server.network.CommonListenerCookie;
|
||||||
|
import net.minecraft.server.network.ServerCommonPacketListenerImpl;
|
||||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||||
import net.minecraft.server.players.PlayerList;
|
import net.minecraft.server.players.PlayerList;
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import org.spongepowered.asm.mixin.Final;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
@Mixin(ServerGamePacketListenerImpl.class)
|
@Mixin(ServerGamePacketListenerImpl.class)
|
||||||
abstract class ServerGamePacketListenerImplMixin implements ServerGamePacketListener {
|
abstract class ServerGamePacketListenerImplMixin extends ServerCommonPacketListenerImpl implements ServerGamePacketListener {
|
||||||
|
|
||||||
@Shadow @Final private MinecraftServer server;
|
//@Shadow @Final private MinecraftServer server;
|
||||||
|
|
||||||
@Shadow public ServerPlayer player;
|
@Shadow public ServerPlayer player;
|
||||||
|
|
||||||
|
public ServerGamePacketListenerImplMixin(final MinecraftServer minecraftServer, final Connection connection, final CommonListenerCookie commonListenerCookie) {
|
||||||
|
super(minecraftServer, connection, commonListenerCookie);
|
||||||
|
}
|
||||||
|
|
||||||
@Redirect(
|
@Redirect(
|
||||||
method = "onDisconnect(Lnet/minecraft/network/chat/Component;)V",
|
method = "removePlayerFromWorld()V",
|
||||||
at = @At(
|
at = @At(
|
||||||
value = "INVOKE",
|
value = "INVOKE",
|
||||||
target = "Lnet/minecraft/server/players/PlayerList;broadcastSystemMessage(Lnet/minecraft/network/chat/Component;Z)V"
|
target = "Lnet/minecraft/server/players/PlayerList;broadcastSystemMessage(Lnet/minecraft/network/chat/Component;Z)V"
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ versions:
|
|||||||
guice: 5.1.0
|
guice: 5.1.0
|
||||||
velocityApi: 3.2.0-SNAPSHOT
|
velocityApi: 3.2.0-SNAPSHOT
|
||||||
geantyref: 1.3.11
|
geantyref: 1.3.11
|
||||||
minecraft: 1.20.1
|
minecraft: 1.20.2
|
||||||
fabricLoader: 0.14.21
|
fabricLoader: 0.14.22
|
||||||
adventurePlatformFabric: 5.9.0
|
adventurePlatformFabric: 5.10.0
|
||||||
luckPermsApi: 5.3
|
luckPermsApi: 5.3
|
||||||
essentialsx: 2.19.3
|
essentialsx: 2.19.3
|
||||||
discordsrv: 1.26.0
|
discordsrv: 1.26.0
|
||||||
|
|||||||
Reference in new issue
Block a user