Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-25 07:40:08 +01:00
Format some lines properly
Dieser Commit ist enthalten in:
Ursprung
8e6d76296d
Commit
114a7b6bd6
@ -1,10 +1,10 @@
|
||||
package us.myles.ViaVersion.transformers;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import us.myles.ViaVersion.*;
|
||||
import us.myles.ViaVersion.CancelException;
|
||||
import us.myles.ViaVersion.ConnectionInfo;
|
||||
import us.myles.ViaVersion.ViaVersionPlugin;
|
||||
import us.myles.ViaVersion.packets.PacketType;
|
||||
import us.myles.ViaVersion.packets.State;
|
||||
import us.myles.ViaVersion.util.PacketUtil;
|
||||
@ -202,12 +202,12 @@ public class IncomingTransformer {
|
||||
}
|
||||
if (packet == PacketType.PLAY_USE_ITEM) {
|
||||
output.clear();
|
||||
PacketUtil.writeVarInt(PacketType.PLAY_PLAYER_BLOCK_PLACEMENT.getPacketID(), output);
|
||||
// Simulate using item :)
|
||||
output.writeLong(-1L);
|
||||
output.writeByte(255);
|
||||
// write item in hand
|
||||
ItemStack inHand = ViaVersionPlugin.getHandItem(info);
|
||||
PacketUtil.writeVarInt(PacketType.PLAY_PLAYER_BLOCK_PLACEMENT.getPacketID(), output);
|
||||
// Simulate using item :)
|
||||
output.writeLong(-1L);
|
||||
output.writeByte(255);
|
||||
// write item in hand
|
||||
ItemStack inHand = ViaVersionPlugin.getHandItem(info);
|
||||
Object item = null;
|
||||
try {
|
||||
Method m = ReflectionUtil.obc("inventory.CraftItemStack").getDeclaredMethod("asNMSCopy", ItemStack.class);
|
||||
@ -222,10 +222,10 @@ public class IncomingTransformer {
|
||||
e.printStackTrace();
|
||||
}
|
||||
PacketUtil.writeItem(item, output);
|
||||
|
||||
output.writeByte(-1);
|
||||
output.writeByte(-1);
|
||||
output.writeByte(-1);
|
||||
|
||||
output.writeByte(-1);
|
||||
output.writeByte(-1);
|
||||
output.writeByte(-1);
|
||||
return;
|
||||
}
|
||||
output.writeBytes(input);
|
||||
|
@ -273,13 +273,12 @@ public class OutgoingTransformer {
|
||||
|
||||
int data = input.readInt();
|
||||
output.writeInt(data);
|
||||
|
||||
|
||||
short vX = 0, vY = 0, vZ = 0;
|
||||
if(data > 0)
|
||||
{
|
||||
vX = input.readShort();
|
||||
vY = input.readShort();
|
||||
vZ = input.readShort();
|
||||
if (data > 0) {
|
||||
vX = input.readShort();
|
||||
vY = input.readShort();
|
||||
vZ = input.readShort();
|
||||
}
|
||||
output.writeShort(vX);
|
||||
output.writeShort(vY);
|
||||
@ -381,7 +380,7 @@ public class OutgoingTransformer {
|
||||
PacketUtil.writeString(fixJson(line), output);
|
||||
}
|
||||
}
|
||||
if(packet == PacketType.PLAY_CHAT_MESSAGE) {
|
||||
if (packet == PacketType.PLAY_CHAT_MESSAGE) {
|
||||
String chat = PacketUtil.readString(input);
|
||||
PacketUtil.writeString(fixJson(chat), output);
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren