3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-08 17:20:24 +01:00

Remove not required tags, and remove tested todo's

Dieser Commit ist enthalten in:
Matsv 2016-06-22 20:38:40 +02:00
Ursprung b743589d77
Commit ac1b35379e

Datei anzeigen

@ -1,7 +1,9 @@
package us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2; package us.myles.ViaVersion.protocols.protocol1_9_3to1_9_1_2;
import org.bukkit.Material; import org.bukkit.Material;
import org.spacehq.opennbt.tag.builtin.*; import org.spacehq.opennbt.tag.builtin.CompoundTag;
import org.spacehq.opennbt.tag.builtin.IntTag;
import org.spacehq.opennbt.tag.builtin.StringTag;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -16,82 +18,45 @@ public class FakeTileEntity {
private static Map<Integer, CompoundTag> tileEntities = new ConcurrentHashMap<>(); private static Map<Integer, CompoundTag> tileEntities = new ConcurrentHashMap<>();
static { static {
register(Material.FURNACE, "Furnace", register(Material.FURNACE, "Furnace");
new ShortTag("BurnTime"), register(Arrays.asList(Material.CHEST, Material.TRAPPED_CHEST), "Chest");
new ShortTag("CookTime"),
new ShortTag("CookTimeTotal")); // Maybe items todo test
register(Arrays.asList(Material.CHEST, Material.TRAPPED_CHEST), "Chest",
new ByteArrayTag("Items")); // Todo test
register(Material.ENDER_CHEST, "EnderChest"); register(Material.ENDER_CHEST, "EnderChest");
register(Material.JUKEBOX, "RecordPlayer"); // No required tags found, todo test register(Material.JUKEBOX, "RecordPlayer");
register(Material.DISPENSER, "Trap"); // todo test register(Material.DISPENSER, "Trap");
register(Material.DROPPER, "Dropper"); // todo test register(Material.DROPPER, "Dropper");
register(Arrays.asList(Material.SIGN_POST, Material.WALL_SIGN), "Sign", register(Arrays.asList(Material.SIGN_POST, Material.WALL_SIGN), "Sign");
new StringTag("Text1", ""), register(Material.MOB_SPAWNER, "MobSpawner");
new StringTag("Text2", ""), register(Material.NOTE_BLOCK, "Music");
new StringTag("Text3", ""), register(Material.PISTON_BASE, "Piston");
new StringTag("Text4", "")); // todo test register(Arrays.asList(Material.BREWING_STAND, Material.CAULDRON), "Cauldron");
register(Material.MOB_SPAWNER, "MobSpawner"); // todo test register(Material.ENCHANTMENT_TABLE, "EnchantTable");
register(Material.NOTE_BLOCK, "Music", register(Arrays.asList(Material.ENDER_PORTAL, Material.ENDER_PORTAL_FRAME), "Airportal");
new ByteTag("note"), register(Material.BEACON, "Beacon");
new ByteTag("enabled")); // todo test register(Arrays.asList(Material.SKULL, Material.SKULL_ITEM), "Skull");
register(Material.PISTON_BASE, "Piston", register(Arrays.asList(Material.DAYLIGHT_DETECTOR, Material.DAYLIGHT_DETECTOR_INVERTED), "DLDetector");
new IntTag("blockId"), register(Material.HOPPER, "Hopper");
new IntTag("blockData"), register(Arrays.asList(Material.REDSTONE_COMPARATOR, Material.REDSTONE_COMPARATOR_OFF, Material.REDSTONE_COMPARATOR_ON), "Comparator");
new IntTag("facing"), register(Material.FLOWER_POT, "FlowerPot");
new FloatTag("progress"), register(Arrays.asList(Material.STANDING_BANNER, Material.WALL_BANNER, Material.BANNER), "Banner");
new ByteTag("extending")); //TODO test, maybe assign values to them instead of 0. register(209, "EndGateway"); // todo test
register(Arrays.asList(Material.BREWING_STAND, Material.CAULDRON), "Cauldron", register(Material.COMMAND.getId(), "Control");
new ShortTag("BrewTime"),
new ByteArrayTag("Items")
); //todo test both, spigot tells me this is a brewing stand.
register(Material.ENCHANTMENT_TABLE, "EnchantTable"); //// TODO: test
register(Arrays.asList(Material.ENDER_PORTAL, Material.ENDER_PORTAL_FRAME), "Airportal"); //todo test
register(Material.BEACON, "Beacon",
new IntTag("Primary"),
new IntTag("Secondary"),
new IntTag("Levels")); //todo test
register(Arrays.asList(Material.SKULL, Material.SKULL_ITEM), "Skull",
new ByteTag("SkullType"),
new ByteTag("Rot")); //todo test
register(Arrays.asList(Material.DAYLIGHT_DETECTOR, Material.DAYLIGHT_DETECTOR_INVERTED), "DLDetector"); //todo test
register(Material.HOPPER, "Hopper",
new IntTag("TransferCooldown")); // todo test
register(Arrays.asList(Material.REDSTONE_COMPARATOR, Material.REDSTONE_COMPARATOR_OFF, Material.REDSTONE_COMPARATOR_ON), "Comparator",
new IntTag("OutputSignal")); //todo test
register(Material.FLOWER_POT, "FlowerPot",
new StringTag("Item", ""),
new IntTag("Data")); //todo test
register(Arrays.asList(Material.STANDING_BANNER, Material.WALL_BANNER, Material.BANNER), "Banner",
new IntTag("Base")); //todo test
register(209, "EndGateway", new LongTag("age")); // todo test
register(Material.COMMAND.getId(), "Control",
new StringTag("Command", "ViaVersion"),
new IntTag("SuccessCount"),
new StringTag("CustomName", "ViaVersion"),
new ByteTag("TrackOutput"),
new ByteTag("powered"),
new ByteTag("conditionMet"),
new ByteTag("auto")); // todo test
} }
private static void register(Integer material, String name, Tag... tags) { private static void register(Integer material, String name) {
CompoundTag comp = new CompoundTag(""); CompoundTag comp = new CompoundTag("");
comp.put(new StringTag(name)); comp.put(new StringTag(name));
for (Tag tag : tags) // for (Tag tag : tags)
comp.put(tag); // comp.put(tag);
tileEntities.put(material, comp); tileEntities.put(material, comp);
} }
private static void register(Material material, String name, Tag... tags) { private static void register(Material material, String name) {
register(material.getId(), name, tags); register(material.getId(), name);
} }
private static void register(List<Material> materials, String name, Tag... tags) { private static void register(List<Material> materials, String name) {
for (Material m : materials) for (Material m : materials)
register(m.getId(), name, tags); register(m.getId(), name);
} }
public static boolean hasBlock(int block) { public static boolean hasBlock(int block) {
@ -104,7 +69,6 @@ public class FakeTileEntity {
tag.put(new IntTag("x", x)); tag.put(new IntTag("x", x));
tag.put(new IntTag("y", y)); tag.put(new IntTag("y", y));
tag.put(new IntTag("z", z)); tag.put(new IntTag("z", z));
// System.out.println("Found tile entity " + block + " at position " + x + " " + y + " " + z);
return tag; return tag;
} }
return null; return null;