mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
big changes
This commit is contained in:
parent
e06a90c6e2
commit
835a44b12f
2 changed files with 30 additions and 32 deletions
|
|
@ -1,32 +0,0 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
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.entity.Entity;
|
||||
import org.geysermc.connector.network.session.GeyserSession;
|
||||
import org.geysermc.connector.console.GeyserLogger;
|
||||
|
||||
public class ItemEntity extends Entity {
|
||||
|
||||
public ItemEntity(int amount, long entityId, long geyserId, EntityType entityType, Vector3f position, Vector3f motion, Vector3f rotation) {
|
||||
super(entityId, geyserId, EntityType.ITEM, position, motion, rotation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnEntity(GeyserSession session) {
|
||||
AddItemEntityPacket AddItemEntity = new AddItemEntityPacket();
|
||||
AddItemEntity.setPosition(position);
|
||||
AddItemEntity.setRuntimeEntityId(geyserId);
|
||||
AddItemEntity.setUniqueEntityId(geyserId);
|
||||
AddItemEntity.setMotion(motion);
|
||||
session.getUpstream().sendPacket(AddItemEntity);
|
||||
|
||||
valid = true;
|
||||
|
||||
GeyserLogger.DEFAULT.debug("a item droped on " + position);
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue