-
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix plugin messages on Fabric platform (#1248)
- Loading branch information
Showing
6 changed files
with
22 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 9 additions & 3 deletions
12
.../izzel/arclight/fabric/mixin/core/network/ServerCommonPacketListenerImplMixin_Fabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
package io.izzel.arclight.fabric.mixin.core.network; | ||
|
||
import io.izzel.arclight.common.bridge.core.network.common.ServerCommonPacketListenerBridge; | ||
import net.fabricmc.fabric.impl.networking.payload.RetainedPayload; | ||
import net.fabricmc.fabric.impl.networking.payload.UntypedPayload; | ||
import net.minecraft.network.FriendlyByteBuf; | ||
import net.minecraft.network.protocol.common.custom.DiscardedPayload; | ||
import net.minecraft.network.protocol.common.ServerboundCustomPayloadPacket; | ||
import net.minecraft.server.network.ServerCommonPacketListenerImpl; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
@Mixin(ServerCommonPacketListenerImpl.class) | ||
public abstract class ServerCommonPacketListenerImplMixin_Fabric implements ServerCommonPacketListenerBridge { | ||
|
||
@Override | ||
public FriendlyByteBuf bridge$getDiscardedData(DiscardedPayload payload) { | ||
// Todo: Payload data. | ||
public FriendlyByteBuf bridge$getDiscardedData(ServerboundCustomPayloadPacket packet) { | ||
if (packet.payload() instanceof RetainedPayload r) { | ||
return r.buf(); | ||
} else if (packet.payload() instanceof UntypedPayload r) { | ||
return r.buffer(); | ||
} | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters