2019-01-17 19:50:47 +01:00
|
|
|
package com.Acrobot.ChestShop.Listeners;
|
|
|
|
|
|
|
|
import com.Acrobot.Breeze.Utils.MaterialUtil;
|
|
|
|
import com.Acrobot.ChestShop.Events.ItemParseEvent;
|
|
|
|
import com.Acrobot.ChestShop.Events.MaterialParseEvent;
|
|
|
|
import org.bukkit.event.EventHandler;
|
2021-01-03 01:55:01 +01:00
|
|
|
import org.bukkit.event.EventPriority;
|
2019-01-17 19:50:47 +01:00
|
|
|
import org.bukkit.event.Listener;
|
|
|
|
|
|
|
|
public class SignParseListener implements Listener {
|
|
|
|
|
2021-01-03 01:55:01 +01:00
|
|
|
@EventHandler(priority = EventPriority.NORMAL)
|
2019-01-17 19:50:47 +01:00
|
|
|
public static void onItemParse(ItemParseEvent event) {
|
2021-01-03 01:55:01 +01:00
|
|
|
if (event.getItem() == null) {
|
|
|
|
event.setItem(MaterialUtil.getItem(event.getItemString()));
|
|
|
|
}
|
2019-01-17 19:50:47 +01:00
|
|
|
}
|
|
|
|
|
2021-01-03 01:55:01 +01:00
|
|
|
@EventHandler(priority = EventPriority.NORMAL)
|
2019-01-17 19:50:47 +01:00
|
|
|
public static void onMaterialParse(MaterialParseEvent event) {
|
2021-01-03 01:55:01 +01:00
|
|
|
if (event.getMaterial() == null) {
|
|
|
|
event.setMaterial(MaterialUtil.getMaterial(event.getMaterialString()));
|
|
|
|
}
|
2019-01-17 19:50:47 +01:00
|
|
|
}
|
|
|
|
}
|