-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb7e3a7
commit d6a4759
Showing
8 changed files
with
155 additions
and
75 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
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
8 changes: 8 additions & 0 deletions
8
src/main/java/net/earthcomputer/clientcommands/interfaces/IClientPacketListener_C2C.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package net.earthcomputer.clientcommands.interfaces; | ||
|
||
import net.earthcomputer.clientcommands.c2c.C2CPacketListener; | ||
import net.minecraft.network.ProtocolInfo; | ||
|
||
public interface IClientPacketListener_C2C { | ||
ProtocolInfo<C2CPacketListener> clientcommands_getC2CProtocolInfo(); | ||
} |
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
28 changes: 28 additions & 0 deletions
28
src/main/java/net/earthcomputer/clientcommands/mixin/c2c/ClientPacketListenerMixin.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package net.earthcomputer.clientcommands.mixin.c2c; | ||
|
||
import net.earthcomputer.clientcommands.c2c.C2CPacketHandler; | ||
import net.earthcomputer.clientcommands.c2c.C2CPacketListener; | ||
import net.earthcomputer.clientcommands.interfaces.IClientPacketListener_C2C; | ||
import net.minecraft.client.multiplayer.ClientPacketListener; | ||
import net.minecraft.core.RegistryAccess; | ||
import net.minecraft.network.ProtocolInfo; | ||
import net.minecraft.network.RegistryFriendlyByteBuf; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
@Mixin(ClientPacketListener.class) | ||
public class ClientPacketListenerMixin implements IClientPacketListener_C2C { | ||
@Shadow | ||
@Final | ||
private RegistryAccess.Frozen registryAccess; | ||
|
||
@Unique | ||
private final ProtocolInfo<C2CPacketListener> c2cProtocolInfo = C2CPacketHandler.PROTOCOL_UNBOUND.bind(RegistryFriendlyByteBuf.decorator(registryAccess)); | ||
|
||
@Override | ||
public ProtocolInfo<C2CPacketListener> clientcommands_getC2CProtocolInfo() { | ||
return c2cProtocolInfo; | ||
} | ||
} |
Oops, something went wrong.