forked from Upstream/mmocore
Increased event priorities of exp sources
This commit is contained in:
parent
c8f1f9fefd
commit
44d0785f73
@ -46,7 +46,7 @@ public class BrewPotionExperienceSource extends ExperienceSource<PotionMeta> {
|
||||
public ExperienceSourceManager<BrewPotionExperienceSource> newManager() {
|
||||
return new ExperienceSourceManager<BrewPotionExperienceSource>() {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void a(BrewEvent event) {
|
||||
Optional<Player> playerOpt = getNearbyPlayer(event.getBlock().getLocation());
|
||||
if (!playerOpt.isPresent())
|
||||
|
@ -43,7 +43,7 @@ public class EnchantItemExperienceSource extends ExperienceSource<Void> {
|
||||
public ExperienceSourceManager<EnchantItemExperienceSource> newManager() {
|
||||
return new ExperienceSourceManager<EnchantItemExperienceSource>() {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void a(EnchantItemEvent event) {
|
||||
PlayerData player = PlayerData.get(event.getEnchanter());
|
||||
for (EnchantItemExperienceSource source : getSources())
|
||||
|
@ -27,7 +27,7 @@ public class FishItemExperienceSource extends SpecificExperienceSource<ItemStack
|
||||
public ExperienceSourceManager<FishItemExperienceSource> newManager() {
|
||||
return new ExperienceSourceManager<FishItemExperienceSource>() {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void a(PlayerFishEvent event) {
|
||||
if (event.getState() == State.CAUGHT_FISH) {
|
||||
ItemStack caught = ((Item) event.getCaught()).getItemStack();
|
||||
|
@ -46,7 +46,7 @@ public class RepairItemExperienceSource extends ExperienceSource<ItemStack> {
|
||||
|
||||
private class CustomExperienceManager extends ExperienceSourceManager<RepairItemExperienceSource> {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void a(InventoryClickEvent event) {
|
||||
if (event.getInventory() == null || event.getInventory().getType() != InventoryType.ANVIL || event.getSlot() != 2)
|
||||
return;
|
||||
|
@ -29,7 +29,7 @@ public class SmeltItemExperienceSource extends SpecificExperienceSource<ItemStac
|
||||
public ExperienceSourceManager<SmeltItemExperienceSource> newManager() {
|
||||
return new ExperienceSourceManager<SmeltItemExperienceSource>() {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void a(BlockCookEvent event) {
|
||||
Optional<Player> player = getNearestPlayer(event.getBlock().getLocation());
|
||||
if (!player.isPresent())
|
||||
|
@ -10,10 +10,9 @@ import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Wolf;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
|
||||
import static org.bukkit.event.EventPriority.HIGHEST;
|
||||
|
||||
public class TameExperienceSource extends SpecificExperienceSource {
|
||||
public TameExperienceSource(ExperienceDispenser dispenser, MMOLineConfig config) {
|
||||
super(dispenser, config);
|
||||
@ -23,7 +22,7 @@ public class TameExperienceSource extends SpecificExperienceSource {
|
||||
public ExperienceSourceManager<TameExperienceSource> newManager() {
|
||||
return new ExperienceSourceManager<TameExperienceSource>() {
|
||||
|
||||
@EventHandler(priority = HIGHEST,ignoreCancelled = true)
|
||||
@EventHandler(priority = EventPriority.HIGHEST,ignoreCancelled = true)
|
||||
public void onWolfHit(EntityDamageByEntityEvent e) {
|
||||
if(e.getDamager() instanceof Wolf) {
|
||||
Wolf wolf= (Wolf) e.getDamager();
|
||||
|
Loading…
Reference in New Issue
Block a user