mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2026-01-06 15:51:52 +00:00
trigger death actions
This commit is contained in:
@@ -317,6 +317,7 @@ public class CropBlock extends AbstractCustomCropsBlock {
|
|||||||
Optional.ofNullable(deathCondition.deathStage()).ifPresent(it -> {
|
Optional.ofNullable(deathCondition.deathStage()).ifPresent(it -> {
|
||||||
BukkitCustomCropsPlugin.getInstance().getItemManager().place(bukkitLocation, deathCondition.existenceForm(), it, rotation);
|
BukkitCustomCropsPlugin.getInstance().getItemManager().place(bukkitLocation, deathCondition.existenceForm(), it, rotation);
|
||||||
});
|
});
|
||||||
|
ActionManager.trigger(context, config.deathActions());
|
||||||
}, deathCondition.deathDelay(), bukkitLocation);
|
}, deathCondition.deathDelay(), bukkitLocation);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ public interface RequirementManager<T> extends Reloadable {
|
|||||||
static <T> boolean isSatisfied(Context<T> context, @Nullable Requirement<T>[] requirements) {
|
static <T> boolean isSatisfied(Context<T> context, @Nullable Requirement<T>[] requirements) {
|
||||||
if (requirements == null) return true;
|
if (requirements == null) return true;
|
||||||
for (Requirement<T> requirement : requirements) {
|
for (Requirement<T> requirement : requirements) {
|
||||||
|
if (requirement == null) continue;
|
||||||
if (!requirement.isSatisfied(context)) {
|
if (!requirement.isSatisfied(context)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user