-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ad43dd
commit 700ac07
Showing
7 changed files
with
79 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
plugin/src/main/java/kor/toxicity/questadder/util/action/ActEntityEffect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package kor.toxicity.questadder.util.action; | ||
|
||
import kor.toxicity.questadder.api.QuestAdder; | ||
import kor.toxicity.questadder.api.event.QuestAdderEvent; | ||
import kor.toxicity.questadder.api.mechanic.AbstractAction; | ||
import kor.toxicity.questadder.api.mechanic.ActionResult; | ||
import kor.toxicity.questadder.api.util.DataField; | ||
import org.bukkit.EntityEffect; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class ActEntityEffect extends AbstractAction { | ||
@DataField(aliases = "e", throwIfNull = true) | ||
public EntityEffect effect; | ||
|
||
public ActEntityEffect(@NotNull QuestAdder adder) { | ||
super(adder); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
super.initialize(); | ||
if (!effect.getApplicable().isAssignableFrom(Player.class)) throw new RuntimeException("inapplicable effect: " + effect.name().toLowerCase()); | ||
} | ||
|
||
@Override | ||
public @NotNull ActionResult invoke(@NotNull Player player, @NotNull QuestAdderEvent event) { | ||
player.playEffect(effect); | ||
return ActionResult.SUCCESS; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters