mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-12-22 16:28:12 +01:00
Fix sendRawPacket, do not use bungee movement transmitter
This commit is contained in:
parent
2f0ea9d55e
commit
274b80a682
@ -34,10 +34,10 @@ public class VRInHandler extends ByteToMessageDecoder {
|
|||||||
if (user.isActive()) {
|
if (user.isActive()) {
|
||||||
// Handle ID
|
// Handle ID
|
||||||
int id = Type.VAR_INT.read(msg);
|
int id = Type.VAR_INT.read(msg);
|
||||||
// Transform
|
|
||||||
ByteBuf newPacket = msg.alloc().buffer();
|
|
||||||
|
|
||||||
if (id != PacketWrapper.PASSTHROUGH_ID) {
|
if (id != PacketWrapper.PASSTHROUGH_ID) {
|
||||||
|
// Transform
|
||||||
|
ByteBuf newPacket = msg.alloc().buffer();
|
||||||
try {
|
try {
|
||||||
PacketWrapper wrapper = new PacketWrapper(id, msg, user);
|
PacketWrapper wrapper = new PacketWrapper(id, msg, user);
|
||||||
ProtocolInfo protInfo = user.get(ProtocolInfo.class);
|
ProtocolInfo protInfo = user.get(ProtocolInfo.class);
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
package com.github.creeper123123321.viarift.platform;
|
package com.github.creeper123123321.viarift.platform;
|
||||||
|
|
||||||
import us.myles.ViaVersion.api.Via;
|
|
||||||
import us.myles.ViaVersion.api.platform.ViaPlatformLoader;
|
import us.myles.ViaVersion.api.platform.ViaPlatformLoader;
|
||||||
import us.myles.ViaVersion.bungee.providers.BungeeMovementTransmitter;
|
|
||||||
import us.myles.ViaVersion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
|
|
||||||
|
|
||||||
public class VRLoader implements ViaPlatformLoader {
|
public class VRLoader implements ViaPlatformLoader {
|
||||||
@Override
|
@Override
|
||||||
public void load() {
|
public void load() {
|
||||||
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new BungeeMovementTransmitter());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.github.creeper123123321.viarift.platform;
|
package com.github.creeper123123321.viarift.platform;
|
||||||
|
|
||||||
|
import com.github.creeper123123321.viarift.util.PipelineUtil;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelFuture;
|
import io.netty.channel.ChannelFuture;
|
||||||
@ -7,7 +8,6 @@ import io.netty.channel.socket.SocketChannel;
|
|||||||
import us.myles.ViaVersion.api.PacketWrapper;
|
import us.myles.ViaVersion.api.PacketWrapper;
|
||||||
import us.myles.ViaVersion.api.data.UserConnection;
|
import us.myles.ViaVersion.api.data.UserConnection;
|
||||||
import us.myles.ViaVersion.api.type.Type;
|
import us.myles.ViaVersion.api.type.Type;
|
||||||
import us.myles.ViaVersion.util.PipelineUtil;
|
|
||||||
|
|
||||||
|
|
||||||
public class VRUserConnection extends UserConnection {
|
public class VRUserConnection extends UserConnection {
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.github.creeper123123321.viarift.util;
|
||||||
|
|
||||||
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
import io.netty.channel.ChannelPipeline;
|
||||||
|
|
||||||
|
public class PipelineUtil {
|
||||||
|
public static ChannelHandlerContext getContextBefore(String name, ChannelPipeline pipe) {
|
||||||
|
String previous = null;
|
||||||
|
for (String current : pipe.names()) {
|
||||||
|
if (name.equals(current))
|
||||||
|
break;
|
||||||
|
previous = current;
|
||||||
|
}
|
||||||
|
return pipe.context(previous);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user