ArrowDataListener now sends the whole ItemStack
This commit is contained in:
@@ -130,7 +130,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
private final MetadataValueFactory metadataValueFactory;
|
||||
|
||||
/**
|
||||
* The internal factory to produce {@link com.willfp.eco.core.scheduling.EcoBukkitRunnable}s.
|
||||
* The internal factory to produce {@link com.willfp.eco.core.scheduling.RunnableTask}s.
|
||||
*/
|
||||
@Getter
|
||||
private final RunnableFactory runnableFactory;
|
||||
@@ -402,5 +402,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
* @return The display module, or null.
|
||||
*/
|
||||
@Nullable
|
||||
protected abstract DisplayModule createDisplayModule();
|
||||
protected DisplayModule createDisplayModule() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.willfp.eco.internal.arrows;
|
||||
|
||||
import com.willfp.eco.core.PluginDependent;
|
||||
import com.willfp.eco.core.EcoPlugin;
|
||||
import com.willfp.eco.core.PluginDependent;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -14,8 +13,6 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ArrowDataListener extends PluginDependent implements Listener {
|
||||
/**
|
||||
* Listener to add metadata to arrows about the enchantments on the bow that shot them.
|
||||
@@ -54,7 +51,6 @@ public class ArrowDataListener extends PluginDependent implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
Map<Enchantment, Integer> enchantments = item.getItemMeta().getEnchants();
|
||||
arrow.setMetadata("enchantments", this.getPlugin().getMetadataValueFactory().create(enchantments));
|
||||
arrow.setMetadata("shot-from", this.getPlugin().getMetadataValueFactory().create(item));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user