Skip to content

Commit

Permalink
Update VelocityInjector.java
Browse files Browse the repository at this point in the history
  • Loading branch information
CaaMoe authored Apr 24, 2024
1 parent c1bb5ad commit a69be57
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public void inject(MultiCoreAPI multiCoreAPI) throws NoSuchFieldException, Class
}

// chat
{
StateRegistry.PacketRegistry serverbound = getServerboundPacketRegistry(StateRegistry.PLAY);
StateRegistry.PacketMapping[] playerSessionPacketMapping = {
createPacketMapping(0x20, ProtocolVersion.MINECRAFT_1_19_3, false),
createPacketMapping(0x06, ProtocolVersion.MINECRAFT_1_19_4, false)
};
registerPacket(serverbound, MultiPlayerSession.class, MultiPlayerSession::new, playerSessionPacketMapping);
}
//{
// StateRegistry.PacketRegistry serverbound = getServerboundPacketRegistry(StateRegistry.PLAY);
// StateRegistry.PacketMapping[] playerSessionPacketMapping = {
// createPacketMapping(0x20, ProtocolVersion.MINECRAFT_1_19_3, false),
// createPacketMapping(0x06, ProtocolVersion.MINECRAFT_1_19_4, false)
// };
// registerPacket(serverbound, MultiPlayerSession.class, MultiPlayerSession::new, playerSessionPacketMapping);
// }
}

private StateRegistry.PacketRegistry getServerboundPacketRegistry(StateRegistry stateRegistry) throws NoSuchFieldException, IllegalAccessException {
Expand Down Expand Up @@ -123,4 +123,4 @@ private <P extends MinecraftPacket> void registerPacket(StateRegistry.PacketRegi
Method register = ReflectUtil.handleAccessible(packetRegistry.getClass().getDeclaredMethod("register", Class.class, Supplier.class, StateRegistry.PacketMapping[].class));
register.invoke(packetRegistry, clazz, packetSupplier, mappings);
}
}
}

0 comments on commit a69be57

Please sign in to comment.