3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-03 14:50:30 +01:00

Fix commandblock minecarts

Dieser Commit ist enthalten in:
Mats 2016-03-06 12:18:18 +01:00
Ursprung 840c90f871
Commit a314b86f57
3 geänderte Dateien mit 23 neuen und 17 gelöschten Zeilen

Datei anzeigen

@ -1,7 +1,6 @@
package us.myles.ViaVersion.metadata; package us.myles.ViaVersion.metadata;
import org.bukkit.entity.*; import org.bukkit.entity.*;
import org.bukkit.entity.minecart.CommandMinecart;
public enum MetaIndex { public enum MetaIndex {
@ -107,8 +106,8 @@ public enum MetaIndex {
MINECART_BLOCK_Y(Minecart.class, 21, Type.Int, 9, NewType.VarInt), MINECART_BLOCK_Y(Minecart.class, 21, Type.Int, 9, NewType.VarInt),
MINECART_SHOWBLOCK(Minecart.class, 22, Type.Byte, 10, NewType.Boolean), MINECART_SHOWBLOCK(Minecart.class, 22, Type.Byte, 10, NewType.Boolean),
// Command minecart (they are still broken) // Command minecart (they are still broken)
MINECART_COMMANDBLOCK_COMMAND(CommandMinecart.class,23,Type.String,11,NewType.String), MINECART_COMMANDBLOCK_COMMAND(Minecart.class, 23, Type.String, 11, NewType.String),
MINECART_COMMANDBLOCK_OUTPUT(CommandMinecart.class,24,Type.String,12,NewType.Chat), MINECART_COMMANDBLOCK_OUTPUT(Minecart.class, 24, Type.String, 12, NewType.Chat),
// furnace cart // furnace cart
FURNACECART_ISPOWERED(org.bukkit.entity.minecart.PoweredMinecart.class, 16, Type.Byte, 11, NewType.Boolean), FURNACECART_ISPOWERED(org.bukkit.entity.minecart.PoweredMinecart.class, 16, Type.Byte, 11, NewType.Boolean),
// item drop // item drop

Datei anzeigen

@ -1,20 +1,19 @@
package us.myles.ViaVersion.metadata; package us.myles.ViaVersion.metadata;
import io.netty.buffer.ByteBuf;
import org.bukkit.entity.EntityType;
import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
import us.myles.ViaVersion.slot.ItemSlotRewriter;
import us.myles.ViaVersion.slot.ItemSlotRewriter.ItemStack;
import us.myles.ViaVersion.transformers.OutgoingTransformer;
import us.myles.ViaVersion.util.PacketUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import org.bukkit.entity.EntityType;
import org.bukkit.util.EulerAngle;
import org.bukkit.util.Vector;
import io.netty.buffer.ByteBuf;
import us.myles.ViaVersion.slot.ItemSlotRewriter;
import us.myles.ViaVersion.slot.ItemSlotRewriter.ItemStack;
import us.myles.ViaVersion.util.PacketUtil;
public class MetadataRewriter { public class MetadataRewriter {
public static void writeMetadata1_9(EntityType type, List<Entry> list, ByteBuf output) { public static void writeMetadata1_9(EntityType type, List<Entry> list, ByteBuf output) {
@ -110,6 +109,9 @@ public class MetadataRewriter {
output.writeFloat((float) angle.getY()); output.writeFloat((float) angle.getY());
output.writeFloat((float) angle.getZ()); output.writeFloat((float) angle.getZ());
break; break;
case Chat:
PacketUtil.writeString(OutgoingTransformer.fixJson((String) value), output);
break;
default: default:
System.out.println("[Out] Unhandled MetaDataType: " + metaIndex.getNewType()); System.out.println("[Out] Unhandled MetaDataType: " + metaIndex.getNewType());
break; break;

Datei anzeigen

@ -216,6 +216,11 @@ public class IncomingTransformer {
PacketUtil.writeString(command, output); PacketUtil.writeString(command, output);
output.writeBoolean(flag); output.writeBoolean(flag);
return; return;
} else if (name.equals("MC|AdvCmd")) {
output.clear();
PacketUtil.writeVarInt(PacketType.PLAY_PLUGIN_MESSAGE_REQUEST.getPacketID(), output);
PacketUtil.writeString("MC|AdvCdm", output);
output.writeBytes(b);
} }
output.writeBytes(b); output.writeBytes(b);
} }