What is the method of sending packets(Or usage)
-
When I write my JS, I need to send a c0epacket, but I use the method in V1, that is, the mc.thePlayer.sendQueue.addToSendQueue method, but it doesn't work. It tells me that this method doesn't exist. So who can tell me how to send packet(Or usage .One possibility is that this function exists, but its method has changed)
-
When I write my JS, I need to send a c0epacket, but I use the method in V1, that is, the mc.thePlayer.sendQueue.addToSendQueue method, but it doesn't work. It tells me that this method doesn't exist. So who can tell me how to send packet(Or usage .One possibility is that this function exists, but its method has changed)
Core
sendPacket(new C0EPacketClickWindow); -
Core
sendPacket(new C0EPacketClickWindow);@plumer-man I found the sendpacket function from the core. The content is: function sendpacket (packet, trigger event){
_networkManager = mc.getNetHandler().getNetworkManager();
if (triggerEvent) _networkManager.sendPacket(packet);
else if (_networkManager.isChannelOpen()) {
_flushOutboundQueueMethod.invoke(_networkManager);
_dispatchPacketMethod.invoke(_networkManager, packet, null);
} else {
_readWriteLockField.get(_networkManager).writeLock().lock();
try {
_outboundPackets = _outboundPacketsQueueField.get(_networkManager);
_outboundPackets.add(new NetworkManager.InboundHandlerTuplePacketListener(packet, null));
_outboundPacketsQueueField.set(_networkManager, _outboundPackets);
} finally {
_readWriteLockField.get(_networkManager).writeLock().unlock();
}
}
-
@plumer-man I found the sendpacket function from the core. The content is: function sendpacket (packet, trigger event){
_networkManager = mc.getNetHandler().getNetworkManager();
if (triggerEvent) _networkManager.sendPacket(packet);
else if (_networkManager.isChannelOpen()) {
_flushOutboundQueueMethod.invoke(_networkManager);
_dispatchPacketMethod.invoke(_networkManager, packet, null);
} else {
_readWriteLockField.get(_networkManager).writeLock().lock();
try {
_outboundPackets = _outboundPacketsQueueField.get(_networkManager);
_outboundPackets.add(new NetworkManager.InboundHandlerTuplePacketListener(packet, null));
_outboundPacketsQueueField.set(_networkManager, _outboundPackets);
} finally {
_readWriteLockField.get(_networkManager).writeLock().unlock();
}
}
@wowiesocl said in What is the method of sending packets(Or usage):
@plumer-man I found the sendpacket function from the core. The content is: function sendpacket (packet, trigger event){
_networkManager = mc.getNetHandler().getNetworkManager();
if (triggerEvent) _networkManager.sendPacket(packet);
else if (_networkManager.isChannelOpen()) {
_flushOutboundQueueMethod.invoke(_networkManager);
_dispatchPacketMethod.invoke(_networkManager, packet, null);
} else {
_readWriteLockField.get(_networkManager).writeLock().lock();
try {
_outboundPackets = _outboundPacketsQueueField.get(_networkManager);
_outboundPackets.add(new NetworkManager.InboundHandlerTuplePacketListener(packet, null));
_outboundPacketsQueueField.set(_networkManager, _outboundPackets);
} finally {
_readWriteLockField.get(_networkManager).writeLock().unlock();
}
}
Well, this is the silent way of sending a packet.
-
@fart no, it doesn't trigger onPacket event
and dyskord.cc is dead
-
@wowiesocl said in What is the method of sending packets(Or usage):
@plumer-man I found the sendpacket function from the core. The content is: function sendpacket (packet, trigger event){
_networkManager = mc.getNetHandler().getNetworkManager();
if (triggerEvent) _networkManager.sendPacket(packet);
else if (_networkManager.isChannelOpen()) {
_flushOutboundQueueMethod.invoke(_networkManager);
_dispatchPacketMethod.invoke(_networkManager, packet, null);
} else {
_readWriteLockField.get(_networkManager).writeLock().lock();
try {
_outboundPackets = _outboundPacketsQueueField.get(_networkManager);
_outboundPackets.add(new NetworkManager.InboundHandlerTuplePacketListener(packet, null));
_outboundPacketsQueueField.set(_networkManager, _outboundPackets);
} finally {
_readWriteLockField.get(_networkManager).writeLock().unlock();
}
}
Well, this is the silent way of sending a packet.
-
@plumer-man I found the sendpacket function from the core. The content is: function sendpacket (packet, trigger event){
_networkManager = mc.getNetHandler().getNetworkManager();
if (triggerEvent) _networkManager.sendPacket(packet);
else if (_networkManager.isChannelOpen()) {
_flushOutboundQueueMethod.invoke(_networkManager);
_dispatchPacketMethod.invoke(_networkManager, packet, null);
} else {
_readWriteLockField.get(_networkManager).writeLock().lock();
try {
_outboundPackets = _outboundPacketsQueueField.get(_networkManager);
_outboundPackets.add(new NetworkManager.InboundHandlerTuplePacketListener(packet, null));
_outboundPacketsQueueField.set(_networkManager, _outboundPackets);
} finally {
_readWriteLockField.get(_networkManager).writeLock().unlock();
}
}
@wowiesocl use the
inline codeoption pls
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login