Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 17:10:13 +01:00
Block entity tags are no longer nullable
Dieser Commit ist enthalten in:
Ursprung
c4e50efa90
Commit
27af372f79
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.rewriter;
|
package com.viaversion.viaversion.protocols.protocol1_20_5to1_20_3.rewriter;
|
||||||
|
|
||||||
|
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
|
||||||
import com.viaversion.viaversion.api.data.ParticleMappings;
|
import com.viaversion.viaversion.api.data.ParticleMappings;
|
||||||
import com.viaversion.viaversion.api.minecraft.Particle;
|
import com.viaversion.viaversion.api.minecraft.Particle;
|
||||||
import com.viaversion.viaversion.api.minecraft.item.Item;
|
import com.viaversion.viaversion.api.minecraft.item.Item;
|
||||||
@ -45,7 +46,14 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
|
|||||||
blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_3.MULTI_BLOCK_CHANGE);
|
blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_3.MULTI_BLOCK_CHANGE);
|
||||||
blockRewriter.registerEffect(ClientboundPackets1_20_3.EFFECT, 1010, 2001);
|
blockRewriter.registerEffect(ClientboundPackets1_20_3.EFFECT, 1010, 2001);
|
||||||
blockRewriter.registerChunkData1_19(ClientboundPackets1_20_3.CHUNK_DATA, ChunkType1_20_2::new);
|
blockRewriter.registerChunkData1_19(ClientboundPackets1_20_3.CHUNK_DATA, ChunkType1_20_2::new);
|
||||||
blockRewriter.registerBlockEntityData(ClientboundPackets1_20_3.BLOCK_ENTITY_DATA);
|
protocol.registerClientbound(ClientboundPackets1_20_3.BLOCK_ENTITY_DATA, wrapper -> {
|
||||||
|
wrapper.passthrough(Type.POSITION1_14); // Position
|
||||||
|
wrapper.passthrough(Type.VAR_INT); // Block entity type
|
||||||
|
|
||||||
|
// No longern nullable
|
||||||
|
final CompoundTag tag = wrapper.read(Type.COMPOUND_TAG);
|
||||||
|
wrapper.write(Type.COMPOUND_TAG, tag != null ? tag : new CompoundTag());
|
||||||
|
});
|
||||||
|
|
||||||
registerSetCooldown(ClientboundPackets1_20_3.COOLDOWN);
|
registerSetCooldown(ClientboundPackets1_20_3.COOLDOWN);
|
||||||
registerWindowItems1_17_1(ClientboundPackets1_20_3.WINDOW_ITEMS);
|
registerWindowItems1_17_1(ClientboundPackets1_20_3.WINDOW_ITEMS);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren