mirror of
https://github.com/songoda/UltimateStacker.git
synced 2025-01-19 05:51:23 +01:00
Added support for a shop plugin.
This commit is contained in:
parent
544cf08309
commit
1c6703fcc3
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "UltimateStacker"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "1.6.5"
|
||||
version: "1.6.6"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -4,6 +4,7 @@ import com.songoda.ultimatestacker.UltimateStacker;
|
||||
import com.songoda.ultimatestacker.utils.Methods;
|
||||
import com.songoda.ultimatestacker.utils.ServerVersion;
|
||||
import com.songoda.ultimatestacker.utils.settings.Setting;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@ -62,9 +63,16 @@ public class ItemListeners implements Listener {
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onDispense(ItemSpawnEvent event) {
|
||||
public void onExist(ItemSpawnEvent event) {
|
||||
if (!Setting.STACK_ITEMS.getBoolean()) return;
|
||||
|
||||
ItemStack itemStack = event.getEntity().getItemStack();
|
||||
|
||||
if (itemStack.hasItemMeta() && itemStack.getItemMeta().hasDisplayName() &&
|
||||
StringUtils.substring(itemStack.getItemMeta().getDisplayName(), 0, 3).equals("***")) {
|
||||
return; //Compatibility with Shop instance: https://www.spigotmc.org/resources/shop-a-simple-intuitive-shop-instance.9628/
|
||||
}
|
||||
|
||||
Methods.updateItemAmount(event.getEntity(), event.getEntity().getItemStack().getAmount());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user