mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix item frames on 1.17.30
This commit is contained in:
parent
e0ae4c1b85
commit
d5c37e927b
1 changed files with 8 additions and 3 deletions
|
@ -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());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue