[Wip] add item entity

This commit is contained in:
LegacyGamerHD 2019-11-09 17:52:42 +01:00 committed by GitHub
parent 7ce4b22693
commit e06a90c6e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}
}