3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 00:00:28 +01:00

Merge branch 'master' into dev

Dieser Commit ist enthalten in:
Myles 2019-02-10 16:45:34 +00:00
Commit 1be617c110
45 geänderte Dateien mit 787 neuen und 52494 gelöschten Zeilen

Datei anzeigen

@ -1,9 +1,6 @@
License:
--------
MIT License MIT License
Copyright (c) 2017 Copyright (c) 2019
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

Datei anzeigen

@ -9,6 +9,7 @@ import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemBreakEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.CraftingInventory; import org.bukkit.inventory.CraftingInventory;
@ -91,6 +92,11 @@ public class ArmorListener extends ViaBukkitListener {
} }
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onItemBreak(PlayerItemBreakEvent e) {
sendDelayedArmorUpdate(e.getPlayer());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onJoin(PlayerJoinEvent e) { public void onJoin(PlayerJoinEvent e) {
sendDelayedArmorUpdate(e.getPlayer()); sendDelayedArmorUpdate(e.getPlayer());

Datei anzeigen

@ -244,4 +244,9 @@ public class BukkitViaConfig extends Config implements ViaVersionConfig {
public boolean isSnowCollisionFix() { public boolean isSnowCollisionFix() {
return getBoolean("fix-low-snow-collision", false); return getBoolean("fix-low-snow-collision", false);
} }
@Override
public int get1_13TabCompleteDelay() {
return getInt("1_13-tab-complete-delay", 0);
}
} }

Datei anzeigen

@ -30,6 +30,9 @@ public class BungeeChannelInitializer extends ChannelInitializer<SocketChannel>
new ProtocolPipeline(info); new ProtocolPipeline(info);
// Add originals // Add originals
this.method.invoke(this.original, socketChannel); this.method.invoke(this.original, socketChannel);
if (socketChannel.pipeline().get("packet-encoder") == null) return; // Don't inject if no packet-encoder
if (socketChannel.pipeline().get("packet-decoder") == null) return; // Don't inject if no packet-decoder
// Add our transformers // Add our transformers
BungeeEncodeHandler encoder = new BungeeEncodeHandler(info); BungeeEncodeHandler encoder = new BungeeEncodeHandler(info);
BungeeDecodeHandler decoder = new BungeeDecodeHandler(info); BungeeDecodeHandler decoder = new BungeeDecodeHandler(info);

Datei anzeigen

@ -8,25 +8,27 @@ import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler; import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority; import net.md_5.bungee.event.EventPriority;
import net.md_5.bungee.protocol.packet.PluginMessage; import net.md_5.bungee.protocol.packet.PluginMessage;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.Pair; import us.myles.ViaVersion.api.Pair;
import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.boss.BossBar;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.protocol.Protocol;
import us.myles.ViaVersion.api.protocol.ProtocolPipeline; import us.myles.ViaVersion.api.protocol.ProtocolPipeline;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry; import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import us.myles.ViaVersion.api.protocol.ProtocolVersion; import us.myles.ViaVersion.api.protocol.ProtocolVersion;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.bungee.service.ProtocolDetectorService; import us.myles.ViaVersion.bungee.service.ProtocolDetectorService;
import us.myles.ViaVersion.bungee.storage.BungeeStorage; import us.myles.ViaVersion.bungee.storage.BungeeStorage;
import us.myles.ViaVersion.protocols.base.ProtocolInfo; import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker; import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.UUID;
public class BungeeServerHandler implements Listener { public class BungeeServerHandler implements Listener {
private static Method getHandshake; private static Method getHandshake;
@ -86,14 +88,6 @@ public class BungeeServerHandler implements Listener {
public void checkServerChange(ServerConnectedEvent e, UserConnection user) throws Exception { public void checkServerChange(ServerConnectedEvent e, UserConnection user) throws Exception {
if (user == null) return; if (user == null) return;
// Manually hide ViaVersion-created BossBars if the childserver was version 1.8.x (#666)
if (user.has(EntityTracker.class)) {
EntityTracker tracker = user.get(EntityTracker.class);
if (tracker.getBossBarMap() != null)
for (BossBar bar : tracker.getBossBarMap().values())
bar.hide();
}
// Handle server/version change // Handle server/version change
if (user.has(BungeeStorage.class)) { if (user.has(BungeeStorage.class)) {
BungeeStorage storage = user.get(BungeeStorage.class); BungeeStorage storage = user.get(BungeeStorage.class);
@ -107,6 +101,18 @@ public class BungeeServerHandler implements Listener {
int protocolId = ProtocolDetectorService.getProtocolId(serverName); int protocolId = ProtocolDetectorService.getProtocolId(serverName);
if (protocolId <= ProtocolVersion.v1_8.getId()) { // 1.8 doesn't have BossBar packet
if (storage.getBossbar() != null) {
for (UUID uuid : storage.getBossbar()) {
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
wrapper.write(Type.UUID, uuid);
wrapper.write(Type.VAR_INT, 1); // remove
wrapper.send(Protocol1_9TO1_8.class, true, true);
}
storage.getBossbar().clear();
}
}
ProtocolInfo info = user.get(ProtocolInfo.class); ProtocolInfo info = user.get(ProtocolInfo.class);
int previousServerProtocol = info.getServerProtocolVersion(); int previousServerProtocol = info.getServerProtocolVersion();
@ -130,14 +136,12 @@ public class BungeeServerHandler implements Listener {
// Workaround 1.13 server change // Workaround 1.13 server change
Object relayMessages = getRelayMessages.invoke(e.getPlayer().getPendingConnection()); Object relayMessages = getRelayMessages.invoke(e.getPlayer().getPendingConnection());
if (relayMessages instanceof List) {
for (Object message : (List) relayMessages) { for (Object message : (List) relayMessages) {
if (message instanceof PluginMessage) {
PluginMessage plMsg = (PluginMessage) message; PluginMessage plMsg = (PluginMessage) message;
String channel = plMsg.getTag(); String channel = plMsg.getTag();
int id1_13 = ProtocolVersion.v1_13.getId();
if (previousServerProtocol != -1) { if (previousServerProtocol != -1) {
if (previousServerProtocol < ProtocolVersion.v1_13.getId() if (previousServerProtocol < id1_13 && protocolId >= id1_13) {
&& protocolId >= ProtocolVersion.v1_13.getId()) {
channel = InventoryPackets.getNewPluginChannelId(channel); channel = InventoryPackets.getNewPluginChannelId(channel);
if (channel.equals("minecraft:register")) { if (channel.equals("minecraft:register")) {
String[] channels = new String(plMsg.getData(), StandardCharsets.UTF_8).split("\0"); String[] channels = new String(plMsg.getData(), StandardCharsets.UTF_8).split("\0");
@ -146,8 +150,7 @@ public class BungeeServerHandler implements Listener {
} }
plMsg.setData(Joiner.on('\0').join(channels).getBytes(StandardCharsets.UTF_8)); plMsg.setData(Joiner.on('\0').join(channels).getBytes(StandardCharsets.UTF_8));
} }
} else if (previousServerProtocol >= ProtocolVersion.v1_13.getId() } else if (previousServerProtocol >= id1_13 && protocolId < id1_13) {
&& protocolId < ProtocolVersion.v1_13.getId()) {
channel = InventoryPackets.getOldPluginChannelId(channel); channel = InventoryPackets.getOldPluginChannelId(channel);
if (channel.equals("REGISTER")) { if (channel.equals("REGISTER")) {
String[] channels = new String(plMsg.getData(), StandardCharsets.UTF_8).split("\0"); String[] channels = new String(plMsg.getData(), StandardCharsets.UTF_8).split("\0");
@ -159,12 +162,6 @@ public class BungeeServerHandler implements Listener {
} }
} }
plMsg.setTag(channel); plMsg.setTag(channel);
} else {
Via.getPlatform().getLogger().warning("relayMessages contains a element that isn't a Handshake " + message);
}
}
} else {
Via.getPlatform().getLogger().warning("relayMessages isn't a List! " + relayMessages);
} }
user.put(info); user.put(info);

Datei anzeigen

@ -297,4 +297,9 @@ public class BungeeViaConfig extends Config implements ViaVersionConfig {
public boolean isSnowCollisionFix() { public boolean isSnowCollisionFix() {
return getBoolean("fix-low-snow-collision", false); return getBoolean("fix-low-snow-collision", false);
} }
@Override
public int get1_13TabCompleteDelay() {
return getInt("1_13-tab-complete-delay", 0);
}
} }

Datei anzeigen

@ -302,4 +302,10 @@ public interface ViaVersionConfig {
* @return True if enabled * @return True if enabled
*/ */
boolean isSnowCollisionFix(); boolean isSnowCollisionFix();
/**
* When greater than 0, enables tab complete request delaying by x ticks
* @return the delay in ticks
*/
int get1_13TabCompleteDelay();
} }

Datei anzeigen

@ -67,11 +67,12 @@ public class NibbleArray {
* @param value The desired value * @param value The desired value
*/ */
public void set(int index, int value) { public void set(int index, int value) {
index /= 2;
if (index % 2 == 0) { if (index % 2 == 0) {
handle[index] = (byte) (handle[index] & 0xF0 | value & 0xF); index /= 2;
handle[index] = (byte) ((handle[index] & 0xF0) | (value & 0xF));
} else { } else {
handle[index] = (byte) (handle[index] & 0xF | (value & 0xF) << 4); index /= 2;
handle[index] = (byte) ((handle[index] & 0xF) | ((value & 0xF) << 4));
} }
} }

Datei anzeigen

@ -98,8 +98,14 @@ public abstract class Protocol {
* @param packetRemapper The remapper to use for the packet * @param packetRemapper The remapper to use for the packet
*/ */
public void registerIncoming(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper) { public void registerIncoming(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper) {
registerIncoming(state, oldPacketID, newPacketID, packetRemapper, false);
}
public void registerIncoming(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override) {
ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper); ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper);
incoming.put(new Pair<>(state, newPacketID), protocolPacket); Pair<State, Integer> pair = new Pair<>(state, newPacketID);
if (!override && incoming.containsKey(pair)) throw new IllegalArgumentException(pair + " already registered");
incoming.put(pair, protocolPacket);
} }
/** /**
@ -122,8 +128,14 @@ public abstract class Protocol {
* @param packetRemapper The remapper to use for the packet * @param packetRemapper The remapper to use for the packet
*/ */
public void registerOutgoing(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper) { public void registerOutgoing(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper) {
registerOutgoing(state, oldPacketID, newPacketID, packetRemapper, false);
}
public void registerOutgoing(State state, int oldPacketID, int newPacketID, PacketRemapper packetRemapper, boolean override) {
ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper); ProtocolPacket protocolPacket = new ProtocolPacket(state, oldPacketID, newPacketID, packetRemapper);
outgoing.put(new Pair<>(state, oldPacketID), protocolPacket); Pair<State, Integer> pair = new Pair<>(state, oldPacketID);
if (!override && outgoing.containsKey(pair)) throw new IllegalArgumentException(pair + " already registered");
outgoing.put(pair, protocolPacket);
} }
/** /**

Datei anzeigen

@ -98,7 +98,9 @@ public class MetadataRewriter {
// Handle AreaEffectCloud outside the loop // Handle AreaEffectCloud outside the loop
if (type != null && type.is(Entity1_13Types.EntityType.AREA_EFFECT_CLOUD) && particleId != -1) { if (type != null && type.is(Entity1_13Types.EntityType.AREA_EFFECT_CLOUD) && particleId != -1) {
Particle particle = ParticleRewriter.rewriteParticle(particleId, new Integer[]{parameter1, parameter2}); Particle particle = ParticleRewriter.rewriteParticle(particleId, new Integer[]{parameter1, parameter2});
if (particle != null && particle.getId() != -1) {
metadatas.add(new Metadata(9, MetaType1_13.PARTICLE, particle)); metadatas.add(new Metadata(9, MetaType1_13.PARTICLE, particle));
} }
} }
}
} }

Datei anzeigen

@ -343,7 +343,6 @@ public class Protocol1_13To1_12_2 extends Protocol {
registerOutgoing(State.PLAY, 0x1B, 0x1C); registerOutgoing(State.PLAY, 0x1B, 0x1C);
// New packet 0x1D - NBT Query // New packet 0x1D - NBT Query
registerOutgoing(State.PLAY, 0x1C, 0x1E); registerOutgoing(State.PLAY, 0x1C, 0x1E);
registerOutgoing(State.PLAY, 0x1D, 0x1F);
registerOutgoing(State.PLAY, 0x1E, 0x20); registerOutgoing(State.PLAY, 0x1E, 0x20);
registerOutgoing(State.PLAY, 0x1F, 0x21); registerOutgoing(State.PLAY, 0x1F, 0x21);
// WorldPackets 0x20 -> 0x22 // WorldPackets 0x20 -> 0x22
@ -851,9 +850,15 @@ public class Protocol1_13To1_12_2 extends Protocol {
// Fake the end of the packet // Fake the end of the packet
create(new ValueCreator() { create(new ValueCreator() {
@Override @Override
public void write(PacketWrapper wrapper) { public void write(PacketWrapper wrapper) throws Exception {
wrapper.write(Type.BOOLEAN, false); wrapper.write(Type.BOOLEAN, false);
wrapper.write(Type.OPTIONAL_POSITION, null); wrapper.write(Type.OPTIONAL_POSITION, null);
if (!wrapper.isCancelled() && Via.getConfig().get1_13TabCompleteDelay() > 0) {
TabCompleteTracker tracker = wrapper.user().get(TabCompleteTracker.class);
wrapper.cancel();
tracker.setTimeToSend(System.currentTimeMillis() + Via.getConfig().get1_13TabCompleteDelay() * 50);
tracker.setLastTabComplete(wrapper.get(Type.STRING, 0));
}
} }
}); });
} }
@ -1139,6 +1144,9 @@ public class Protocol1_13To1_12_2 extends Protocol {
userConnection.put(new BlockConnectionStorage(userConnection)); userConnection.put(new BlockConnectionStorage(userConnection));
} }
} }
if (Via.getConfig().get1_13TabCompleteDelay() > 0) {
Via.getPlatform().runRepeatingSync(new TabCompleteThread(), 1L);
}
} }
@Override @Override

Datei anzeigen

@ -0,0 +1,19 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage.TabCompleteTracker;
public class TabCompleteThread implements Runnable {
@Override
public void run() {
for (UserConnection info : Via.getManager().getPortedPlayers().values()) {
if (info.has(ProtocolInfo.class) && info.get(ProtocolInfo.class).getPipeline().contains(Protocol1_13To1_12_2.class)) {
if (info.getChannel().isOpen()) {
info.get(TabCompleteTracker.class).sendPacketToServer();
}
}
}
}
}

Datei anzeigen

@ -15,18 +15,25 @@ public abstract class AbstractFenceConnectionHandler extends ConnectionHandler {
@Getter @Getter
private Set<Integer> blockStates = new HashSet<>(); private Set<Integer> blockStates = new HashSet<>();
private Map<Byte, Integer> connectedBlockStates = new HashMap<>(); private Map<Byte, Integer> connectedBlockStates = new HashMap<>();
private static final StairConnectionHandler STAIR_CONNECTION_HANDLER = new StairConnectionHandler();
public AbstractFenceConnectionHandler(String blockConnections, String key) { public AbstractFenceConnectionHandler(String blockConnections) {
this.blockConnections = blockConnections; this.blockConnections = blockConnections;
}
for (Map.Entry<String, Integer> blockState : ConnectionData.keyToId.entrySet()) { public ConnectionData.ConnectorInitAction getInitAction(final String key) {
if (key.equals(blockState.getKey().split("\\[")[0])) { final AbstractFenceConnectionHandler handler = this;
blockStates.add(blockState.getValue()); return new ConnectionData.ConnectorInitAction() {
ConnectionData.connectionHandlerMap.put(blockState.getValue(), this); @Override
WrappedBlockData blockData = WrappedBlockData.fromString(blockState.getKey()); public void check(WrappedBlockData blockData) {
connectedBlockStates.put(getStates(blockData), blockState.getValue()); if (key.equals(blockData.getMinecraftKey())) {
if (blockData.hasData("waterlogged") && blockData.getValue("waterlogged").equals("true")) return;
blockStates.add(blockData.getSavedBlockStateId());
ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), handler);
connectedBlockStates.put(getStates(blockData), blockData.getSavedBlockStateId());
} }
} }
};
} }
protected byte getStates(WrappedBlockData blockData) { protected byte getStates(WrappedBlockData blockData) {
@ -35,7 +42,6 @@ public abstract class AbstractFenceConnectionHandler extends ConnectionHandler {
if (blockData.getValue("north").equals("true")) states |= 2; if (blockData.getValue("north").equals("true")) states |= 2;
if (blockData.getValue("south").equals("true")) states |= 4; if (blockData.getValue("south").equals("true")) states |= 4;
if (blockData.getValue("west").equals("true")) states |= 8; if (blockData.getValue("west").equals("true")) states |= 8;
if (blockData.hasData("waterlogged") && blockData.getValue("waterlogged").equals("true")) states |= 16;
return states; return states;
} }
@ -48,6 +54,11 @@ public abstract class AbstractFenceConnectionHandler extends ConnectionHandler {
return states; return states;
} }
@Override
public int getBlockData(UserConnection user, Position position) {
return STAIR_CONNECTION_HANDLER.connect(user, position, super.getBlockData(user, position));
}
@Override @Override
public int connect(UserConnection user, Position position, int blockState) { public int connect(UserConnection user, Position position, int blockState) {
final Integer newBlockState = connectedBlockStates.get(getStates(user, position, blockState)); final Integer newBlockState = connectedBlockStates.get(getStates(user, position, blockState));

Datei anzeigen

@ -17,23 +17,27 @@ public class AbstractStempConnectionHandler extends ConnectionHandler {
private Map<BlockFace, Integer> stemps = new HashMap<>(); private Map<BlockFace, Integer> stemps = new HashMap<>();
public AbstractStempConnectionHandler(String baseStateId, String blockId, String toKey) { public AbstractStempConnectionHandler(String baseStateId) {
this.baseStateId = ConnectionData.getId(baseStateId); this.baseStateId = ConnectionData.getId(baseStateId);
}
for (Map.Entry<String, Integer> entry : ConnectionData.keyToId.entrySet()) { public ConnectionData.ConnectorInitAction getInitAction(final String blockId, final String toKey) {
String key = entry.getKey().split("\\[")[0]; final AbstractStempConnectionHandler handler = this;
if (entry.getValue() == this.baseStateId || blockId.equals(key)) { return new ConnectionData.ConnectorInitAction() {
if (entry.getValue() != this.baseStateId) { @Override
this.blockId.add(entry.getValue()); public void check(WrappedBlockData blockData) {
if (blockData.getSavedBlockStateId() == baseStateId || blockId.equals(blockData.getMinecraftKey())) {
if (blockData.getSavedBlockStateId() != baseStateId) {
handler.blockId.add(blockData.getSavedBlockStateId());
} }
ConnectionData.connectionHandlerMap.put(entry.getValue(), this); ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), handler);
} }
if (key.equals(toKey)) { if (blockData.getMinecraftKey().equals(toKey)) {
WrappedBlockData data = WrappedBlockData.fromString(entry.getKey()); String facing = blockData.getValue("facing").toUpperCase();
String facing = data.getValue("facing").toUpperCase(); stemps.put(BlockFace.valueOf(facing), blockData.getSavedBlockStateId());
stemps.put(BlockFace.valueOf(facing), entry.getValue());
} }
} }
};
} }
@Override @Override

Datei anzeigen

@ -1,17 +1,22 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections; package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections;
import java.util.ArrayList;
import java.util.List;
public class BasicFenceConnectionHandler extends AbstractFenceConnectionHandler { public class BasicFenceConnectionHandler extends AbstractFenceConnectionHandler {
static void init() { static List<ConnectionData.ConnectorInitAction> init() {
new BasicFenceConnectionHandler("fenceConnections", "minecraft:oak_fence"); List<ConnectionData.ConnectorInitAction> actions = new ArrayList<>();
new BasicFenceConnectionHandler("fenceConnections", "minecraft:birch_fence"); actions.add(new BasicFenceConnectionHandler("fenceConnections").getInitAction("minecraft:oak_fence"));
new BasicFenceConnectionHandler("fenceConnections", "minecraft:jungle_fence"); actions.add(new BasicFenceConnectionHandler("fenceConnections").getInitAction("minecraft:birch_fence"));
new BasicFenceConnectionHandler("fenceConnections", "minecraft:dark_oak_fence"); actions.add(new BasicFenceConnectionHandler("fenceConnections").getInitAction("minecraft:jungle_fence"));
new BasicFenceConnectionHandler("fenceConnections", "minecraft:acacia_fence"); actions.add(new BasicFenceConnectionHandler("fenceConnections").getInitAction("minecraft:dark_oak_fence"));
new BasicFenceConnectionHandler("fenceConnections", "minecraft:spruce_fence"); actions.add(new BasicFenceConnectionHandler("fenceConnections").getInitAction("minecraft:acacia_fence"));
actions.add(new BasicFenceConnectionHandler("fenceConnections").getInitAction("minecraft:spruce_fence"));
return actions;
} }
public BasicFenceConnectionHandler(String blockConnections, String key) { public BasicFenceConnectionHandler(String blockConnections) {
super(blockConnections, key); super(blockConnections);
} }
} }

Datei anzeigen

@ -14,18 +14,19 @@ class ChestConnectionHandler extends ConnectionHandler {
private static Map<Byte, Integer> connectedStates = new HashMap<>(); private static Map<Byte, Integer> connectedStates = new HashMap<>();
private static Set<Integer> trappedChests = new HashSet<>(); private static Set<Integer> trappedChests = new HashSet<>();
static void init() { static ConnectionData.ConnectorInitAction init() {
ChestConnectionHandler connectionHandler = new ChestConnectionHandler(); final ChestConnectionHandler connectionHandler = new ChestConnectionHandler();
for (Map.Entry<String, Integer> blockState : ConnectionData.keyToId.entrySet()) { return new ConnectionData.ConnectorInitAction() {
String key = blockState.getKey().split("\\[")[0]; @Override
if (!key.equals("minecraft:chest") && !key.equals("minecraft:trapped_chest")) continue; public void check(WrappedBlockData blockData) {
WrappedBlockData blockData = WrappedBlockData.fromString(blockState.getKey()); if (!blockData.getMinecraftKey().equals("minecraft:chest") && !blockData.getMinecraftKey().equals("minecraft:trapped_chest")) return;
if (blockData.getValue("waterlogged").equals("true")) continue; if (blockData.getValue("waterlogged").equals("true")) return;
chestFacings.put(blockState.getValue(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase())); chestFacings.put(blockData.getSavedBlockStateId(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase()));
if (key.equalsIgnoreCase("minecraft:trapped_chest")) trappedChests.add(blockState.getValue()); if (blockData.getMinecraftKey().equalsIgnoreCase("minecraft:trapped_chest")) trappedChests.add(blockData.getSavedBlockStateId());
connectedStates.put(getStates(blockData), blockState.getValue()); connectedStates.put(getStates(blockData), blockData.getSavedBlockStateId());
ConnectionData.connectionHandlerMap.put(blockState.getValue(), connectionHandler); ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), connectionHandler);
} }
};
} }
private static Byte getStates(WrappedBlockData blockData) { private static Byte getStates(WrappedBlockData blockData) {

Datei anzeigen

@ -4,23 +4,35 @@ import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.minecraft.BlockFace; import us.myles.ViaVersion.api.minecraft.BlockFace;
import us.myles.ViaVersion.api.minecraft.Position; import us.myles.ViaVersion.api.minecraft.Position;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
public class ChorusPlantConnectionHandler extends AbstractFenceConnectionHandler { public class ChorusPlantConnectionHandler extends AbstractFenceConnectionHandler {
private int endstone; private int endstone;
static void init() { static List<ConnectionData.ConnectorInitAction> init() {
new ChorusPlantConnectionHandler("minecraft:chorus_plant"); List<ConnectionData.ConnectorInitAction> actions = new ArrayList<>(2);
ChorusPlantConnectionHandler handler = new ChorusPlantConnectionHandler();
actions.add(handler.getInitAction("minecraft:chorus_plant"));
actions.add(handler.getExtraAction());
return actions;
} }
public ChorusPlantConnectionHandler(String key) { public ChorusPlantConnectionHandler() {
super(null, key); super(null);
endstone = ConnectionData.getId("minecraft:end_stone"); endstone = ConnectionData.getId("minecraft:end_stone");
for (Map.Entry<String, Integer> entry : ConnectionData.keyToId.entrySet()) { }
if (entry.getKey().split("\\[")[0].equals("minecraft:chorus_flower")) {
getBlockStates().add(entry.getValue()); public ConnectionData.ConnectorInitAction getExtraAction() {
return new ConnectionData.ConnectorInitAction() {
@Override
public void check(WrappedBlockData blockData) {
if (blockData.getMinecraftKey().equals("minecraft:chorus_flower")) {
getBlockStates().add(blockData.getSavedBlockStateId());
} }
} }
};
} }
@Override @Override

Datei anzeigen

@ -16,11 +16,8 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections.provi
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections.providers.PacketBlockConnectionProvider; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections.providers.PacketBlockConnectionProvider;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData;
import java.util.HashMap; import java.util.*;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.Set;
public class ConnectionData { public class ConnectionData {
static Map<Integer, String> idToKey = new HashMap<>(); static Map<Integer, String> idToKey = new HashMap<>();
@ -163,20 +160,27 @@ public class ConnectionData {
occludingStates.add(keyToId.get(jsonElement.getAsString())); occludingStates.add(keyToId.get(jsonElement.getAsString()));
} }
PumpkinConnectionHandler.init(); List<ConnectorInitAction> initActions = new ArrayList<>();
MelonConnectionHandler.init(); initActions.add(PumpkinConnectionHandler.init());
BasicFenceConnectionHandler.init(); initActions.addAll(BasicFenceConnectionHandler.init());
NetherFenceConnectionHandler.init(); initActions.add(NetherFenceConnectionHandler.init());
WallConnectionHandler.init(); initActions.addAll(WallConnectionHandler.init());
MelonConnectionHandler.init(); initActions.add(MelonConnectionHandler.init());
GlassConnectionHandler.init(); initActions.addAll(GlassConnectionHandler.init());
ChestConnectionHandler.init(); initActions.add(ChestConnectionHandler.init());
DoorConnectionHandler.init(); initActions.add(DoorConnectionHandler.init());
RedstoneConnectionHandler.init(); initActions.add(RedstoneConnectionHandler.init());
StairConnectionHandler.init(); initActions.add(StairConnectionHandler.init());
FlowerConnectionHandler.init(); initActions.add(FlowerConnectionHandler.init());
ChorusPlantConnectionHandler.init(); initActions.addAll(ChorusPlantConnectionHandler.init());
TripwireConnectionHandler.init(); initActions.add(TripwireConnectionHandler.init());
initActions.add(SnowyGrassConnectionHandler.init());
for (String key : keyToId.keySet()) {
WrappedBlockData wrappedBlockData = WrappedBlockData.fromString(key);
for (ConnectorInitAction action : initActions) {
action.check(wrappedBlockData);
}
}
if (Via.getConfig().getBlockConnectionMethod().equalsIgnoreCase("packet")) { if (Via.getConfig().getBlockConnectionMethod().equalsIgnoreCase("packet")) {
Via.getManager().getProviders().register(BlockConnectionProvider.class, new PacketBlockConnectionProvider()); Via.getManager().getProviders().register(BlockConnectionProvider.class, new PacketBlockConnectionProvider());
@ -207,4 +211,9 @@ public class ConnectionData {
public static String getKey(int id) { public static String getKey(int id) {
return idToKey.get(id); return idToKey.get(id);
} }
interface ConnectorInitAction {
void check(WrappedBlockData blockData);
}
} }

Datei anzeigen

@ -16,8 +16,8 @@ public class DoorConnectionHandler extends ConnectionHandler {
private static Map<Integer, DoorData> doorDataMap = new HashMap<>(); private static Map<Integer, DoorData> doorDataMap = new HashMap<>();
private static Map<Short, Integer> connectedStates = new HashMap<>(); private static Map<Short, Integer> connectedStates = new HashMap<>();
static void init() { static ConnectionData.ConnectorInitAction init() {
List<String> baseDoors = new LinkedList<>(); final List<String> baseDoors = new LinkedList<>();
baseDoors.add("minecraft:oak_door"); baseDoors.add("minecraft:oak_door");
baseDoors.add("minecraft:birch_door"); baseDoors.add("minecraft:birch_door");
baseDoors.add("minecraft:jungle_door"); baseDoors.add("minecraft:jungle_door");
@ -26,14 +26,14 @@ public class DoorConnectionHandler extends ConnectionHandler {
baseDoors.add("minecraft:spruce_door"); baseDoors.add("minecraft:spruce_door");
baseDoors.add("minecraft:iron_door"); baseDoors.add("minecraft:iron_door");
DoorConnectionHandler connectionHandler = new DoorConnectionHandler(); final DoorConnectionHandler connectionHandler = new DoorConnectionHandler();
for (Map.Entry<String, Integer> blockState : ConnectionData.keyToId.entrySet()) { return new ConnectionData.ConnectorInitAction() {
String key = blockState.getKey().split("\\[")[0]; @Override
int type = baseDoors.indexOf(key); public void check(WrappedBlockData blockData) {
if (type == -1) continue; int type = baseDoors.indexOf(blockData.getMinecraftKey());
if (type == -1) return;
WrappedBlockData blockData = WrappedBlockData.fromString(blockState.getKey()); int id = blockData.getSavedBlockStateId();
int id = blockState.getValue();
DoorData doorData = new DoorData( DoorData doorData = new DoorData(
blockData.getValue("half").equals("lower"), blockData.getValue("half").equals("lower"),
@ -50,6 +50,7 @@ public class DoorConnectionHandler extends ConnectionHandler {
ConnectionData.connectionHandlerMap.put(id, connectionHandler); ConnectionData.connectionHandlerMap.put(id, connectionHandler);
} }
};
} }
private static short getStates(DoorData doorData) { private static short getStates(DoorData doorData) {

Datei anzeigen

@ -14,8 +14,8 @@ import java.util.Set;
public class FlowerConnectionHandler extends ConnectionHandler { public class FlowerConnectionHandler extends ConnectionHandler {
private static Map<Integer, Integer> flowers = new HashMap<>(); private static Map<Integer, Integer> flowers = new HashMap<>();
static void init() { static ConnectionData.ConnectorInitAction init() {
Set<String> baseFlower = new HashSet<>(); final Set<String> baseFlower = new HashSet<>();
baseFlower.add("minecraft:rose_bush"); baseFlower.add("minecraft:rose_bush");
baseFlower.add("minecraft:sunflower"); baseFlower.add("minecraft:sunflower");
baseFlower.add("minecraft:peony"); baseFlower.add("minecraft:peony");
@ -23,17 +23,19 @@ public class FlowerConnectionHandler extends ConnectionHandler {
baseFlower.add("minecraft:large_fern"); baseFlower.add("minecraft:large_fern");
baseFlower.add("minecraft:lilac"); baseFlower.add("minecraft:lilac");
FlowerConnectionHandler handler = new FlowerConnectionHandler(); final FlowerConnectionHandler handler = new FlowerConnectionHandler();
for (Map.Entry<String, Integer> blockState : ConnectionData.keyToId.entrySet()) { return new ConnectionData.ConnectorInitAction() {
WrappedBlockData data = WrappedBlockData.fromString(blockState.getKey()); @Override
if (baseFlower.contains(data.getMinecraftKey())) { public void check(WrappedBlockData blockData) {
ConnectionData.connectionHandlerMap.put(blockState.getValue(), handler); if (baseFlower.contains(blockData.getMinecraftKey())) {
if (data.getValue("half").equals("lower")) { ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), handler);
data.set("half", "upper"); if (blockData.getValue("half").equals("lower")) {
flowers.put(blockState.getValue(), data.getBlockStateId()); blockData.set("half", "upper");
flowers.put(blockData.getSavedBlockStateId(), blockData.getBlockStateId());
} }
} }
} }
};
} }
@Override @Override

Datei anzeigen

@ -4,31 +4,36 @@ import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.minecraft.Position; import us.myles.ViaVersion.api.minecraft.Position;
import us.myles.ViaVersion.protocols.base.ProtocolInfo; import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import java.util.ArrayList;
import java.util.List;
public class GlassConnectionHandler extends AbstractFenceConnectionHandler { public class GlassConnectionHandler extends AbstractFenceConnectionHandler {
static void init() { static List<ConnectionData.ConnectorInitAction> init() {
new GlassConnectionHandler("paneConnections", "minecraft:white_stained_glass_pane"); List<ConnectionData.ConnectorInitAction> actions = new ArrayList<>(18);
new GlassConnectionHandler("paneConnections", "minecraft:orange_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:white_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:magenta_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:orange_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:light_blue_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:magenta_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:yellow_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:light_blue_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:lime_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:yellow_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:pink_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:lime_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:gray_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:pink_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:light_gray_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:gray_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:cyan_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:light_gray_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:purple_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:cyan_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:blue_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:purple_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:brown_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:blue_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:green_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:brown_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:red_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:green_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:black_stained_glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:red_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:glass_pane"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:black_stained_glass_pane"));
new GlassConnectionHandler("paneConnections", "minecraft:iron_bars"); actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:glass_pane"));
actions.add(new GlassConnectionHandler("paneConnections").getInitAction("minecraft:iron_bars"));
return actions;
} }
public GlassConnectionHandler(String blockConnections, String key) { public GlassConnectionHandler(String blockConnections) {
super(blockConnections, key); super(blockConnections);
} }
@Override @Override

Datei anzeigen

@ -2,11 +2,11 @@ package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections;
public class MelonConnectionHandler extends AbstractStempConnectionHandler { public class MelonConnectionHandler extends AbstractStempConnectionHandler {
public MelonConnectionHandler(String baseStateId, String blockId, String toKey) { public MelonConnectionHandler(String baseStateId) {
super(baseStateId, blockId, toKey); super(baseStateId);
} }
static void init() { static ConnectionData.ConnectorInitAction init() {
new MelonConnectionHandler("minecraft:melon_stem[age=7]", "minecraft:melon", "minecraft:attached_melon_stem"); return new MelonConnectionHandler("minecraft:melon_stem[age=7]").getInitAction("minecraft:melon", "minecraft:attached_melon_stem");
} }
} }

Datei anzeigen

@ -2,11 +2,11 @@ package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections;
public class NetherFenceConnectionHandler extends AbstractFenceConnectionHandler { public class NetherFenceConnectionHandler extends AbstractFenceConnectionHandler {
static void init() { static ConnectionData.ConnectorInitAction init() {
new NetherFenceConnectionHandler("netherFenceConnections", "minecraft:nether_brick_fence"); return new NetherFenceConnectionHandler("netherFenceConnections").getInitAction("minecraft:nether_brick_fence");
} }
public NetherFenceConnectionHandler(String blockConnections, String key) { public NetherFenceConnectionHandler(String blockConnections) {
super(blockConnections, key); super(blockConnections);
} }
} }

Datei anzeigen

@ -2,11 +2,11 @@ package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections;
public class PumpkinConnectionHandler extends AbstractStempConnectionHandler { public class PumpkinConnectionHandler extends AbstractStempConnectionHandler {
static void init() { static ConnectionData.ConnectorInitAction init() {
new PumpkinConnectionHandler("minecraft:pumpkin_stem[age=7]", "minecraft:carved_pumpkin", "minecraft:attached_pumpkin_stem"); return new PumpkinConnectionHandler("minecraft:pumpkin_stem[age=7]").getInitAction("minecraft:carved_pumpkin", "minecraft:attached_pumpkin_stem");
} }
public PumpkinConnectionHandler(String baseStateId, String blockId, String toKey) { public PumpkinConnectionHandler(String baseStateId) {
super(baseStateId, blockId, toKey); super(baseStateId);
} }
} }

Datei anzeigen

@ -14,18 +14,19 @@ public class RedstoneConnectionHandler extends ConnectionHandler {
private static Map<Short, Integer> connectedBlockStates = new HashMap<>(); private static Map<Short, Integer> connectedBlockStates = new HashMap<>();
private static Map<Integer, Integer> powerMappings = new HashMap<>(); private static Map<Integer, Integer> powerMappings = new HashMap<>();
static void init() { static ConnectionData.ConnectorInitAction init() {
RedstoneConnectionHandler connectionHandler = new RedstoneConnectionHandler(); final RedstoneConnectionHandler connectionHandler = new RedstoneConnectionHandler();
String redstoneKey = "minecraft:redstone_wire"; final String redstoneKey = "minecraft:redstone_wire";
for (Map.Entry<String, Integer> blockState : ConnectionData.keyToId.entrySet()) { return new ConnectionData.ConnectorInitAction() {
String key = blockState.getKey().split("\\[")[0]; @Override
if (!redstoneKey.equals(key)) continue; public void check(WrappedBlockData blockData) {
redstone.add(blockState.getValue()); if (!redstoneKey.equals(blockData.getMinecraftKey())) return;
ConnectionData.connectionHandlerMap.put(blockState.getValue(), connectionHandler); redstone.add(blockData.getSavedBlockStateId());
WrappedBlockData blockData = WrappedBlockData.fromStateId(blockState.getValue()); ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), connectionHandler);
connectedBlockStates.put(getStates(blockData), blockData.getBlockStateId()); connectedBlockStates.put(getStates(blockData), blockData.getSavedBlockStateId());
powerMappings.put(blockData.getBlockStateId(), Integer.valueOf(blockData.getValue("power"))); powerMappings.put(blockData.getSavedBlockStateId(), Integer.valueOf(blockData.getValue("power")));
} }
};
} }
private static short getStates(WrappedBlockData data) { private static short getStates(WrappedBlockData data) {

Datei anzeigen

@ -0,0 +1,51 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.blockconnections;
import us.myles.ViaVersion.api.Pair;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.minecraft.BlockFace;
import us.myles.ViaVersion.api.minecraft.Position;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class SnowyGrassConnectionHandler extends ConnectionHandler {
private static Map<Pair<Integer, Boolean>, Integer> grassBlocks = new HashMap<>();
private static Set<Integer> snows = new HashSet<>();
static ConnectionData.ConnectorInitAction init() {
final Set<String> snowyGrassBlocks = new HashSet<>();
snowyGrassBlocks.add("minecraft:grass_block");
snowyGrassBlocks.add("minecraft:podzol");
snowyGrassBlocks.add("minecraft:mycelium");
final SnowyGrassConnectionHandler handler = new SnowyGrassConnectionHandler();
return new ConnectionData.ConnectorInitAction() {
@Override
public void check(WrappedBlockData blockData) {
if (snowyGrassBlocks.contains(blockData.getMinecraftKey())) {
ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), handler);
blockData.set("snowy", "true");
grassBlocks.put(new Pair<>(blockData.getSavedBlockStateId(), true), blockData.getBlockStateId());
blockData.set("snowy", "false");
grassBlocks.put(new Pair<>(blockData.getSavedBlockStateId(), false), blockData.getBlockStateId());
}
if (blockData.getMinecraftKey().equals("minecraft:snow") || blockData.getMinecraftKey().equals("minecraft:snow_block")) {
ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), handler);
snows.add(blockData.getSavedBlockStateId());
}
}
};
}
@Override
public int connect(UserConnection user, Position position, int blockState) {
int blockUpId = getBlockData(user, position.getRelative(BlockFace.TOP));
Integer newId = grassBlocks.get(new Pair<>(blockState, snows.contains(blockUpId)));
if (newId != null) {
return newId;
}
return blockState;
}
}

Datei anzeigen

@ -16,8 +16,8 @@ public class StairConnectionHandler extends ConnectionHandler {
private static Map<Integer, StairData> stairDataMap = new HashMap<>(); private static Map<Integer, StairData> stairDataMap = new HashMap<>();
private static Map<Short, Integer> connectedBlocks = new HashMap<>(); private static Map<Short, Integer> connectedBlocks = new HashMap<>();
static void init() { static ConnectionData.ConnectorInitAction init() {
List<String> baseStairs = new LinkedList<>(); final List<String> baseStairs = new LinkedList<>();
baseStairs.add("minecraft:oak_stairs"); baseStairs.add("minecraft:oak_stairs");
baseStairs.add("minecraft:cobblestone_stairs"); baseStairs.add("minecraft:cobblestone_stairs");
baseStairs.add("minecraft:brick_stairs"); baseStairs.add("minecraft:brick_stairs");
@ -36,14 +36,14 @@ public class StairConnectionHandler extends ConnectionHandler {
baseStairs.add("minecraft:prismarine_brick_stairs"); baseStairs.add("minecraft:prismarine_brick_stairs");
baseStairs.add("minecraft:dark_prismarine_stairs"); baseStairs.add("minecraft:dark_prismarine_stairs");
StairConnectionHandler connectionHandler = new StairConnectionHandler(); final StairConnectionHandler connectionHandler = new StairConnectionHandler();
for (Map.Entry<String, Integer> blockState : ConnectionData.keyToId.entrySet()) { return new ConnectionData.ConnectorInitAction() {
String key = blockState.getKey().split("\\[")[0]; @Override
int type = baseStairs.indexOf(key); public void check(WrappedBlockData blockData) {
if (type == -1) continue; int type = baseStairs.indexOf(blockData.getMinecraftKey());
if (type == -1) return;
WrappedBlockData blockData = WrappedBlockData.fromString(blockState.getKey()); if (blockData.getValue("waterlogged").equals("true")) return;
if (blockData.getValue("waterlogged").equals("true")) continue;
byte shape; byte shape;
switch (blockData.getValue("shape")) { switch (blockData.getValue("shape")) {
@ -52,7 +52,7 @@ public class StairConnectionHandler extends ConnectionHandler {
case "inner_right": shape = 2; break; case "inner_right": shape = 2; break;
case "outer_left": shape = 3; break; case "outer_left": shape = 3; break;
case "outer_right": shape = 4; break; case "outer_right": shape = 4; break;
default: continue; default: return;
} }
StairData stairData = new StairData( StairData stairData = new StairData(
@ -61,11 +61,12 @@ public class StairConnectionHandler extends ConnectionHandler {
BlockFace.valueOf(blockData.getValue("facing").toUpperCase()) BlockFace.valueOf(blockData.getValue("facing").toUpperCase())
); );
stairDataMap.put(blockState.getValue(), stairData); stairDataMap.put(blockData.getSavedBlockStateId(), stairData);
connectedBlocks.put(getStates(stairData), blockState.getValue()); connectedBlocks.put(getStates(stairData), blockData.getSavedBlockStateId());
ConnectionData.connectionHandlerMap.put(blockState.getValue(), connectionHandler); ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), connectionHandler);
} }
};
} }
private static short getStates(StairData stairData) { private static short getStates(StairData stairData) {
@ -98,15 +99,15 @@ public class StairConnectionHandler extends ConnectionHandler {
StairData relativeStair = stairDataMap.get(getBlockData(user, position.getRelative(facing))); StairData relativeStair = stairDataMap.get(getBlockData(user, position.getRelative(facing)));
if (relativeStair != null && relativeStair.isBottom() == stair.isBottom()) { if (relativeStair != null && relativeStair.isBottom() == stair.isBottom()) {
BlockFace facing2 = relativeStair.getFacing(); BlockFace facing2 = relativeStair.getFacing();
if (facing.getAxis() != facing2.getAxis() && checkOpposite(user, stair, position, facing2.opposite())){ if (facing.getAxis() != facing2.getAxis() && checkOpposite(user, stair, position, facing2.opposite())) {
return facing2 == rotateAntiClockwise(facing) ? 3 : 4; // outer_left : outer_right return facing2 == rotateAntiClockwise(facing) ? 3 : 4; // outer_left : outer_right
} }
} }
relativeStair = stairDataMap.get(getBlockData(user, position.getRelative(facing.opposite()))); relativeStair = stairDataMap.get(getBlockData(user, position.getRelative(facing.opposite())));
if(relativeStair != null && relativeStair.isBottom() == stair.isBottom()) { if (relativeStair != null && relativeStair.isBottom() == stair.isBottom()) {
BlockFace facing2 = relativeStair.getFacing(); BlockFace facing2 = relativeStair.getFacing();
if (facing.getAxis() != facing2.getAxis() && checkOpposite(user, stair, position, facing2)){ if (facing.getAxis() != facing2.getAxis() && checkOpposite(user, stair, position, facing2)) {
return facing2 == rotateAntiClockwise(facing) ? 1 : 2; // inner_left : inner_right return facing2 == rotateAntiClockwise(facing) ? 1 : 2; // inner_left : inner_right
} }
} }

Datei anzeigen

@ -15,29 +15,27 @@ public class TripwireConnectionHandler extends ConnectionHandler {
private static Map<Byte, Integer> connectedBlocks = new HashMap<>(); private static Map<Byte, Integer> connectedBlocks = new HashMap<>();
private static Map<Integer, BlockFace> tripwireHooks = new HashMap<>(); private static Map<Integer, BlockFace> tripwireHooks = new HashMap<>();
static void init() { static ConnectionData.ConnectorInitAction init() {
TripwireConnectionHandler connectionHandler = new TripwireConnectionHandler(); final TripwireConnectionHandler connectionHandler = new TripwireConnectionHandler();
for (Map.Entry<String, Integer> blockState : ConnectionData.keyToId.entrySet()) { return new ConnectionData.ConnectorInitAction() {
String key = blockState.getKey().split("\\[")[0]; @Override
public void check(WrappedBlockData blockData) {
if (key.equals("minecraft:tripwire_hook")) { if (blockData.getMinecraftKey().equals("minecraft:tripwire_hook")) {
WrappedBlockData blockData = WrappedBlockData.fromString(blockState.getKey()); tripwireHooks.put(blockData.getSavedBlockStateId(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase()));
tripwireHooks.put(blockState.getValue(), BlockFace.valueOf(blockData.getValue("facing").toUpperCase())); } else if (blockData.getMinecraftKey().equals("minecraft:tripwire")) {
} else if (key.equals("minecraft:tripwire")) {
WrappedBlockData blockData = WrappedBlockData.fromString(blockState.getKey());
TripwireData tripwireData = new TripwireData( TripwireData tripwireData = new TripwireData(
blockData.getValue("attached").equals("true"), blockData.getValue("attached").equals("true"),
blockData.getValue("disarmed").equals("true"), blockData.getValue("disarmed").equals("true"),
blockData.getValue("powered").equals("true") blockData.getValue("powered").equals("true")
); );
tripwireDataMap.put(blockState.getValue(), tripwireData); tripwireDataMap.put(blockData.getSavedBlockStateId(), tripwireData);
connectedBlocks.put(getStates(blockData), blockState.getValue()); connectedBlocks.put(getStates(blockData), blockData.getSavedBlockStateId());
ConnectionData.connectionHandlerMap.put(blockState.getValue(), connectionHandler); ConnectionData.connectionHandlerMap.put(blockData.getSavedBlockStateId(), connectionHandler);
} }
} }
};
} }
private static byte getStates(WrappedBlockData blockData) { private static byte getStates(WrappedBlockData blockData) {

Datei anzeigen

@ -4,30 +4,35 @@ import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.minecraft.BlockFace; import us.myles.ViaVersion.api.minecraft.BlockFace;
import us.myles.ViaVersion.api.minecraft.Position; import us.myles.ViaVersion.api.minecraft.Position;
import java.util.ArrayList;
import java.util.List;
public class WallConnectionHandler extends AbstractFenceConnectionHandler { public class WallConnectionHandler extends AbstractFenceConnectionHandler {
private static final BlockFace[] BLOCK_FACES = {BlockFace.EAST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.WEST}; private static final BlockFace[] BLOCK_FACES = {BlockFace.EAST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.WEST};
private static final int[] OPPOSITES = {3, 2, 1, 0}; private static final int[] OPPOSITES = {3, 2, 1, 0};
static void init() { static List<ConnectionData.ConnectorInitAction> init() {
new WallConnectionHandler("cobbleWallConnections", "minecraft:cobblestone_wall"); List<ConnectionData.ConnectorInitAction> actions = new ArrayList<>(2);
new WallConnectionHandler("cobbleWallConnections", "minecraft:mossy_cobblestone_wall"); actions.add(new WallConnectionHandler("cobbleWallConnections").getInitAction("minecraft:cobblestone_wall"));
actions.add(new WallConnectionHandler("cobbleWallConnections").getInitAction("minecraft:mossy_cobblestone_wall"));
return actions;
} }
public WallConnectionHandler(String blockConnections, String key) { public WallConnectionHandler(String blockConnections) {
super(blockConnections, key); super(blockConnections);
} }
@Override @Override
protected byte getStates(WrappedBlockData blockData) { protected byte getStates(WrappedBlockData blockData) {
byte states = super.getStates(blockData); byte states = super.getStates(blockData);
if (blockData.getValue("up").equals("true")) states |= 32; if (blockData.getValue("up").equals("true")) states |= 16;
return states; return states;
} }
protected byte getStates(UserConnection user, Position position, int blockState) { protected byte getStates(UserConnection user, Position position, int blockState) {
byte states = super.getStates(user, position, blockState); byte states = super.getStates(user, position, blockState);
if (up(user, position)) states |= 32; if (up(user, position)) states |= 16;
return states; return states;
} }

Datei anzeigen

@ -9,12 +9,14 @@ import java.util.Map.Entry;
public class WrappedBlockData { public class WrappedBlockData {
@Getter @Getter
private String minecraftKey; private String minecraftKey;
@Getter
private int savedBlockStateId;
private LinkedHashMap<String, String> blockData = new LinkedHashMap<>(); private LinkedHashMap<String, String> blockData = new LinkedHashMap<>();
public static WrappedBlockData fromString(String s) { public static WrappedBlockData fromString(String s) {
String[] array = s.split("\\["); String[] array = s.split("\\[");
String key = array[0]; String key = array[0];
WrappedBlockData wrappedBlockdata = new WrappedBlockData(key); WrappedBlockData wrappedBlockdata = new WrappedBlockData(key, ConnectionData.getId(s));
if (array.length > 1) { if (array.length > 1) {
String blockData = array[1]; String blockData = array[1];
blockData = blockData.replace("]", ""); blockData = blockData.replace("]", "");
@ -36,8 +38,9 @@ public class WrappedBlockData {
return fromString("minecraft:air"); return fromString("minecraft:air");
} }
private WrappedBlockData(String key) { private WrappedBlockData(String minecraftKey, int savedBlockStateId) {
minecraftKey = key; this.minecraftKey = minecraftKey;
this.savedBlockStateId = savedBlockStateId;
} }
public String toString() { public String toString() {

Datei anzeigen

@ -67,7 +67,7 @@ public class MappingData {
String[] keyAndTranslation = line.split("=", 2); String[] keyAndTranslation = line.split("=", 2);
if (keyAndTranslation.length != 2) continue; if (keyAndTranslation.length != 2) continue;
String key = keyAndTranslation[0]; String key = keyAndTranslation[0];
String translation = keyAndTranslation[1]; String translation = keyAndTranslation[1].replaceAll("%(\\d\\$)?d", "%$1s");
if (!translateData.containsKey(key)) { if (!translateData.containsKey(key)) {
translateMapping.put(key, translation); translateMapping.put(key, translation);
} else { } else {

Datei anzeigen

@ -11,11 +11,10 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.WorldPackets;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.concurrent.ThreadLocalRandom;
public class ParticleRewriter { public class ParticleRewriter {
private static List<NewParticle> particles = new LinkedList<>(); private static List<NewParticle> particles = new LinkedList<>();
private static Random rand = new Random();
static { static {
add(34); // (0->34) explode -> minecraft:poof add(34); // (0->34) explode -> minecraft:poof
@ -108,17 +107,17 @@ public class ParticleRewriter {
return new ParticleDataHandler() { return new ParticleDataHandler() {
@Override @Override
public Particle handler(Particle particle, Integer[] data) { public Particle handler(Particle particle, Integer[] data) {
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, randomFloat())); // Red 0 - 1 particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, randomBool() ? 1f : 0f)); // Red 0 - 1
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, randomFloat())); // Green 0 - 1 particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, 0f)); // Green 0 - 1
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, randomFloat())); // Blue 0 - 1 particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, randomBool() ? 1f : 0f)); // Blue 0 - 1
particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, 1));// Scale 0.01 - 4 particle.getArguments().add(new Particle.ParticleData(Type.FLOAT, 1f));// Scale 0.01 - 4
return particle; return particle;
} }
}; };
} }
private static float randomFloat() { private static boolean randomBool() {
return rand.nextFloat(); return ThreadLocalRandom.current().nextBoolean();
} }
// Rewrite IconCrack items to new format :) // Rewrite IconCrack items to new format :)

Datei anzeigen

@ -615,7 +615,7 @@ public class InventoryPackets {
ench.add(enchEntry); ench.add(enchEntry);
} }
} }
tag.remove("Enchantment"); tag.remove("Enchantments");
tag.put(ench); tag.put(ench);
} }
if (tag.get("StoredEnchantments") instanceof ListTag) { if (tag.get("StoredEnchantments") instanceof ListTag) {

Datei anzeigen

@ -175,12 +175,13 @@ public class WorldPackets {
if (Via.getConfig().isServersideBlockConnections()) { if (Via.getConfig().isServersideBlockConnections()) {
UserConnection userConnection = wrapper.user(); UserConnection userConnection = wrapper.user();
ConnectionData.updateBlockStorage(userConnection, position, newId);
if (ConnectionData.connects(newId)) { if (ConnectionData.connects(newId)) {
newId = ConnectionData.connect(userConnection, position, newId); newId = ConnectionData.connect(userConnection, position, newId);
} }
ConnectionData.updateBlockStorage(userConnection, position, newId);
ConnectionData.update(userConnection, position); ConnectionData.update(userConnection, position);
} }
@ -415,15 +416,20 @@ public class WorldPackets {
if (particle.getId() == 11) { if (particle.getId() == 11) {
int count = wrapper.get(Type.INT, 1); int count = wrapper.get(Type.INT, 1);
float speed = wrapper.get(Type.FLOAT, 6); float speed = wrapper.get(Type.FLOAT, 6);
// Only handle for count = 0 & speed = 1 // Only handle for count = 0
if (count == 0 && speed == 1) { if (count == 0) {
wrapper.set(Type.INT, 1, 1); wrapper.set(Type.INT, 1, 1);
wrapper.set(Type.FLOAT, 6, 0f); wrapper.set(Type.FLOAT, 6, 0f);
List<Particle.ParticleData> arguments = particle.getArguments(); List<Particle.ParticleData> arguments = particle.getArguments();
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
//RGB values are represented by the X/Y/Z offset //RGB values are represented by the X/Y/Z offset
arguments.get(i).setValue(wrapper.get(Type.FLOAT, i + 3)); float colorValue = wrapper.get(Type.FLOAT, i + 3) * speed;
if (colorValue == 0 && i == 0) {
// https://minecraft.gamepedia.com/User:Alphappy/reddust
colorValue = 1;
}
arguments.get(i).setValue(colorValue);
wrapper.set(Type.FLOAT, i + 3, 0f); wrapper.set(Type.FLOAT, i + 3, 0f);
} }
} }

Datei anzeigen

@ -1,76 +1,136 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage; package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage;
import lombok.Data;
import lombok.EqualsAndHashCode;
import us.myles.ViaVersion.api.Pair; import us.myles.ViaVersion.api.Pair;
import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.data.StoredObject; import us.myles.ViaVersion.api.data.StoredObject;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.minecraft.Position; import us.myles.ViaVersion.api.minecraft.Position;
import us.myles.ViaVersion.api.minecraft.chunks.NibbleArray;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.MappingData;
import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.WorldPackets;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class BlockConnectionStorage extends StoredObject { public class BlockConnectionStorage extends StoredObject {
private Map<Pair<Integer, Integer>, Map<BlockPositon, Integer>> blockStorage = new HashMap<>(); private Map<Long, Pair<byte[], NibbleArray>> blockStorage = createLongObjectMap();
private static Constructor<?> fastUtilLongObjectHashMap;
private static HashMap<Short, Short> reverseBlockMappings;
static {
try {
fastUtilLongObjectHashMap = Class.forName("it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap").getConstructor();
Via.getPlatform().getLogger().info("Using FastUtil Long2ObjectOpenHashMap for block connections");
} catch (ClassNotFoundException | NoSuchMethodException ignored) {
}
reverseBlockMappings = new HashMap<>();
for (int i = 0; i < 4096; i++) {
int newBlock = MappingData.blockMappings.getNewBlock(i);
if (newBlock != -1) reverseBlockMappings.put((short) newBlock, (short) i);
}
}
public BlockConnectionStorage(UserConnection user) { public BlockConnectionStorage(UserConnection user) {
super(user); super(user);
} }
public void store(Position position, int blockState) { public void store(Position position, int blockState) {
Pair pair = getPair(position); Short mapping = reverseBlockMappings.get((short) blockState);
Map<BlockPositon, Integer> map = getChunkMap(pair); if (mapping == null) return;
map.put(new BlockPositon(position), blockState); blockState = mapping;
long pair = getChunkSectionIndex(position);
Pair<byte[], NibbleArray> map = getChunkSection(pair, (blockState & 0xF) != 0);
int blockIndex = encodeBlockPos(position);
map.getKey()[blockIndex] = (byte) (blockState >> 4);
NibbleArray nibbleArray = map.getValue();
if (nibbleArray != null) nibbleArray.set(blockIndex, blockState);
} }
public int get(Position position) { public int get(Position position) {
Pair pair = getPair(position); long pair = getChunkSectionIndex(position);
Map<BlockPositon, Integer> map = getChunkMap(pair); Pair<byte[], NibbleArray> map = blockStorage.get(pair);
BlockPositon blockPositon = new BlockPositon(position); if (map == null) return 0;
return map.containsKey(blockPositon) ? map.get(blockPositon) : 0; short blockPosition = encodeBlockPos(position);
NibbleArray nibbleArray = map.getValue();
return WorldPackets.toNewId(
((map.getKey()[blockPosition] & 0xFF) << 4)
| (nibbleArray == null ? 0 : nibbleArray.get(blockPosition))
);
} }
public void remove(Position position) { public void remove(Position position) {
Pair pair = getPair(position); long pair = getChunkSectionIndex(position);
Map<BlockPositon, Integer> map = getChunkMap(pair); Pair<byte[], NibbleArray> map = blockStorage.get(pair);
map.remove(new BlockPositon(position)); if (map == null) return;
if (map.isEmpty()) { int blockIndex = encodeBlockPos(position);
blockStorage.remove(pair); NibbleArray nibbleArray = map.getValue();
if (nibbleArray != null) {
nibbleArray.set(blockIndex, 0);
boolean allZero = true;
for (int i = 0; i < 4096; i++) {
if (nibbleArray.get(i) != 0) {
allZero = false;
break;
} }
} }
if (allZero) map.setValue(null);
}
map.getKey()[blockIndex] = 0;
for (short entry : map.getKey()) {
if (entry != 0) return;
}
blockStorage.remove(pair);
}
public void clear() { public void clear() {
blockStorage.clear(); blockStorage.clear();
} }
public void unloadChunk(int x, int z) { public void unloadChunk(int x, int z) {
blockStorage.remove(new Pair<>(x, z)); for (int y = 0; y < 256; y += 16) {
blockStorage.remove(getChunkSectionIndex(x, y, z));
}
} }
private Map<BlockPositon, Integer> getChunkMap(Pair pair) { private Pair<byte[], NibbleArray> getChunkSection(long index, boolean requireNibbleArray) {
Map<BlockPositon, Integer> map = blockStorage.get(pair); Pair<byte[], NibbleArray> map = blockStorage.get(index);
if (map == null) { if (map == null) {
map = new HashMap<>(); map = new Pair<>(new byte[4096], null);
blockStorage.put(pair, map); blockStorage.put(index, map);
}
if (map.getValue() == null && requireNibbleArray) {
map.setValue(new NibbleArray(4096));
} }
return map; return map;
} }
private Pair<Integer, Integer> getPair(Position position) { private long getChunkSectionIndex(int x, int y, int z) {
int chunkX = (int) (position.getX() >> 4); return (((x >> 4) & 0x3FFFFFFL) << 38) | (((y >> 4) & 0xFFFL) << 26) | ((z >> 4) & 0x3FFFFFFL);
int chunkZ = (int) (position.getZ() >> 4);
return new Pair<>(chunkX, chunkZ);
} }
@EqualsAndHashCode private long getChunkSectionIndex(Position position) {
@Data return getChunkSectionIndex(position.getX().intValue(), position.getY().intValue(), position.getZ().intValue());
private class BlockPositon {
int x, y, z;
public BlockPositon(Position position) {
x = position.getX().intValue();
y = position.getY().intValue();
z = position.getZ().intValue();
} }
private short encodeBlockPos(int x, int y, int z) {
return (short) (((y & 0xF) << 8) | ((x & 0xF) << 4) | (z & 0xF));
}
private short encodeBlockPos(Position pos) {
return encodeBlockPos(pos.getX().intValue(), pos.getY().intValue(), pos.getZ().intValue());
}
private <T> Map<Long, T> createLongObjectMap() {
if (fastUtilLongObjectHashMap != null) {
try {
return (Map<Long, T>) fastUtilLongObjectHashMap.newInstance();
} catch (IllegalAccessException | InstantiationException | InvocationTargetException e) {
e.printStackTrace();
}
}
return new HashMap<>();
} }
} }

Datei anzeigen

@ -1,29 +1,36 @@
package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage; package us.myles.ViaVersion.protocols.protocol1_13to1_12_2.storage;
import lombok.Getter;
import lombok.Setter;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.data.StoredObject; import us.myles.ViaVersion.api.data.StoredObject;
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.protocols.protocol1_13to1_12_2.Protocol1_13To1_12_2;
@Getter
@Setter
public class TabCompleteTracker extends StoredObject { public class TabCompleteTracker extends StoredObject {
private int transactionId; private int transactionId;
private String input; private String input;
private String lastTabComplete;
private long timeToSend;
public TabCompleteTracker(UserConnection user) { public TabCompleteTracker(UserConnection user) {
super(user); super(user);
} }
public int getTransactionId() { public void sendPacketToServer() {
return transactionId; if (lastTabComplete == null || timeToSend > System.currentTimeMillis()) return;
PacketWrapper wrapper = new PacketWrapper(0x01, null, getUser());
wrapper.write(Type.STRING, lastTabComplete);
wrapper.write(Type.BOOLEAN, false);
wrapper.write(Type.OPTIONAL_POSITION, null);
try {
wrapper.sendToServer(Protocol1_13To1_12_2.class);
} catch (Exception e) {
e.printStackTrace();
} }
lastTabComplete = null;
public void setTransactionId(int transactionId) {
this.transactionId = transactionId;
}
public String getInput() {
return input;
}
public void setInput(String input) {
this.input = input;
} }
} }

Datei anzeigen

@ -392,19 +392,6 @@ public class PlayerPackets {
/* Removed packets */ /* Removed packets */
// Map Bulk
protocol.registerOutgoing(State.PLAY, 0x26, 0x26, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
wrapper.cancel();
}
});
}
});
// Set Compression // Set Compression
protocol.registerOutgoing(State.PLAY, 0x46, 0x46, new PacketRemapper() { protocol.registerOutgoing(State.PLAY, 0x46, 0x46, new PacketRemapper() {
@Override @Override

Datei anzeigen

@ -114,6 +114,8 @@ team-colour-fix: true
suppress-1_13-conversion-errors: false suppress-1_13-conversion-errors: false
# 1.13 introduced new auto complete which can trigger "Kicked for spamming" for servers older than 1.13, the following option will disable it completely. # 1.13 introduced new auto complete which can trigger "Kicked for spamming" for servers older than 1.13, the following option will disable it completely.
disable-1_13-auto-complete: false disable-1_13-auto-complete: false
# The following option will delay the tab complete request in x ticks if greater than 0, if other tab-complete is received, the previous is cancelled
1_13-tab-complete-delay: 0
# For 1.13 clients the smallest (1 layer) snow doesn't have collision, this will send these as 2 snowlayers for 1.13+ clients to prevent them bugging through them # For 1.13 clients the smallest (1 layer) snow doesn't have collision, this will send these as 2 snowlayers for 1.13+ clients to prevent them bugging through them
fix-low-snow-collision: false fix-low-snow-collision: false
# #

Datei anzeigen

@ -7,11 +7,9 @@
"minecraft:polished_diorite", "minecraft:polished_diorite",
"minecraft:andesite", "minecraft:andesite",
"minecraft:polished_andesite", "minecraft:polished_andesite",
"minecraft:grass_block[snowy=true]",
"minecraft:grass_block[snowy=false]", "minecraft:grass_block[snowy=false]",
"minecraft:dirt", "minecraft:dirt",
"minecraft:coarse_dirt", "minecraft:coarse_dirt",
"minecraft:podzol[snowy=true]",
"minecraft:podzol[snowy=false]", "minecraft:podzol[snowy=false]",
"minecraft:cobblestone", "minecraft:cobblestone",
"minecraft:oak_planks", "minecraft:oak_planks",
@ -45,60 +43,12 @@
"minecraft:dark_oak_log[axis=x]", "minecraft:dark_oak_log[axis=x]",
"minecraft:dark_oak_log[axis=y]", "minecraft:dark_oak_log[axis=y]",
"minecraft:dark_oak_log[axis=z]", "minecraft:dark_oak_log[axis=z]",
"minecraft:stripped_spruce_log[axis=x]",
"minecraft:stripped_spruce_log[axis=y]",
"minecraft:stripped_spruce_log[axis=z]",
"minecraft:stripped_birch_log[axis=x]",
"minecraft:stripped_birch_log[axis=y]",
"minecraft:stripped_birch_log[axis=z]",
"minecraft:stripped_jungle_log[axis=x]",
"minecraft:stripped_jungle_log[axis=y]",
"minecraft:stripped_jungle_log[axis=z]",
"minecraft:stripped_acacia_log[axis=x]",
"minecraft:stripped_acacia_log[axis=y]",
"minecraft:stripped_acacia_log[axis=z]",
"minecraft:stripped_dark_oak_log[axis=x]",
"minecraft:stripped_dark_oak_log[axis=y]",
"minecraft:stripped_dark_oak_log[axis=z]",
"minecraft:stripped_oak_log[axis=x]",
"minecraft:stripped_oak_log[axis=y]",
"minecraft:stripped_oak_log[axis=z]",
"minecraft:oak_wood[axis=x]",
"minecraft:oak_wood[axis=y]", "minecraft:oak_wood[axis=y]",
"minecraft:oak_wood[axis=z]",
"minecraft:spruce_wood[axis=x]",
"minecraft:spruce_wood[axis=y]", "minecraft:spruce_wood[axis=y]",
"minecraft:spruce_wood[axis=z]",
"minecraft:birch_wood[axis=x]",
"minecraft:birch_wood[axis=y]", "minecraft:birch_wood[axis=y]",
"minecraft:birch_wood[axis=z]",
"minecraft:jungle_wood[axis=x]",
"minecraft:jungle_wood[axis=y]", "minecraft:jungle_wood[axis=y]",
"minecraft:jungle_wood[axis=z]",
"minecraft:acacia_wood[axis=x]",
"minecraft:acacia_wood[axis=y]", "minecraft:acacia_wood[axis=y]",
"minecraft:acacia_wood[axis=z]",
"minecraft:dark_oak_wood[axis=x]",
"minecraft:dark_oak_wood[axis=y]", "minecraft:dark_oak_wood[axis=y]",
"minecraft:dark_oak_wood[axis=z]",
"minecraft:stripped_oak_wood[axis=x]",
"minecraft:stripped_oak_wood[axis=y]",
"minecraft:stripped_oak_wood[axis=z]",
"minecraft:stripped_spruce_wood[axis=x]",
"minecraft:stripped_spruce_wood[axis=y]",
"minecraft:stripped_spruce_wood[axis=z]",
"minecraft:stripped_birch_wood[axis=x]",
"minecraft:stripped_birch_wood[axis=y]",
"minecraft:stripped_birch_wood[axis=z]",
"minecraft:stripped_jungle_wood[axis=x]",
"minecraft:stripped_jungle_wood[axis=y]",
"minecraft:stripped_jungle_wood[axis=z]",
"minecraft:stripped_acacia_wood[axis=x]",
"minecraft:stripped_acacia_wood[axis=y]",
"minecraft:stripped_acacia_wood[axis=z]",
"minecraft:stripped_dark_oak_wood[axis=x]",
"minecraft:stripped_dark_oak_wood[axis=y]",
"minecraft:stripped_dark_oak_wood[axis=z]",
"minecraft:sponge", "minecraft:sponge",
"minecraft:wet_sponge", "minecraft:wet_sponge",
"minecraft:lapis_ore", "minecraft:lapis_ore",
@ -118,506 +68,7 @@
"minecraft:sandstone", "minecraft:sandstone",
"minecraft:chiseled_sandstone", "minecraft:chiseled_sandstone",
"minecraft:cut_sandstone", "minecraft:cut_sandstone",
"minecraft:note_block[instrument=harp,note=0,powered=true]",
"minecraft:note_block[instrument=harp,note=0,powered=false]", "minecraft:note_block[instrument=harp,note=0,powered=false]",
"minecraft:note_block[instrument=harp,note=1,powered=true]",
"minecraft:note_block[instrument=harp,note=1,powered=false]",
"minecraft:note_block[instrument=harp,note=2,powered=true]",
"minecraft:note_block[instrument=harp,note=2,powered=false]",
"minecraft:note_block[instrument=harp,note=3,powered=true]",
"minecraft:note_block[instrument=harp,note=3,powered=false]",
"minecraft:note_block[instrument=harp,note=4,powered=true]",
"minecraft:note_block[instrument=harp,note=4,powered=false]",
"minecraft:note_block[instrument=harp,note=5,powered=true]",
"minecraft:note_block[instrument=harp,note=5,powered=false]",
"minecraft:note_block[instrument=harp,note=6,powered=true]",
"minecraft:note_block[instrument=harp,note=6,powered=false]",
"minecraft:note_block[instrument=harp,note=7,powered=true]",
"minecraft:note_block[instrument=harp,note=7,powered=false]",
"minecraft:note_block[instrument=harp,note=8,powered=true]",
"minecraft:note_block[instrument=harp,note=8,powered=false]",
"minecraft:note_block[instrument=harp,note=9,powered=true]",
"minecraft:note_block[instrument=harp,note=9,powered=false]",
"minecraft:note_block[instrument=harp,note=10,powered=true]",
"minecraft:note_block[instrument=harp,note=10,powered=false]",
"minecraft:note_block[instrument=harp,note=11,powered=true]",
"minecraft:note_block[instrument=harp,note=11,powered=false]",
"minecraft:note_block[instrument=harp,note=12,powered=true]",
"minecraft:note_block[instrument=harp,note=12,powered=false]",
"minecraft:note_block[instrument=harp,note=13,powered=true]",
"minecraft:note_block[instrument=harp,note=13,powered=false]",
"minecraft:note_block[instrument=harp,note=14,powered=true]",
"minecraft:note_block[instrument=harp,note=14,powered=false]",
"minecraft:note_block[instrument=harp,note=15,powered=true]",
"minecraft:note_block[instrument=harp,note=15,powered=false]",
"minecraft:note_block[instrument=harp,note=16,powered=true]",
"minecraft:note_block[instrument=harp,note=16,powered=false]",
"minecraft:note_block[instrument=harp,note=17,powered=true]",
"minecraft:note_block[instrument=harp,note=17,powered=false]",
"minecraft:note_block[instrument=harp,note=18,powered=true]",
"minecraft:note_block[instrument=harp,note=18,powered=false]",
"minecraft:note_block[instrument=harp,note=19,powered=true]",
"minecraft:note_block[instrument=harp,note=19,powered=false]",
"minecraft:note_block[instrument=harp,note=20,powered=true]",
"minecraft:note_block[instrument=harp,note=20,powered=false]",
"minecraft:note_block[instrument=harp,note=21,powered=true]",
"minecraft:note_block[instrument=harp,note=21,powered=false]",
"minecraft:note_block[instrument=harp,note=22,powered=true]",
"minecraft:note_block[instrument=harp,note=22,powered=false]",
"minecraft:note_block[instrument=harp,note=23,powered=true]",
"minecraft:note_block[instrument=harp,note=23,powered=false]",
"minecraft:note_block[instrument=harp,note=24,powered=true]",
"minecraft:note_block[instrument=harp,note=24,powered=false]",
"minecraft:note_block[instrument=basedrum,note=0,powered=true]",
"minecraft:note_block[instrument=basedrum,note=0,powered=false]",
"minecraft:note_block[instrument=basedrum,note=1,powered=true]",
"minecraft:note_block[instrument=basedrum,note=1,powered=false]",
"minecraft:note_block[instrument=basedrum,note=2,powered=true]",
"minecraft:note_block[instrument=basedrum,note=2,powered=false]",
"minecraft:note_block[instrument=basedrum,note=3,powered=true]",
"minecraft:note_block[instrument=basedrum,note=3,powered=false]",
"minecraft:note_block[instrument=basedrum,note=4,powered=true]",
"minecraft:note_block[instrument=basedrum,note=4,powered=false]",
"minecraft:note_block[instrument=basedrum,note=5,powered=true]",
"minecraft:note_block[instrument=basedrum,note=5,powered=false]",
"minecraft:note_block[instrument=basedrum,note=6,powered=true]",
"minecraft:note_block[instrument=basedrum,note=6,powered=false]",
"minecraft:note_block[instrument=basedrum,note=7,powered=true]",
"minecraft:note_block[instrument=basedrum,note=7,powered=false]",
"minecraft:note_block[instrument=basedrum,note=8,powered=true]",
"minecraft:note_block[instrument=basedrum,note=8,powered=false]",
"minecraft:note_block[instrument=basedrum,note=9,powered=true]",
"minecraft:note_block[instrument=basedrum,note=9,powered=false]",
"minecraft:note_block[instrument=basedrum,note=10,powered=true]",
"minecraft:note_block[instrument=basedrum,note=10,powered=false]",
"minecraft:note_block[instrument=basedrum,note=11,powered=true]",
"minecraft:note_block[instrument=basedrum,note=11,powered=false]",
"minecraft:note_block[instrument=basedrum,note=12,powered=true]",
"minecraft:note_block[instrument=basedrum,note=12,powered=false]",
"minecraft:note_block[instrument=basedrum,note=13,powered=true]",
"minecraft:note_block[instrument=basedrum,note=13,powered=false]",
"minecraft:note_block[instrument=basedrum,note=14,powered=true]",
"minecraft:note_block[instrument=basedrum,note=14,powered=false]",
"minecraft:note_block[instrument=basedrum,note=15,powered=true]",
"minecraft:note_block[instrument=basedrum,note=15,powered=false]",
"minecraft:note_block[instrument=basedrum,note=16,powered=true]",
"minecraft:note_block[instrument=basedrum,note=16,powered=false]",
"minecraft:note_block[instrument=basedrum,note=17,powered=true]",
"minecraft:note_block[instrument=basedrum,note=17,powered=false]",
"minecraft:note_block[instrument=basedrum,note=18,powered=true]",
"minecraft:note_block[instrument=basedrum,note=18,powered=false]",
"minecraft:note_block[instrument=basedrum,note=19,powered=true]",
"minecraft:note_block[instrument=basedrum,note=19,powered=false]",
"minecraft:note_block[instrument=basedrum,note=20,powered=true]",
"minecraft:note_block[instrument=basedrum,note=20,powered=false]",
"minecraft:note_block[instrument=basedrum,note=21,powered=true]",
"minecraft:note_block[instrument=basedrum,note=21,powered=false]",
"minecraft:note_block[instrument=basedrum,note=22,powered=true]",
"minecraft:note_block[instrument=basedrum,note=22,powered=false]",
"minecraft:note_block[instrument=basedrum,note=23,powered=true]",
"minecraft:note_block[instrument=basedrum,note=23,powered=false]",
"minecraft:note_block[instrument=basedrum,note=24,powered=true]",
"minecraft:note_block[instrument=basedrum,note=24,powered=false]",
"minecraft:note_block[instrument=snare,note=0,powered=true]",
"minecraft:note_block[instrument=snare,note=0,powered=false]",
"minecraft:note_block[instrument=snare,note=1,powered=true]",
"minecraft:note_block[instrument=snare,note=1,powered=false]",
"minecraft:note_block[instrument=snare,note=2,powered=true]",
"minecraft:note_block[instrument=snare,note=2,powered=false]",
"minecraft:note_block[instrument=snare,note=3,powered=true]",
"minecraft:note_block[instrument=snare,note=3,powered=false]",
"minecraft:note_block[instrument=snare,note=4,powered=true]",
"minecraft:note_block[instrument=snare,note=4,powered=false]",
"minecraft:note_block[instrument=snare,note=5,powered=true]",
"minecraft:note_block[instrument=snare,note=5,powered=false]",
"minecraft:note_block[instrument=snare,note=6,powered=true]",
"minecraft:note_block[instrument=snare,note=6,powered=false]",
"minecraft:note_block[instrument=snare,note=7,powered=true]",
"minecraft:note_block[instrument=snare,note=7,powered=false]",
"minecraft:note_block[instrument=snare,note=8,powered=true]",
"minecraft:note_block[instrument=snare,note=8,powered=false]",
"minecraft:note_block[instrument=snare,note=9,powered=true]",
"minecraft:note_block[instrument=snare,note=9,powered=false]",
"minecraft:note_block[instrument=snare,note=10,powered=true]",
"minecraft:note_block[instrument=snare,note=10,powered=false]",
"minecraft:note_block[instrument=snare,note=11,powered=true]",
"minecraft:note_block[instrument=snare,note=11,powered=false]",
"minecraft:note_block[instrument=snare,note=12,powered=true]",
"minecraft:note_block[instrument=snare,note=12,powered=false]",
"minecraft:note_block[instrument=snare,note=13,powered=true]",
"minecraft:note_block[instrument=snare,note=13,powered=false]",
"minecraft:note_block[instrument=snare,note=14,powered=true]",
"minecraft:note_block[instrument=snare,note=14,powered=false]",
"minecraft:note_block[instrument=snare,note=15,powered=true]",
"minecraft:note_block[instrument=snare,note=15,powered=false]",
"minecraft:note_block[instrument=snare,note=16,powered=true]",
"minecraft:note_block[instrument=snare,note=16,powered=false]",
"minecraft:note_block[instrument=snare,note=17,powered=true]",
"minecraft:note_block[instrument=snare,note=17,powered=false]",
"minecraft:note_block[instrument=snare,note=18,powered=true]",
"minecraft:note_block[instrument=snare,note=18,powered=false]",
"minecraft:note_block[instrument=snare,note=19,powered=true]",
"minecraft:note_block[instrument=snare,note=19,powered=false]",
"minecraft:note_block[instrument=snare,note=20,powered=true]",
"minecraft:note_block[instrument=snare,note=20,powered=false]",
"minecraft:note_block[instrument=snare,note=21,powered=true]",
"minecraft:note_block[instrument=snare,note=21,powered=false]",
"minecraft:note_block[instrument=snare,note=22,powered=true]",
"minecraft:note_block[instrument=snare,note=22,powered=false]",
"minecraft:note_block[instrument=snare,note=23,powered=true]",
"minecraft:note_block[instrument=snare,note=23,powered=false]",
"minecraft:note_block[instrument=snare,note=24,powered=true]",
"minecraft:note_block[instrument=snare,note=24,powered=false]",
"minecraft:note_block[instrument=hat,note=0,powered=true]",
"minecraft:note_block[instrument=hat,note=0,powered=false]",
"minecraft:note_block[instrument=hat,note=1,powered=true]",
"minecraft:note_block[instrument=hat,note=1,powered=false]",
"minecraft:note_block[instrument=hat,note=2,powered=true]",
"minecraft:note_block[instrument=hat,note=2,powered=false]",
"minecraft:note_block[instrument=hat,note=3,powered=true]",
"minecraft:note_block[instrument=hat,note=3,powered=false]",
"minecraft:note_block[instrument=hat,note=4,powered=true]",
"minecraft:note_block[instrument=hat,note=4,powered=false]",
"minecraft:note_block[instrument=hat,note=5,powered=true]",
"minecraft:note_block[instrument=hat,note=5,powered=false]",
"minecraft:note_block[instrument=hat,note=6,powered=true]",
"minecraft:note_block[instrument=hat,note=6,powered=false]",
"minecraft:note_block[instrument=hat,note=7,powered=true]",
"minecraft:note_block[instrument=hat,note=7,powered=false]",
"minecraft:note_block[instrument=hat,note=8,powered=true]",
"minecraft:note_block[instrument=hat,note=8,powered=false]",
"minecraft:note_block[instrument=hat,note=9,powered=true]",
"minecraft:note_block[instrument=hat,note=9,powered=false]",
"minecraft:note_block[instrument=hat,note=10,powered=true]",
"minecraft:note_block[instrument=hat,note=10,powered=false]",
"minecraft:note_block[instrument=hat,note=11,powered=true]",
"minecraft:note_block[instrument=hat,note=11,powered=false]",
"minecraft:note_block[instrument=hat,note=12,powered=true]",
"minecraft:note_block[instrument=hat,note=12,powered=false]",
"minecraft:note_block[instrument=hat,note=13,powered=true]",
"minecraft:note_block[instrument=hat,note=13,powered=false]",
"minecraft:note_block[instrument=hat,note=14,powered=true]",
"minecraft:note_block[instrument=hat,note=14,powered=false]",
"minecraft:note_block[instrument=hat,note=15,powered=true]",
"minecraft:note_block[instrument=hat,note=15,powered=false]",
"minecraft:note_block[instrument=hat,note=16,powered=true]",
"minecraft:note_block[instrument=hat,note=16,powered=false]",
"minecraft:note_block[instrument=hat,note=17,powered=true]",
"minecraft:note_block[instrument=hat,note=17,powered=false]",
"minecraft:note_block[instrument=hat,note=18,powered=true]",
"minecraft:note_block[instrument=hat,note=18,powered=false]",
"minecraft:note_block[instrument=hat,note=19,powered=true]",
"minecraft:note_block[instrument=hat,note=19,powered=false]",
"minecraft:note_block[instrument=hat,note=20,powered=true]",
"minecraft:note_block[instrument=hat,note=20,powered=false]",
"minecraft:note_block[instrument=hat,note=21,powered=true]",
"minecraft:note_block[instrument=hat,note=21,powered=false]",
"minecraft:note_block[instrument=hat,note=22,powered=true]",
"minecraft:note_block[instrument=hat,note=22,powered=false]",
"minecraft:note_block[instrument=hat,note=23,powered=true]",
"minecraft:note_block[instrument=hat,note=23,powered=false]",
"minecraft:note_block[instrument=hat,note=24,powered=true]",
"minecraft:note_block[instrument=hat,note=24,powered=false]",
"minecraft:note_block[instrument=bass,note=0,powered=true]",
"minecraft:note_block[instrument=bass,note=0,powered=false]",
"minecraft:note_block[instrument=bass,note=1,powered=true]",
"minecraft:note_block[instrument=bass,note=1,powered=false]",
"minecraft:note_block[instrument=bass,note=2,powered=true]",
"minecraft:note_block[instrument=bass,note=2,powered=false]",
"minecraft:note_block[instrument=bass,note=3,powered=true]",
"minecraft:note_block[instrument=bass,note=3,powered=false]",
"minecraft:note_block[instrument=bass,note=4,powered=true]",
"minecraft:note_block[instrument=bass,note=4,powered=false]",
"minecraft:note_block[instrument=bass,note=5,powered=true]",
"minecraft:note_block[instrument=bass,note=5,powered=false]",
"minecraft:note_block[instrument=bass,note=6,powered=true]",
"minecraft:note_block[instrument=bass,note=6,powered=false]",
"minecraft:note_block[instrument=bass,note=7,powered=true]",
"minecraft:note_block[instrument=bass,note=7,powered=false]",
"minecraft:note_block[instrument=bass,note=8,powered=true]",
"minecraft:note_block[instrument=bass,note=8,powered=false]",
"minecraft:note_block[instrument=bass,note=9,powered=true]",
"minecraft:note_block[instrument=bass,note=9,powered=false]",
"minecraft:note_block[instrument=bass,note=10,powered=true]",
"minecraft:note_block[instrument=bass,note=10,powered=false]",
"minecraft:note_block[instrument=bass,note=11,powered=true]",
"minecraft:note_block[instrument=bass,note=11,powered=false]",
"minecraft:note_block[instrument=bass,note=12,powered=true]",
"minecraft:note_block[instrument=bass,note=12,powered=false]",
"minecraft:note_block[instrument=bass,note=13,powered=true]",
"minecraft:note_block[instrument=bass,note=13,powered=false]",
"minecraft:note_block[instrument=bass,note=14,powered=true]",
"minecraft:note_block[instrument=bass,note=14,powered=false]",
"minecraft:note_block[instrument=bass,note=15,powered=true]",
"minecraft:note_block[instrument=bass,note=15,powered=false]",
"minecraft:note_block[instrument=bass,note=16,powered=true]",
"minecraft:note_block[instrument=bass,note=16,powered=false]",
"minecraft:note_block[instrument=bass,note=17,powered=true]",
"minecraft:note_block[instrument=bass,note=17,powered=false]",
"minecraft:note_block[instrument=bass,note=18,powered=true]",
"minecraft:note_block[instrument=bass,note=18,powered=false]",
"minecraft:note_block[instrument=bass,note=19,powered=true]",
"minecraft:note_block[instrument=bass,note=19,powered=false]",
"minecraft:note_block[instrument=bass,note=20,powered=true]",
"minecraft:note_block[instrument=bass,note=20,powered=false]",
"minecraft:note_block[instrument=bass,note=21,powered=true]",
"minecraft:note_block[instrument=bass,note=21,powered=false]",
"minecraft:note_block[instrument=bass,note=22,powered=true]",
"minecraft:note_block[instrument=bass,note=22,powered=false]",
"minecraft:note_block[instrument=bass,note=23,powered=true]",
"minecraft:note_block[instrument=bass,note=23,powered=false]",
"minecraft:note_block[instrument=bass,note=24,powered=true]",
"minecraft:note_block[instrument=bass,note=24,powered=false]",
"minecraft:note_block[instrument=flute,note=0,powered=true]",
"minecraft:note_block[instrument=flute,note=0,powered=false]",
"minecraft:note_block[instrument=flute,note=1,powered=true]",
"minecraft:note_block[instrument=flute,note=1,powered=false]",
"minecraft:note_block[instrument=flute,note=2,powered=true]",
"minecraft:note_block[instrument=flute,note=2,powered=false]",
"minecraft:note_block[instrument=flute,note=3,powered=true]",
"minecraft:note_block[instrument=flute,note=3,powered=false]",
"minecraft:note_block[instrument=flute,note=4,powered=true]",
"minecraft:note_block[instrument=flute,note=4,powered=false]",
"minecraft:note_block[instrument=flute,note=5,powered=true]",
"minecraft:note_block[instrument=flute,note=5,powered=false]",
"minecraft:note_block[instrument=flute,note=6,powered=true]",
"minecraft:note_block[instrument=flute,note=6,powered=false]",
"minecraft:note_block[instrument=flute,note=7,powered=true]",
"minecraft:note_block[instrument=flute,note=7,powered=false]",
"minecraft:note_block[instrument=flute,note=8,powered=true]",
"minecraft:note_block[instrument=flute,note=8,powered=false]",
"minecraft:note_block[instrument=flute,note=9,powered=true]",
"minecraft:note_block[instrument=flute,note=9,powered=false]",
"minecraft:note_block[instrument=flute,note=10,powered=true]",
"minecraft:note_block[instrument=flute,note=10,powered=false]",
"minecraft:note_block[instrument=flute,note=11,powered=true]",
"minecraft:note_block[instrument=flute,note=11,powered=false]",
"minecraft:note_block[instrument=flute,note=12,powered=true]",
"minecraft:note_block[instrument=flute,note=12,powered=false]",
"minecraft:note_block[instrument=flute,note=13,powered=true]",
"minecraft:note_block[instrument=flute,note=13,powered=false]",
"minecraft:note_block[instrument=flute,note=14,powered=true]",
"minecraft:note_block[instrument=flute,note=14,powered=false]",
"minecraft:note_block[instrument=flute,note=15,powered=true]",
"minecraft:note_block[instrument=flute,note=15,powered=false]",
"minecraft:note_block[instrument=flute,note=16,powered=true]",
"minecraft:note_block[instrument=flute,note=16,powered=false]",
"minecraft:note_block[instrument=flute,note=17,powered=true]",
"minecraft:note_block[instrument=flute,note=17,powered=false]",
"minecraft:note_block[instrument=flute,note=18,powered=true]",
"minecraft:note_block[instrument=flute,note=18,powered=false]",
"minecraft:note_block[instrument=flute,note=19,powered=true]",
"minecraft:note_block[instrument=flute,note=19,powered=false]",
"minecraft:note_block[instrument=flute,note=20,powered=true]",
"minecraft:note_block[instrument=flute,note=20,powered=false]",
"minecraft:note_block[instrument=flute,note=21,powered=true]",
"minecraft:note_block[instrument=flute,note=21,powered=false]",
"minecraft:note_block[instrument=flute,note=22,powered=true]",
"minecraft:note_block[instrument=flute,note=22,powered=false]",
"minecraft:note_block[instrument=flute,note=23,powered=true]",
"minecraft:note_block[instrument=flute,note=23,powered=false]",
"minecraft:note_block[instrument=flute,note=24,powered=true]",
"minecraft:note_block[instrument=flute,note=24,powered=false]",
"minecraft:note_block[instrument=bell,note=0,powered=true]",
"minecraft:note_block[instrument=bell,note=0,powered=false]",
"minecraft:note_block[instrument=bell,note=1,powered=true]",
"minecraft:note_block[instrument=bell,note=1,powered=false]",
"minecraft:note_block[instrument=bell,note=2,powered=true]",
"minecraft:note_block[instrument=bell,note=2,powered=false]",
"minecraft:note_block[instrument=bell,note=3,powered=true]",
"minecraft:note_block[instrument=bell,note=3,powered=false]",
"minecraft:note_block[instrument=bell,note=4,powered=true]",
"minecraft:note_block[instrument=bell,note=4,powered=false]",
"minecraft:note_block[instrument=bell,note=5,powered=true]",
"minecraft:note_block[instrument=bell,note=5,powered=false]",
"minecraft:note_block[instrument=bell,note=6,powered=true]",
"minecraft:note_block[instrument=bell,note=6,powered=false]",
"minecraft:note_block[instrument=bell,note=7,powered=true]",
"minecraft:note_block[instrument=bell,note=7,powered=false]",
"minecraft:note_block[instrument=bell,note=8,powered=true]",
"minecraft:note_block[instrument=bell,note=8,powered=false]",
"minecraft:note_block[instrument=bell,note=9,powered=true]",
"minecraft:note_block[instrument=bell,note=9,powered=false]",
"minecraft:note_block[instrument=bell,note=10,powered=true]",
"minecraft:note_block[instrument=bell,note=10,powered=false]",
"minecraft:note_block[instrument=bell,note=11,powered=true]",
"minecraft:note_block[instrument=bell,note=11,powered=false]",
"minecraft:note_block[instrument=bell,note=12,powered=true]",
"minecraft:note_block[instrument=bell,note=12,powered=false]",
"minecraft:note_block[instrument=bell,note=13,powered=true]",
"minecraft:note_block[instrument=bell,note=13,powered=false]",
"minecraft:note_block[instrument=bell,note=14,powered=true]",
"minecraft:note_block[instrument=bell,note=14,powered=false]",
"minecraft:note_block[instrument=bell,note=15,powered=true]",
"minecraft:note_block[instrument=bell,note=15,powered=false]",
"minecraft:note_block[instrument=bell,note=16,powered=true]",
"minecraft:note_block[instrument=bell,note=16,powered=false]",
"minecraft:note_block[instrument=bell,note=17,powered=true]",
"minecraft:note_block[instrument=bell,note=17,powered=false]",
"minecraft:note_block[instrument=bell,note=18,powered=true]",
"minecraft:note_block[instrument=bell,note=18,powered=false]",
"minecraft:note_block[instrument=bell,note=19,powered=true]",
"minecraft:note_block[instrument=bell,note=19,powered=false]",
"minecraft:note_block[instrument=bell,note=20,powered=true]",
"minecraft:note_block[instrument=bell,note=20,powered=false]",
"minecraft:note_block[instrument=bell,note=21,powered=true]",
"minecraft:note_block[instrument=bell,note=21,powered=false]",
"minecraft:note_block[instrument=bell,note=22,powered=true]",
"minecraft:note_block[instrument=bell,note=22,powered=false]",
"minecraft:note_block[instrument=bell,note=23,powered=true]",
"minecraft:note_block[instrument=bell,note=23,powered=false]",
"minecraft:note_block[instrument=bell,note=24,powered=true]",
"minecraft:note_block[instrument=bell,note=24,powered=false]",
"minecraft:note_block[instrument=guitar,note=0,powered=true]",
"minecraft:note_block[instrument=guitar,note=0,powered=false]",
"minecraft:note_block[instrument=guitar,note=1,powered=true]",
"minecraft:note_block[instrument=guitar,note=1,powered=false]",
"minecraft:note_block[instrument=guitar,note=2,powered=true]",
"minecraft:note_block[instrument=guitar,note=2,powered=false]",
"minecraft:note_block[instrument=guitar,note=3,powered=true]",
"minecraft:note_block[instrument=guitar,note=3,powered=false]",
"minecraft:note_block[instrument=guitar,note=4,powered=true]",
"minecraft:note_block[instrument=guitar,note=4,powered=false]",
"minecraft:note_block[instrument=guitar,note=5,powered=true]",
"minecraft:note_block[instrument=guitar,note=5,powered=false]",
"minecraft:note_block[instrument=guitar,note=6,powered=true]",
"minecraft:note_block[instrument=guitar,note=6,powered=false]",
"minecraft:note_block[instrument=guitar,note=7,powered=true]",
"minecraft:note_block[instrument=guitar,note=7,powered=false]",
"minecraft:note_block[instrument=guitar,note=8,powered=true]",
"minecraft:note_block[instrument=guitar,note=8,powered=false]",
"minecraft:note_block[instrument=guitar,note=9,powered=true]",
"minecraft:note_block[instrument=guitar,note=9,powered=false]",
"minecraft:note_block[instrument=guitar,note=10,powered=true]",
"minecraft:note_block[instrument=guitar,note=10,powered=false]",
"minecraft:note_block[instrument=guitar,note=11,powered=true]",
"minecraft:note_block[instrument=guitar,note=11,powered=false]",
"minecraft:note_block[instrument=guitar,note=12,powered=true]",
"minecraft:note_block[instrument=guitar,note=12,powered=false]",
"minecraft:note_block[instrument=guitar,note=13,powered=true]",
"minecraft:note_block[instrument=guitar,note=13,powered=false]",
"minecraft:note_block[instrument=guitar,note=14,powered=true]",
"minecraft:note_block[instrument=guitar,note=14,powered=false]",
"minecraft:note_block[instrument=guitar,note=15,powered=true]",
"minecraft:note_block[instrument=guitar,note=15,powered=false]",
"minecraft:note_block[instrument=guitar,note=16,powered=true]",
"minecraft:note_block[instrument=guitar,note=16,powered=false]",
"minecraft:note_block[instrument=guitar,note=17,powered=true]",
"minecraft:note_block[instrument=guitar,note=17,powered=false]",
"minecraft:note_block[instrument=guitar,note=18,powered=true]",
"minecraft:note_block[instrument=guitar,note=18,powered=false]",
"minecraft:note_block[instrument=guitar,note=19,powered=true]",
"minecraft:note_block[instrument=guitar,note=19,powered=false]",
"minecraft:note_block[instrument=guitar,note=20,powered=true]",
"minecraft:note_block[instrument=guitar,note=20,powered=false]",
"minecraft:note_block[instrument=guitar,note=21,powered=true]",
"minecraft:note_block[instrument=guitar,note=21,powered=false]",
"minecraft:note_block[instrument=guitar,note=22,powered=true]",
"minecraft:note_block[instrument=guitar,note=22,powered=false]",
"minecraft:note_block[instrument=guitar,note=23,powered=true]",
"minecraft:note_block[instrument=guitar,note=23,powered=false]",
"minecraft:note_block[instrument=guitar,note=24,powered=true]",
"minecraft:note_block[instrument=guitar,note=24,powered=false]",
"minecraft:note_block[instrument=chime,note=0,powered=true]",
"minecraft:note_block[instrument=chime,note=0,powered=false]",
"minecraft:note_block[instrument=chime,note=1,powered=true]",
"minecraft:note_block[instrument=chime,note=1,powered=false]",
"minecraft:note_block[instrument=chime,note=2,powered=true]",
"minecraft:note_block[instrument=chime,note=2,powered=false]",
"minecraft:note_block[instrument=chime,note=3,powered=true]",
"minecraft:note_block[instrument=chime,note=3,powered=false]",
"minecraft:note_block[instrument=chime,note=4,powered=true]",
"minecraft:note_block[instrument=chime,note=4,powered=false]",
"minecraft:note_block[instrument=chime,note=5,powered=true]",
"minecraft:note_block[instrument=chime,note=5,powered=false]",
"minecraft:note_block[instrument=chime,note=6,powered=true]",
"minecraft:note_block[instrument=chime,note=6,powered=false]",
"minecraft:note_block[instrument=chime,note=7,powered=true]",
"minecraft:note_block[instrument=chime,note=7,powered=false]",
"minecraft:note_block[instrument=chime,note=8,powered=true]",
"minecraft:note_block[instrument=chime,note=8,powered=false]",
"minecraft:note_block[instrument=chime,note=9,powered=true]",
"minecraft:note_block[instrument=chime,note=9,powered=false]",
"minecraft:note_block[instrument=chime,note=10,powered=true]",
"minecraft:note_block[instrument=chime,note=10,powered=false]",
"minecraft:note_block[instrument=chime,note=11,powered=true]",
"minecraft:note_block[instrument=chime,note=11,powered=false]",
"minecraft:note_block[instrument=chime,note=12,powered=true]",
"minecraft:note_block[instrument=chime,note=12,powered=false]",
"minecraft:note_block[instrument=chime,note=13,powered=true]",
"minecraft:note_block[instrument=chime,note=13,powered=false]",
"minecraft:note_block[instrument=chime,note=14,powered=true]",
"minecraft:note_block[instrument=chime,note=14,powered=false]",
"minecraft:note_block[instrument=chime,note=15,powered=true]",
"minecraft:note_block[instrument=chime,note=15,powered=false]",
"minecraft:note_block[instrument=chime,note=16,powered=true]",
"minecraft:note_block[instrument=chime,note=16,powered=false]",
"minecraft:note_block[instrument=chime,note=17,powered=true]",
"minecraft:note_block[instrument=chime,note=17,powered=false]",
"minecraft:note_block[instrument=chime,note=18,powered=true]",
"minecraft:note_block[instrument=chime,note=18,powered=false]",
"minecraft:note_block[instrument=chime,note=19,powered=true]",
"minecraft:note_block[instrument=chime,note=19,powered=false]",
"minecraft:note_block[instrument=chime,note=20,powered=true]",
"minecraft:note_block[instrument=chime,note=20,powered=false]",
"minecraft:note_block[instrument=chime,note=21,powered=true]",
"minecraft:note_block[instrument=chime,note=21,powered=false]",
"minecraft:note_block[instrument=chime,note=22,powered=true]",
"minecraft:note_block[instrument=chime,note=22,powered=false]",
"minecraft:note_block[instrument=chime,note=23,powered=true]",
"minecraft:note_block[instrument=chime,note=23,powered=false]",
"minecraft:note_block[instrument=chime,note=24,powered=true]",
"minecraft:note_block[instrument=chime,note=24,powered=false]",
"minecraft:note_block[instrument=xylophone,note=0,powered=true]",
"minecraft:note_block[instrument=xylophone,note=0,powered=false]",
"minecraft:note_block[instrument=xylophone,note=1,powered=true]",
"minecraft:note_block[instrument=xylophone,note=1,powered=false]",
"minecraft:note_block[instrument=xylophone,note=2,powered=true]",
"minecraft:note_block[instrument=xylophone,note=2,powered=false]",
"minecraft:note_block[instrument=xylophone,note=3,powered=true]",
"minecraft:note_block[instrument=xylophone,note=3,powered=false]",
"minecraft:note_block[instrument=xylophone,note=4,powered=true]",
"minecraft:note_block[instrument=xylophone,note=4,powered=false]",
"minecraft:note_block[instrument=xylophone,note=5,powered=true]",
"minecraft:note_block[instrument=xylophone,note=5,powered=false]",
"minecraft:note_block[instrument=xylophone,note=6,powered=true]",
"minecraft:note_block[instrument=xylophone,note=6,powered=false]",
"minecraft:note_block[instrument=xylophone,note=7,powered=true]",
"minecraft:note_block[instrument=xylophone,note=7,powered=false]",
"minecraft:note_block[instrument=xylophone,note=8,powered=true]",
"minecraft:note_block[instrument=xylophone,note=8,powered=false]",
"minecraft:note_block[instrument=xylophone,note=9,powered=true]",
"minecraft:note_block[instrument=xylophone,note=9,powered=false]",
"minecraft:note_block[instrument=xylophone,note=10,powered=true]",
"minecraft:note_block[instrument=xylophone,note=10,powered=false]",
"minecraft:note_block[instrument=xylophone,note=11,powered=true]",
"minecraft:note_block[instrument=xylophone,note=11,powered=false]",
"minecraft:note_block[instrument=xylophone,note=12,powered=true]",
"minecraft:note_block[instrument=xylophone,note=12,powered=false]",
"minecraft:note_block[instrument=xylophone,note=13,powered=true]",
"minecraft:note_block[instrument=xylophone,note=13,powered=false]",
"minecraft:note_block[instrument=xylophone,note=14,powered=true]",
"minecraft:note_block[instrument=xylophone,note=14,powered=false]",
"minecraft:note_block[instrument=xylophone,note=15,powered=true]",
"minecraft:note_block[instrument=xylophone,note=15,powered=false]",
"minecraft:note_block[instrument=xylophone,note=16,powered=true]",
"minecraft:note_block[instrument=xylophone,note=16,powered=false]",
"minecraft:note_block[instrument=xylophone,note=17,powered=true]",
"minecraft:note_block[instrument=xylophone,note=17,powered=false]",
"minecraft:note_block[instrument=xylophone,note=18,powered=true]",
"minecraft:note_block[instrument=xylophone,note=18,powered=false]",
"minecraft:note_block[instrument=xylophone,note=19,powered=true]",
"minecraft:note_block[instrument=xylophone,note=19,powered=false]",
"minecraft:note_block[instrument=xylophone,note=20,powered=true]",
"minecraft:note_block[instrument=xylophone,note=20,powered=false]",
"minecraft:note_block[instrument=xylophone,note=21,powered=true]",
"minecraft:note_block[instrument=xylophone,note=21,powered=false]",
"minecraft:note_block[instrument=xylophone,note=22,powered=true]",
"minecraft:note_block[instrument=xylophone,note=22,powered=false]",
"minecraft:note_block[instrument=xylophone,note=23,powered=true]",
"minecraft:note_block[instrument=xylophone,note=23,powered=false]",
"minecraft:note_block[instrument=xylophone,note=24,powered=true]",
"minecraft:note_block[instrument=xylophone,note=24,powered=false]",
"minecraft:white_wool", "minecraft:white_wool",
"minecraft:orange_wool", "minecraft:orange_wool",
"minecraft:magenta_wool", "minecraft:magenta_wool",
@ -658,7 +109,6 @@
"minecraft:clay", "minecraft:clay",
"minecraft:jukebox[has_record=true]", "minecraft:jukebox[has_record=true]",
"minecraft:jukebox[has_record=false]", "minecraft:jukebox[has_record=false]",
"minecraft:pumpkin",
"minecraft:netherrack", "minecraft:netherrack",
"minecraft:soul_sand", "minecraft:soul_sand",
"minecraft:carved_pumpkin[facing=north]", "minecraft:carved_pumpkin[facing=north]",
@ -680,199 +130,30 @@
"minecraft:cracked_stone_bricks", "minecraft:cracked_stone_bricks",
"minecraft:chiseled_stone_bricks", "minecraft:chiseled_stone_bricks",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true]", "minecraft:brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=false]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=false]", "minecraft:brown_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=false]", "minecraft:brown_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=false]", "minecraft:brown_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=true]", "minecraft:brown_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=false]", "minecraft:brown_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=true]", "minecraft:brown_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=false]", "minecraft:brown_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=true]", "minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=false]", "minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=false]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]",
"minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=false]", "minecraft:brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true]", "minecraft:red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=false]", "minecraft:red_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=false]", "minecraft:red_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=false]", "minecraft:red_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=true]", "minecraft:red_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=false]", "minecraft:red_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=true]", "minecraft:red_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=false]", "minecraft:red_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=true]", "minecraft:red_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=false]", "minecraft:red_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=false]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]",
"minecraft:red_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=false]", "minecraft:red_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true]", "minecraft:mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=true,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=true,north=false,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=true,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=true,east=false,north=false,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=true,up=false,west=true]", "minecraft:mushroom_stem[down=false,east=true,north=true,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=true,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=true,north=false,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=true,south=false,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=true,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=true,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=true,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=true,up=false,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=false,up=true,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=false,up=true,west=false]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=false,up=false,west=true]",
"minecraft:mushroom_stem[down=false,east=false,north=false,south=false,up=false,west=false]",
"minecraft:melon", "minecraft:melon",
"minecraft:mycelium[snowy=true]",
"minecraft:mycelium[snowy=false]", "minecraft:mycelium[snowy=false]",
"minecraft:nether_bricks", "minecraft:nether_bricks",
"minecraft:end_stone", "minecraft:end_stone",
@ -931,12 +212,6 @@
"minecraft:prismarine", "minecraft:prismarine",
"minecraft:prismarine_bricks", "minecraft:prismarine_bricks",
"minecraft:dark_prismarine", "minecraft:dark_prismarine",
"minecraft:prismarine_slab[type=double,waterlogged=true]",
"minecraft:prismarine_slab[type=double,waterlogged=false]",
"minecraft:prismarine_brick_slab[type=double,waterlogged=true]",
"minecraft:prismarine_brick_slab[type=double,waterlogged=false]",
"minecraft:dark_prismarine_slab[type=double,waterlogged=true]",
"minecraft:dark_prismarine_slab[type=double,waterlogged=false]",
"minecraft:hay_block[axis=x]", "minecraft:hay_block[axis=x]",
"minecraft:hay_block[axis=y]", "minecraft:hay_block[axis=y]",
"minecraft:hay_block[axis=z]", "minecraft:hay_block[axis=z]",
@ -946,37 +221,21 @@
"minecraft:red_sandstone", "minecraft:red_sandstone",
"minecraft:chiseled_red_sandstone", "minecraft:chiseled_red_sandstone",
"minecraft:cut_red_sandstone", "minecraft:cut_red_sandstone",
"minecraft:oak_slab[type=double,waterlogged=true]",
"minecraft:oak_slab[type=double,waterlogged=false]", "minecraft:oak_slab[type=double,waterlogged=false]",
"minecraft:spruce_slab[type=double,waterlogged=true]",
"minecraft:spruce_slab[type=double,waterlogged=false]", "minecraft:spruce_slab[type=double,waterlogged=false]",
"minecraft:birch_slab[type=double,waterlogged=true]",
"minecraft:birch_slab[type=double,waterlogged=false]", "minecraft:birch_slab[type=double,waterlogged=false]",
"minecraft:jungle_slab[type=double,waterlogged=true]",
"minecraft:jungle_slab[type=double,waterlogged=false]", "minecraft:jungle_slab[type=double,waterlogged=false]",
"minecraft:acacia_slab[type=double,waterlogged=true]",
"minecraft:acacia_slab[type=double,waterlogged=false]", "minecraft:acacia_slab[type=double,waterlogged=false]",
"minecraft:dark_oak_slab[type=double,waterlogged=true]",
"minecraft:dark_oak_slab[type=double,waterlogged=false]", "minecraft:dark_oak_slab[type=double,waterlogged=false]",
"minecraft:stone_slab[type=double,waterlogged=true]",
"minecraft:stone_slab[type=double,waterlogged=false]", "minecraft:stone_slab[type=double,waterlogged=false]",
"minecraft:sandstone_slab[type=double,waterlogged=true]",
"minecraft:sandstone_slab[type=double,waterlogged=false]", "minecraft:sandstone_slab[type=double,waterlogged=false]",
"minecraft:petrified_oak_slab[type=double,waterlogged=true]",
"minecraft:petrified_oak_slab[type=double,waterlogged=false]", "minecraft:petrified_oak_slab[type=double,waterlogged=false]",
"minecraft:cobblestone_slab[type=double,waterlogged=true]",
"minecraft:cobblestone_slab[type=double,waterlogged=false]", "minecraft:cobblestone_slab[type=double,waterlogged=false]",
"minecraft:brick_slab[type=double,waterlogged=true]",
"minecraft:brick_slab[type=double,waterlogged=false]", "minecraft:brick_slab[type=double,waterlogged=false]",
"minecraft:stone_brick_slab[type=double,waterlogged=true]",
"minecraft:stone_brick_slab[type=double,waterlogged=false]", "minecraft:stone_brick_slab[type=double,waterlogged=false]",
"minecraft:nether_brick_slab[type=double,waterlogged=true]",
"minecraft:nether_brick_slab[type=double,waterlogged=false]", "minecraft:nether_brick_slab[type=double,waterlogged=false]",
"minecraft:quartz_slab[type=double,waterlogged=true]",
"minecraft:quartz_slab[type=double,waterlogged=false]", "minecraft:quartz_slab[type=double,waterlogged=false]",
"minecraft:red_sandstone_slab[type=double,waterlogged=true]",
"minecraft:red_sandstone_slab[type=double,waterlogged=false]", "minecraft:red_sandstone_slab[type=double,waterlogged=false]",
"minecraft:purpur_slab[type=double,waterlogged=true]",
"minecraft:purpur_slab[type=double,waterlogged=false]", "minecraft:purpur_slab[type=double,waterlogged=false]",
"minecraft:smooth_stone", "minecraft:smooth_stone",
"minecraft:smooth_sandstone", "minecraft:smooth_sandstone",
@ -1113,18 +372,6 @@
"minecraft:green_concrete_powder", "minecraft:green_concrete_powder",
"minecraft:red_concrete_powder", "minecraft:red_concrete_powder",
"minecraft:black_concrete_powder", "minecraft:black_concrete_powder",
"minecraft:dried_kelp_block",
"minecraft:dead_tube_coral_block",
"minecraft:dead_brain_coral_block",
"minecraft:dead_bubble_coral_block",
"minecraft:dead_fire_coral_block",
"minecraft:dead_horn_coral_block",
"minecraft:tube_coral_block",
"minecraft:brain_coral_block",
"minecraft:bubble_coral_block",
"minecraft:fire_coral_block",
"minecraft:horn_coral_block",
"minecraft:blue_ice",
"minecraft:structure_block[mode=save]", "minecraft:structure_block[mode=save]",
"minecraft:structure_block[mode=load]", "minecraft:structure_block[mode=load]",
"minecraft:structure_block[mode=corner]", "minecraft:structure_block[mode=corner]",

