Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 06:50:09 +01:00
Fix item frames on 1.17.30
Dieser Commit ist enthalten in:
Ursprung
e0ae4c1b85
Commit
d5c37e927b
@ -35,6 +35,7 @@ import com.nukkitx.nbt.NbtMapBuilder;
|
|||||||
import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
|
import com.nukkitx.protocol.bedrock.data.inventory.ItemData;
|
||||||
import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket;
|
import com.nukkitx.protocol.bedrock.packet.BlockEntityDataPacket;
|
||||||
import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket;
|
import com.nukkitx.protocol.bedrock.packet.UpdateBlockPacket;
|
||||||
|
import com.nukkitx.protocol.bedrock.v448.Bedrock_v465;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.geysermc.connector.entity.type.EntityType;
|
import org.geysermc.connector.entity.type.EntityType;
|
||||||
import org.geysermc.connector.network.session.GeyserSession;
|
import org.geysermc.connector.network.session.GeyserSession;
|
||||||
@ -85,10 +86,14 @@ public class ItemFrameEntity extends Entity {
|
|||||||
NbtMapBuilder blockBuilder = NbtMap.builder()
|
NbtMapBuilder blockBuilder = NbtMap.builder()
|
||||||
.putString("name", this.entityType == EntityType.GLOW_ITEM_FRAME ? "minecraft:glow_frame" : "minecraft:frame")
|
.putString("name", this.entityType == EntityType.GLOW_ITEM_FRAME ? "minecraft:glow_frame" : "minecraft:frame")
|
||||||
.putInt("version", session.getBlockMappings().getBlockStateVersion());
|
.putInt("version", session.getBlockMappings().getBlockStateVersion());
|
||||||
blockBuilder.put("states", NbtMap.builder()
|
NbtMapBuilder statesBuilder = NbtMap.builder()
|
||||||
.putInt("facing_direction", direction.ordinal())
|
.putInt("facing_direction", direction.ordinal())
|
||||||
.putByte("item_frame_map_bit", (byte) 0)
|
.putByte("item_frame_map_bit", (byte) 0);
|
||||||
.build());
|
if (session.getUpstream().getProtocolVersion() >= Bedrock_v465.V465_CODEC.getProtocolVersion()) {
|
||||||
|
statesBuilder.putByte("item_frame_photo_bit", (byte) 0);
|
||||||
|
}
|
||||||
|
blockBuilder.put("states", statesBuilder.build());
|
||||||
|
|
||||||
bedrockRuntimeId = session.getBlockMappings().getItemFrame(blockBuilder.build());
|
bedrockRuntimeId = session.getBlockMappings().getItemFrame(blockBuilder.build());
|
||||||
bedrockPosition = Vector3i.from(position.getFloorX(), position.getFloorY(), position.getFloorZ());
|
bedrockPosition = Vector3i.from(position.getFloorX(), position.getFloorY(), position.getFloorZ());
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren