mirror of
https://github.com/songoda/UltimateStacker.git
synced 2024-11-23 10:35:22 +01:00
Added support for mcMMO metadata.
This commit is contained in:
parent
3f4f83aa2e
commit
4a6395260f
@ -14,6 +14,7 @@ import org.bukkit.entity.ExperienceOrb;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Deque;
|
||||
@ -138,9 +139,21 @@ public class EntityStack {
|
||||
if (killed.getType() == EntityType.PIG_ZOMBIE)
|
||||
newEntity.getEquipment().setItemInHand(new ItemStack(instance.isServerVersionAtLeast(ServerVersion.V1_13) ? Material.GOLDEN_SWORD : Material.valueOf("GOLD_SWORD")));
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("EpicSpawners"))
|
||||
if (Setting.CARRY_OVER_METADATA_ON_DEATH.getBoolean()) {
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("EpicSpawners"))
|
||||
if (killed.hasMetadata("ES"))
|
||||
newEntity.setMetadata("ES", killed.getMetadata("ES").get(0));
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("mcMMO")) {
|
||||
String entityMetadataKey = "mcMMO: Spawned Entity";
|
||||
if (killed.hasMetadata(entityMetadataKey))
|
||||
newEntity.setMetadata(entityMetadataKey, new FixedMetadataValue(UltimateStacker.getInstance(), true));
|
||||
|
||||
}
|
||||
|
||||
if (killed.hasMetadata("ES"))
|
||||
newEntity.setMetadata("ES", killed.getMetadata("ES").get(0));
|
||||
}
|
||||
|
||||
EntityStack entityStack = stackManager.updateStack(killed, newEntity);
|
||||
|
||||
|
@ -99,6 +99,10 @@ public enum Setting {
|
||||
"if the entity originated from a spawner or not is wiped on",
|
||||
"server restart."),
|
||||
|
||||
CARRY_OVER_METADATA_ON_DEATH("Entities.Carry Over Metadata On Death", true,
|
||||
"With this enabled any metadata assigned from supported plugins such",
|
||||
"as EpicSpawners and mcMMO will be preserved when the entity is killed."),
|
||||
|
||||
ONLY_STACK_ON_SURFACE("Entities.Only Stack On Surface", true,
|
||||
"Should entities only be stacked if they are touching the ground",
|
||||
"or swimming? This does not effect flying entities."),
|
||||
@ -251,4 +255,5 @@ public enum Setting {
|
||||
public double getDouble() {
|
||||
return UltimateStacker.getInstance().getConfig().getDouble(setting);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user