Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-24 23:30:17 +01:00
Update VV usage
Dieser Commit ist enthalten in:
Ursprung
3a67be7fe5
Commit
82a7c9bc3d
@ -71,7 +71,7 @@ import java.util.logging.Logger;
|
||||
|
||||
public interface ViaBackwardsPlatform {
|
||||
|
||||
String MINIMUM_VV_VERSION = "5.1.1";
|
||||
String MINIMUM_VV_VERSION = "5.1.2";
|
||||
|
||||
/**
|
||||
* Initialize ViaBackwards.
|
||||
|
@ -240,7 +240,7 @@ public abstract class EntityRewriterBase<C extends ClientboundPacketType, T exte
|
||||
}
|
||||
|
||||
protected PacketHandler getTrackerHandler(EntityType entityType) {
|
||||
return wrapper -> tracker(wrapper.user()).addEntity((int) wrapper.get(Types.VAR_INT, 0), entityType);
|
||||
return wrapper -> tracker(wrapper.user()).addEntity(wrapper.get(Types.VAR_INT, 0), entityType);
|
||||
}
|
||||
|
||||
protected PacketHandler getPlayerTrackerHandler() {
|
||||
|
@ -469,7 +469,7 @@ public class PlayerPacketRewriter1_13 extends RewriterBase<Protocol1_13To1_12_2>
|
||||
wrapper.write(Types.STRING, newChannel);
|
||||
|
||||
if (newChannel.equals("minecraft:register") || newChannel.equals("minecraft:unregister")) {
|
||||
String[] channels = new String(wrapper.read(Types.REMAINING_BYTES), StandardCharsets.UTF_8).split("\0");
|
||||
String[] channels = new String(wrapper.read(Types.SERVERBOUND_CUSTOM_PAYLOAD_DATA), StandardCharsets.UTF_8).split("\0");
|
||||
List<String> rewrittenChannels = new ArrayList<>();
|
||||
for (String s : channels) {
|
||||
String rewritten = ItemPacketRewriter1_13.getNewPluginChannelId(s);
|
||||
@ -480,7 +480,7 @@ public class PlayerPacketRewriter1_13 extends RewriterBase<Protocol1_13To1_12_2>
|
||||
}
|
||||
}
|
||||
if (!rewrittenChannels.isEmpty()) {
|
||||
wrapper.write(Types.REMAINING_BYTES, Joiner.on('\0').join(rewrittenChannels).getBytes(StandardCharsets.UTF_8));
|
||||
wrapper.write(Types.SERVERBOUND_CUSTOM_PAYLOAD_DATA, Joiner.on('\0').join(rewrittenChannels).getBytes(StandardCharsets.UTF_8));
|
||||
} else {
|
||||
wrapper.cancel();
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ import com.viaversion.viaversion.protocols.v1_21to1_21_2.packet.ClientboundPacke
|
||||
import com.viaversion.viaversion.rewriter.BlockRewriter;
|
||||
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
||||
import com.viaversion.viaversion.util.Key;
|
||||
import com.viaversion.viaversion.util.Limit;
|
||||
|
||||
import static com.viaversion.viaversion.protocols.v1_21to1_21_2.rewriter.BlockItemPacketRewriter1_21_2.downgradeItemData;
|
||||
import static com.viaversion.viaversion.protocols.v1_21to1_21_2.rewriter.BlockItemPacketRewriter1_21_2.updateItemData;
|
||||
@ -143,7 +144,7 @@ public final class BlockItemPacketRewriter1_21_2 extends BackwardsStructuredItem
|
||||
wrapper.passthrough(Types.SHORT); // Slot
|
||||
wrapper.passthrough(Types.BYTE); // Button
|
||||
wrapper.passthrough(Types.VAR_INT); // Mode
|
||||
final int length = wrapper.passthrough(Types.VAR_INT);
|
||||
final int length = Limit.max(wrapper.passthrough(Types.VAR_INT), 128);
|
||||
for (int i = 0; i < length; i++) {
|
||||
wrapper.passthrough(Types.SHORT); // Slot
|
||||
passthroughServerboundItem(wrapper);
|
||||
|
@ -3,7 +3,7 @@ metadata.format.version = "1.1"
|
||||
[versions]
|
||||
|
||||
# ViaVersion
|
||||
viaver = "5.1.1"
|
||||
viaver = "5.1.2-SNAPSHOT"
|
||||
|
||||
# Common provided
|
||||
netty = "4.0.20.Final"
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren