add way to summon a item on drop

This commit is contained in:
LegacyGamerHD 2019-11-10 10:50:19 +01:00 committed by GitHub
parent 835a44b12f
commit 16f9886873
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,9 @@ public class BedrockActionTranslator extends PacketTranslator<PlayerActionPacket
case DROP_ITEM: case DROP_ITEM:
ClientPlayerActionPacket dropItemPacket = new ClientPlayerActionPacket(PlayerAction.DROP_ITEM, position, BlockFace.values()[packet.getFace()]); ClientPlayerActionPacket dropItemPacket = new ClientPlayerActionPacket(PlayerAction.DROP_ITEM, position, BlockFace.values()[packet.getFace()]);
session.getDownstream().getSession().send(dropItemPacket); session.getDownstream().getSession().send(dropItemPacket);
ItemEntity itemEntity = new ItemEntity(packet.getRuntimeEntityId(), packet.getRuntimeEntityId(), packet.getBlockPosition().toFloat());
session.getEntityCache().spawnEntity(itemEntity);
break; break;
case STOP_SLEEP: case STOP_SLEEP:
ClientPlayerStatePacket stopSleepingPacket = new ClientPlayerStatePacket((int) entity.getEntityId(), PlayerState.LEAVE_BED); ClientPlayerStatePacket stopSleepingPacket = new ClientPlayerStatePacket((int) entity.getEntityId(), PlayerState.LEAVE_BED);