Added some extra stuff to the XP update.

This commit is contained in:
Brianna 2021-05-27 14:36:34 -05:00
parent 5a25fa384f
commit 0c62b24a71

View File

@ -111,9 +111,14 @@ public class EntityStack extends ColdEntityStack {
preStackedDrops.addAll(drops);
}
Location killedLocation = killed.getLocation();
if (droppedExp > 0)
killedLocation.getWorld().spawn(killedLocation, ExperienceOrb.class).setExperience(droppedExp * getAmount());
// In versions 1.14 and below experience is not dropping. Because of this we are doing this ourselves.
if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_14)) {
Location killedLocation = killed.getLocation();
if (droppedExp > 0)
killedLocation.getWorld().spawn(killedLocation, ExperienceOrb.class).setExperience(droppedExp * getAmount());
} else {
event.setDroppedExp(droppedExp * getAmount());
}
DropUtils.processStackedDrop(killed, preStackedDrops, event);
@ -127,9 +132,6 @@ public class EntityStack extends ColdEntityStack {
killed.remove();
LivingEntity newEntity = takeOneAndSpawnEntity(killed.getLocation());
//if (!EntityUtils.isAware(killed))
// EntityUtils.setUnaware(newEntity);
// In versions 1.14 and below experience is not dropping. Because of this we are doing this ourselves.
if (ServerVersion.isServerVersionAtOrBelow(ServerVersion.V1_14)) {
Location killedLocation = killed.getLocation();