forked from Upstream/mmocore
DropTable triggers should only trigger when drop table conditions are met.
This commit is contained in:
parent
3f085b91ec
commit
b9ae31467d
@ -6,6 +6,7 @@ import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.block.BlockInfo;
|
||||
import net.Indyuce.mmocore.api.block.BlockInfo.BlockInfoOption;
|
||||
import net.Indyuce.mmocore.api.block.VanillaBlockType;
|
||||
import net.Indyuce.mmocore.api.droptable.condition.ConditionInstance;
|
||||
import net.Indyuce.mmocore.api.event.CustomBlockMineEvent;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||
@ -108,9 +109,11 @@ public class BlockListener implements Listener {
|
||||
* can give exp to other TOOLS and display HOLOGRAMS
|
||||
*/
|
||||
if (info.hasTriggers() && !block.hasMetadata("player_placed")) {
|
||||
if (!info.hasDropTable() || info.hasDropTable() && info.getDropTable().areConditionsMet(new ConditionInstance(player))) {
|
||||
PlayerData playerData = PlayerData.get(player);
|
||||
info.getTriggers().forEach(trigger -> trigger.apply(playerData));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Apply drop tables
|
||||
|
Loading…
Reference in New Issue
Block a user