big changes

This commit is contained in:
LegacyGamerHD 2019-11-09 18:34:38 +01:00 committed by GitHub
parent e06a90c6e2
commit 835a44b12f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 32 deletions

View file

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

View file

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