// TODO: This will only work for tall mobs/players and single block mobs
// is this a different position than previously
if (!oldPosition.equals(newPosition)) {
// get the old position's blocks
Block[] oldBlocks = new Block[(int) Math.ceil(characterHeight)];
Vector3i currentPosition = oldPosition.clone();
for (int currentHeight = 0; currentHeight < oldBlocks.length; currentHeight++) {
oldBlocks[currentHeight] = worldProvider.getBlock(currentPosition);
currentPosition.add(0, 1, 0);
}
// get the new position's blocks
Block[] newBlocks = new Block[(int) Math.ceil(characterHeight)];
currentPosition = newPosition.clone();
for (int currentHeight = 0; currentHeight < characterHeight; currentHeight++) {
newBlocks[currentHeight] = worldProvider.getBlock(currentPosition);
currentPosition.add(0, 1, 0);
}
for (int i = 0; i < characterHeight; i++) {
// send a block enter/leave event for this character
entity.send(new OnEnterBlockEvent(oldBlocks[i], newBlocks[i], new Vector3i(0, i, 0)));
}
}
}