mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 01:55:47 +01:00
1.20.5-pre1
This commit is contained in:
parent
99f29e2597
commit
ba4404fad6
@ -83,7 +83,7 @@ public class ProtocolVersion implements Comparable<ProtocolVersion> {
|
||||
public static final ProtocolVersion v1_20 = register(763, "1.20/1.20.1", new SubVersionRange("1.20", 0, 1));
|
||||
public static final ProtocolVersion v1_20_2 = register(764, "1.20.2");
|
||||
public static final ProtocolVersion v1_20_3 = register(765, "1.20.3/1.20.4", new SubVersionRange("1.20", 3, 4));
|
||||
public static final ProtocolVersion v1_20_5 = register(766, 184, "1.20.5");
|
||||
public static final ProtocolVersion v1_20_5 = register(766, 185, "1.20.5");
|
||||
public static final ProtocolVersion unknown = new ProtocolVersion(VersionType.SPECIAL, -1, -1, "UNKNOWN", null);
|
||||
|
||||
public static ProtocolVersion register(int version, String name) {
|
||||
|
@ -151,7 +151,13 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
|
||||
registerSetSlot1_17_1(ClientboundPackets1_20_3.SET_SLOT);
|
||||
registerEntityEquipmentArray(ClientboundPackets1_20_3.ENTITY_EQUIPMENT);
|
||||
registerClickWindow1_17_1(ServerboundPackets1_20_5.CLICK_WINDOW);
|
||||
registerCreativeInvAction(ServerboundPackets1_20_5.CREATIVE_INVENTORY_ACTION);
|
||||
protocol.registerServerbound(ServerboundPackets1_20_5.CREATIVE_INVENTORY_ACTION, wrapper -> {
|
||||
final int slot = wrapper.read(Type.UNSIGNED_SHORT);
|
||||
wrapper.write(Type.SHORT, (short) Math.min(slot, Short.MAX_VALUE));
|
||||
|
||||
final Item item = handleItemToServer(wrapper.read(Types1_20_5.ITEM));
|
||||
wrapper.write(Type.ITEM1_20_2, item);
|
||||
});
|
||||
registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_3.WINDOW_PROPERTY);
|
||||
|
||||
protocol.registerClientbound(ClientboundPackets1_20_3.ADVANCEMENTS, wrapper -> {
|
||||
@ -1049,11 +1055,6 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
|
||||
|
||||
final Tag parsedPage = ComponentUtil.jsonStringToTag(page.getValue());
|
||||
pages.add(new FilterableComponent(parsedPage, filtered));
|
||||
|
||||
if (pages.size() == 100) {
|
||||
// Network limit
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
final String title = tag.getString("title", "");
|
||||
@ -1064,7 +1065,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
|
||||
final WrittenBook writtenBook = new WrittenBook(
|
||||
new FilterableString(limit(title, 32), limit(filteredTitle, 32)),
|
||||
author,
|
||||
generation,
|
||||
clamp(generation, 0, 3),
|
||||
pages.toArray(new FilterableComponent[0]),
|
||||
resolved
|
||||
);
|
||||
|
@ -32,7 +32,6 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_20_3;
|
||||
import com.viaversion.viaversion.api.type.types.version.Types1_20_5;
|
||||
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.storage.ReceivedMessagesStorage;
|
||||
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundConfigurationPackets1_20_3;
|
||||
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPacket1_20_3;
|
||||
import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3;
|
||||
@ -40,6 +39,7 @@ import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.Protocol1_20_5
|
||||
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.data.Attributes1_20_5;
|
||||
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.data.BannerPatterns1_20_5;
|
||||
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.packet.ClientboundConfigurationPackets1_20_5;
|
||||
import com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.storage.AcknowledgedMessagesStorage;
|
||||
import com.viaversion.viaversion.rewriter.EntityRewriter;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
@ -169,7 +169,7 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
|
||||
final DimensionData data = tracker(wrapper.user()).dimensionData(dimensionKey);
|
||||
wrapper.write(Type.VAR_INT, data.id());
|
||||
|
||||
wrapper.user().get(ReceivedMessagesStorage.class).clear();
|
||||
wrapper.user().get(AcknowledgedMessagesStorage.class).clear();
|
||||
});
|
||||
map(Type.STRING); // World
|
||||
map(Type.LONG); // Seed
|
||||
|
@ -111,4 +111,11 @@ public final class AcknowledgedMessagesStorage implements StorableObject {
|
||||
return profileKey;
|
||||
}
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.offset = 0;
|
||||
this.tail = 0;
|
||||
this.lastMessage = null;
|
||||
Arrays.fill(this.trackedMessages, false);
|
||||
}
|
||||
}
|
||||
|
@ -186,6 +186,16 @@ public class ItemRewriter<C extends ClientboundPacketType, S extends Serverbound
|
||||
});
|
||||
}
|
||||
|
||||
public void registerCreativeInvAction1_20_5(S packetType) {
|
||||
protocol.registerServerbound(packetType, new PacketHandlers() {
|
||||
@Override
|
||||
public void register() {
|
||||
map(Type.UNSIGNED_SHORT); // Slot
|
||||
handler(wrapper -> handleServerboundItem(wrapper));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void registerClickWindow(S packetType) {
|
||||
protocol.registerServerbound(packetType, new PacketHandlers() {
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Project properties - we put these here so they can be modified without causing a recompile of the build scripts
|
||||
projectVersion=4.10.0-24w14a-SNAPSHOT
|
||||
projectVersion=4.10.0-1.20.5-pre1-SNAPSHOT
|
||||
|
||||
# Smile emoji
|
||||
mcVersions=1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9, 1.8.9
|
||||
|
@ -60,7 +60,7 @@ public final class BlockItemPacketRewriter1_99 extends StructuredItemRewriter<Cl
|
||||
registerEntityEquipmentArray(ClientboundPackets1_20_5.ENTITY_EQUIPMENT);
|
||||
registerClickWindow1_17_1(ServerboundPackets1_20_5.CLICK_WINDOW);
|
||||
registerTradeList1_20_5(ClientboundPackets1_20_5.TRADE_LIST, Types1_20_5.ITEM_COST, Types1_20_5.ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST);
|
||||
registerCreativeInvAction(ServerboundPackets1_20_5.CREATIVE_INVENTORY_ACTION);
|
||||
registerCreativeInvAction1_20_5(ServerboundPackets1_20_5.CREATIVE_INVENTORY_ACTION);
|
||||
registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_5.WINDOW_PROPERTY);
|
||||
registerSpawnParticle1_20_5(ClientboundPackets1_20_5.SPAWN_PARTICLE, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE);
|
||||
registerExplosion(ClientboundPackets1_20_5.EXPLOSION, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE); // Rewrites the included sound and particles
|
||||
|
Loading…
Reference in New Issue
Block a user