mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
[Wip] add item entity
This commit is contained in:
parent
7ce4b22693
commit
e06a90c6e2
1 changed files with 32 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
package org.geysermc.connector.entity;
|
||||
|
||||
import com.nukkitx.math.vector.Vector3f;
|
||||
import com.nukkitx.protocol.bedrock.packet.AddItemEntityPacket;
|
||||
import org.geysermc.connector.entity.type.EntityType;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
|
||||
|
||||
public class Item extends Entity {
|
||||
|
||||
|
||||
public Item(int amount, long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation) {
|
||||
super(entityId, geyserId, entityType, position, motion, rotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnEntity(GeyserSession session) {
|
||||
AddItemEntityPacket AddItemEntity = new AddItemEntityPacket();
|
||||
AddItemEntity.setPosition(position);
|
||||
AddItemEntity.setRuntimeEntityId(entityId);
|
||||
AddItemEntity.setUniqueEntityId(entityId);
|
||||
AddItemEntity.setMotion(motion);
|
||||
|
||||
//todo work on those underneed
|
||||
|
||||
//AddItemEntity.setfromFishing();
|
||||
//AddItemEntity.setItemData();
|
||||
//AddItemEntity.setmetadata();
|
||||
|
||||
session.getUpstream().sendPacket(AddItemEntity);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue