mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-09-27 14:12:59 +02:00
Fixed an issue causing EXP not to drop for certain entities in 1.14-
This commit is contained in:
parent
786772f743
commit
651afb3844
@ -1,5 +1,6 @@
|
||||
package com.songoda.ultimatestacker.stackable.entity;
|
||||
|
||||
import com.songoda.core.compatibility.ServerVersion;
|
||||
import com.songoda.lootables.loot.Drop;
|
||||
import com.songoda.lootables.loot.DropUtils;
|
||||
import com.songoda.ultimatestacker.UltimateStacker;
|
||||
@ -120,7 +121,7 @@ public class EntityStack extends ColdEntityStack {
|
||||
plugin.addExp(killed.getKiller(), this);
|
||||
}
|
||||
|
||||
private void handleSingleStackDeath(LivingEntity killed, List<Drop> drops, EntityDeathEvent event) {
|
||||
private void handleSingleStackDeath(LivingEntity killed, List<Drop> drops, int droppedExp, EntityDeathEvent event) {
|
||||
EntityStackManager stackManager = plugin.getEntityStackManager();
|
||||
|
||||
killed.remove();
|
||||
@ -129,6 +130,13 @@ public class EntityStack extends ColdEntityStack {
|
||||
//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();
|
||||
if (droppedExp > 0)
|
||||
killedLocation.getWorld().spawn(killedLocation, ExperienceOrb.class).setExperience(droppedExp);
|
||||
}
|
||||
|
||||
DropUtils.processStackedDrop(killed, drops, event);
|
||||
|
||||
newEntity.setVelocity(killed.getVelocity());
|
||||
@ -161,7 +169,7 @@ public class EntityStack extends ColdEntityStack {
|
||||
return;
|
||||
}
|
||||
}
|
||||
handleSingleStackDeath(killed, drops, event);
|
||||
handleSingleStackDeath(killed, drops, droppedExp, event);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user