mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-03-11 13:11:50 +01:00
Compatibility with newest MMOCore dev build
This commit is contained in:
parent
fb1d1d1537
commit
dd591069ce
BIN
lib/MMOCore.jar
BIN
lib/MMOCore.jar
Binary file not shown.
@ -51,7 +51,7 @@ public class MineMIBlockExperienceSource extends SpecificExperienceSource<Intege
|
||||
continue;
|
||||
|
||||
if (source.matches(data, customBlock.get().getId()))
|
||||
source.giveExperience(data, event.getBlock().getLocation());
|
||||
source.giveExperience(data, 1, event.getBlock().getLocation());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -32,23 +32,21 @@ public class SmeltMMOItemExperienceSource extends SpecificExperienceSource<NBTIt
|
||||
public ExperienceManager<SmeltMMOItemExperienceSource> newManager() {
|
||||
return new ExperienceManager<SmeltMMOItemExperienceSource>() {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void a(BlockCookEvent event) {
|
||||
if (!event.isCancelled()) {
|
||||
Optional<Player> player = getNearbyPlayer(event.getBlock().getLocation(), 10);
|
||||
if (!player.isPresent())
|
||||
return;
|
||||
Optional<Player> player = getNearbyPlayer(event.getBlock().getLocation(), 10);
|
||||
if (!player.isPresent())
|
||||
return;
|
||||
|
||||
ItemStack caught = event.getResult();
|
||||
NBTItem nbt = MMOLib.plugin.getVersion().getWrapper().getNBTItem(caught);
|
||||
if (!nbt.hasType())
|
||||
return;
|
||||
ItemStack caught = event.getResult();
|
||||
NBTItem nbt = MMOLib.plugin.getVersion().getWrapper().getNBTItem(caught);
|
||||
if (!nbt.hasType())
|
||||
return;
|
||||
|
||||
PlayerData data = PlayerData.get(player.get());
|
||||
for (SmeltMMOItemExperienceSource source : getSources())
|
||||
if (source.matches(data, nbt))
|
||||
source.giveExperience(data, event.getBlock().getLocation().add(.5, 1, .5));
|
||||
}
|
||||
PlayerData data = PlayerData.get(player.get());
|
||||
for (SmeltMMOItemExperienceSource source : getSources())
|
||||
if (source.matches(data, nbt))
|
||||
source.giveExperience(data, 1, event.getBlock().getLocation().add(.5, 1, .5));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user