Datei anzeigen

@ -448,16 +448,16 @@
"1106": "minecraft:lever[face=wall,facing=west,powered=false]", "1106": "minecraft:lever[face=wall,facing=west,powered=false]",
"1107": "minecraft:lever[face=wall,facing=south,powered=false]", "1107": "minecraft:lever[face=wall,facing=south,powered=false]",
"1108": "minecraft:lever[face=wall,facing=north,powered=false]", "1108": "minecraft:lever[face=wall,facing=north,powered=false]",
"1109": "minecraft:lever[face=floor,facing=west,powered=false]", "1109": "minecraft:lever[face=floor,facing=north,powered=false]",
"1110": "minecraft:lever[face=floor,facing=north,powered=false]", "1110": "minecraft:lever[face=floor,facing=west,powered=false]",
"1111": "minecraft:lever[face=ceiling,facing=north,powered=false]", "1111": "minecraft:lever[face=ceiling,facing=north,powered=false]",
"1112": "minecraft:lever[face=ceiling,facing=west,powered=true]", "1112": "minecraft:lever[face=ceiling,facing=west,powered=true]",
"1113": "minecraft:lever[face=wall,facing=east,powered=true]", "1113": "minecraft:lever[face=wall,facing=east,powered=true]",
"1114": "minecraft:lever[face=wall,facing=west,powered=true]", "1114": "minecraft:lever[face=wall,facing=west,powered=true]",
"1115": "minecraft:lever[face=wall,facing=south,powered=true]", "1115": "minecraft:lever[face=wall,facing=south,powered=true]",
"1116": "minecraft:lever[face=wall,facing=north,powered=true]", "1116": "minecraft:lever[face=wall,facing=north,powered=true]",
"1117": "minecraft:lever[face=floor,facing=east,powered=true]", "1117": "minecraft:lever[face=floor,facing=north,powered=true]",
"1118": "minecraft:lever[face=floor,facing=north,powered=true]", "1118": "minecraft:lever[face=floor,facing=west,powered=true]",
"1119": "minecraft:lever[face=ceiling,facing=north,powered=true]", "1119": "minecraft:lever[face=ceiling,facing=north,powered=true]",
"1120": "minecraft:stone_pressure_plate[powered=false]", "1120": "minecraft:stone_pressure_plate[powered=false]",
"1121": "minecraft:stone_pressure_plate[powered=true]", "1121": "minecraft:stone_pressure_plate[powered=true]",

Datei anzeigen

@ -250,4 +250,9 @@ public class SpongeViaConfig extends Config implements ViaVersionConfig {
public boolean isSnowCollisionFix() { public boolean isSnowCollisionFix() {
return getBoolean("fix-low-snow-collision", false); return getBoolean("fix-low-snow-collision", false);
} }
@Override
public int get1_13TabCompleteDelay() {
return getInt("1_13-tab-complete-delay", 0);
}
} }

Datei anzeigen

@ -5,21 +5,27 @@ import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.player.ServerConnectedEvent; import com.velocitypowered.api.event.player.ServerConnectedEvent;
import com.velocitypowered.api.event.player.ServerPreConnectEvent; import com.velocitypowered.api.event.player.ServerPreConnectEvent;
import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.api.network.ProtocolVersion;
import us.myles.ViaVersion.api.PacketWrapper;
import us.myles.ViaVersion.api.Pair; import us.myles.ViaVersion.api.Pair;
import us.myles.ViaVersion.api.Via; import us.myles.ViaVersion.api.Via;
import us.myles.ViaVersion.api.boss.BossBar;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.Protocol; import us.myles.ViaVersion.api.protocol.Protocol;
import us.myles.ViaVersion.api.protocol.ProtocolPipeline; import us.myles.ViaVersion.api.protocol.ProtocolPipeline;
import us.myles.ViaVersion.api.protocol.ProtocolRegistry; import us.myles.ViaVersion.api.protocol.ProtocolRegistry;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.protocols.base.ProtocolInfo; import us.myles.ViaVersion.protocols.base.ProtocolInfo;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.storage.EntityTracker; import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.packets.InventoryPackets;
import us.myles.ViaVersion.protocols.protocol1_9to1_8.Protocol1_9TO1_8;
import us.myles.ViaVersion.util.ReflectionUtil;
import us.myles.ViaVersion.velocity.service.ProtocolDetectorService; import us.myles.ViaVersion.velocity.service.ProtocolDetectorService;
import us.myles.ViaVersion.velocity.storage.VelocityStorage; import us.myles.ViaVersion.velocity.storage.VelocityStorage;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Semaphore; import java.util.concurrent.Semaphore;
public class VelocityServerHandler { public class VelocityServerHandler {
@ -27,6 +33,7 @@ public class VelocityServerHandler {
private static Method setNextProtocolVersion; private static Method setNextProtocolVersion;
private static Method getMinecraftConnection; private static Method getMinecraftConnection;
private static Method getNextProtocolVersion; private static Method getNextProtocolVersion;
private static Method getKnownChannels;
static { static {
try { try {
@ -38,6 +45,8 @@ public class VelocityServerHandler {
.getDeclaredMethod("getMinecraftConnection"); .getDeclaredMethod("getMinecraftConnection");
getNextProtocolVersion = Class.forName("com.velocitypowered.proxy.connection.MinecraftConnection") getNextProtocolVersion = Class.forName("com.velocitypowered.proxy.connection.MinecraftConnection")
.getDeclaredMethod("getNextProtocolVersion"); .getDeclaredMethod("getNextProtocolVersion");
getKnownChannels = Class.forName("com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler")
.getDeclaredMethod("getKnownChannels");
} catch (NoSuchMethodException | ClassNotFoundException e) { } catch (NoSuchMethodException | ClassNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -78,14 +87,6 @@ public class VelocityServerHandler {
public void checkServerChange(ServerConnectedEvent e, UserConnection user) throws Exception { public void checkServerChange(ServerConnectedEvent e, UserConnection user) throws Exception {
if (user == null) return; if (user == null) return;
// Manually hide ViaVersion-created BossBars if the childserver was version 1.8.x (#666)
if (user.has(EntityTracker.class)) {
EntityTracker tracker = user.get(EntityTracker.class);
if (tracker.getBossBarMap() != null)
for (BossBar bar : tracker.getBossBarMap().values())
bar.hide();
}
// Handle server/version change // Handle server/version change
if (user.has(VelocityStorage.class)) { if (user.has(VelocityStorage.class)) {
// Wait all the scheduled packets be sent // Wait all the scheduled packets be sent
@ -99,6 +100,8 @@ public class VelocityServerHandler {
VelocityStorage storage = user.get(VelocityStorage.class); VelocityStorage storage = user.get(VelocityStorage.class);
if (storage.getBossbar() == null) storage.saveServerBossBars();
if (e.getServer() != null) { if (e.getServer() != null) {
if (!e.getServer().getServerInfo().getName().equals(storage.getCurrentServer())) { if (!e.getServer().getServerInfo().getName().equals(storage.getCurrentServer())) {
String serverName = e.getServer().getServerInfo().getName(); String serverName = e.getServer().getServerInfo().getName();
@ -107,7 +110,20 @@ public class VelocityServerHandler {
int protocolId = ProtocolDetectorService.getProtocolId(serverName); int protocolId = ProtocolDetectorService.getProtocolId(serverName);
if (protocolId <= ProtocolVersion.MINECRAFT_1_8.getProtocol()) { // 1.8 doesn't have BossBar packet
if (storage.getBossbar() != null) {
for (UUID uuid : storage.getBossbar()) {
PacketWrapper wrapper = new PacketWrapper(0x0C, null, user);
wrapper.write(Type.UUID, uuid);
wrapper.write(Type.VAR_INT, 1); // remove
wrapper.send(Protocol1_9TO1_8.class, true, true);
}
storage.getBossbar().clear();
}
}
ProtocolInfo info = user.get(ProtocolInfo.class); ProtocolInfo info = user.get(ProtocolInfo.class);
int previousServerProtocol = info.getServerProtocolVersion();
// Refresh the pipes // Refresh the pipes
List<Pair<Integer, Protocol>> protocols = ProtocolRegistry.getProtocolPath(info.getProtocolVersion(), protocolId); List<Pair<Integer, Protocol>> protocols = ProtocolRegistry.getProtocolPath(info.getProtocolVersion(), protocolId);
@ -127,6 +143,33 @@ public class VelocityServerHandler {
// Add version-specific base Protocol // Add version-specific base Protocol
pipeline.add(ProtocolRegistry.getBaseProtocol(protocolId)); pipeline.add(ProtocolRegistry.getBaseProtocol(protocolId));
// Workaround 1.13 server change
Set<String> knownChannels = (Set<String>) getKnownChannels.invoke(
ReflectionUtil.invoke(
getMinecraftConnection.invoke(e.getPlayer()),
"getSessionHandler"
)
);
if (previousServerProtocol != -1) {
int id1_13 = ProtocolVersion.MINECRAFT_1_13.getProtocol();
if (previousServerProtocol < id1_13 && protocolId >= id1_13) {
ArrayList<String> newChannels = new ArrayList<>();
for (String oldChannel : knownChannels) {
newChannels.add(InventoryPackets.getNewPluginChannelId(oldChannel));
}
knownChannels.clear();
knownChannels.addAll(newChannels);
} else if (previousServerProtocol >= id1_13 && protocolId < id1_13) {
ArrayList<String> newChannels = new ArrayList<>();
for (String oldChannel : knownChannels) {
newChannels.add(InventoryPackets.getOldPluginChannelId(oldChannel));
}
knownChannels.clear();
knownChannels.addAll(newChannels);
}
}
user.put(info); user.put(info);
user.put(storage); user.put(storage);

Datei anzeigen

@ -302,4 +302,9 @@ public class VelocityViaConfig extends Config implements ViaVersionConfig {
public boolean isSnowCollisionFix() { public boolean isSnowCollisionFix() {
return getBoolean("fix-low-snow-collision", false); return getBoolean("fix-low-snow-collision", false);
} }
@Override
public int get1_13TabCompleteDelay() {
return getInt("1_13-tab-complete-delay", 0);
}
} }

Datei anzeigen

@ -5,8 +5,10 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import us.myles.ViaVersion.api.data.StoredObject; import us.myles.ViaVersion.api.data.StoredObject;
import us.myles.ViaVersion.api.data.UserConnection; import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.util.ReflectionUtil;
import java.util.Set; import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.UUID; import java.util.UUID;
@Data @Data
@ -14,24 +16,24 @@ import java.util.UUID;
public class VelocityStorage extends StoredObject { public class VelocityStorage extends StoredObject {
private Player player; private Player player;
private String currentServer; private String currentServer;
private Set<UUID> bossbar; private List<UUID> bossbar;
public VelocityStorage(UserConnection user, Player player) { public VelocityStorage(UserConnection user, Player player) {
super(user); super(user);
this.player = player; this.player = player;
this.currentServer = ""; this.currentServer = "";
}
public void saveServerBossBars() {
// Get bossbar list if it's supported // Get bossbar list if it's supported
/* TODO make this work - do we need this?
try { try {
Object connection = ReflectionUtil.invoke(player, "getConnection"); Object connection = ReflectionUtil.invoke(player, "getMinecraftConnection");
Object sessionHandler = ReflectionUtil.invoke(connection, "getSessionHandler"); Object sessionHandler = ReflectionUtil.invoke(connection, "getSessionHandler");
if (sessionHandler.getClass().getSimpleName().contains("Play")) { if (sessionHandler.getClass().getSimpleName().contains("Play")) {
bossbar = (Set<UUID>) ReflectionUtil.invoke(sessionHandler, "getServerBossBars"); bossbar = (List<UUID>) ReflectionUtil.invoke(sessionHandler, "getServerBossBars");
} }
} catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} }
*/
} }
} }