-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from Arctic-Gaming-LLC/dev
Added BetonQuests condition
- Loading branch information
Showing
7 changed files
with
169 additions
and
1 deletion.
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
30 changes: 30 additions & 0 deletions
30
src/main/java/net/pentlock/thunderdataengine/beton/ArcheryDefenseCondition.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,30 @@ | ||
package net.pentlock.thunderdataengine.beton; | ||
|
||
import net.pentlock.thunderdataengine.profiles.ThunderPlayer; | ||
import net.pentlock.thunderdataengine.utilities.PlayerUtil; | ||
import org.betonquest.betonquest.Instruction; | ||
import org.betonquest.betonquest.api.Condition; | ||
import org.betonquest.betonquest.exceptions.InstructionParseException; | ||
import org.betonquest.betonquest.exceptions.QuestRuntimeException; | ||
import org.betonquest.betonquest.utils.PlayerConverter; | ||
import org.bukkit.entity.Player; | ||
|
||
public class ArcheryDefenseCondition extends Condition { | ||
private final int defense; | ||
|
||
public ArcheryDefenseCondition(Instruction instruction, boolean forceSync) throws InstructionParseException { | ||
super(instruction, forceSync); | ||
this.defense = instruction.getInt(); | ||
} | ||
|
||
@Override | ||
protected Boolean execute(String s) throws QuestRuntimeException { | ||
Player player = PlayerConverter.getPlayer(s); | ||
ThunderPlayer thunderPlayer = PlayerUtil.findPlayer(player.getUniqueId()); | ||
if (thunderPlayer != null) { | ||
return defense >= thunderPlayer.getPhysicalDefense(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/net/pentlock/thunderdataengine/beton/ArcheryOffenseCondition.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,30 @@ | ||
package net.pentlock.thunderdataengine.beton; | ||
|
||
import net.pentlock.thunderdataengine.profiles.ThunderPlayer; | ||
import net.pentlock.thunderdataengine.utilities.PlayerUtil; | ||
import org.betonquest.betonquest.Instruction; | ||
import org.betonquest.betonquest.api.Condition; | ||
import org.betonquest.betonquest.exceptions.InstructionParseException; | ||
import org.betonquest.betonquest.exceptions.QuestRuntimeException; | ||
import org.betonquest.betonquest.utils.PlayerConverter; | ||
import org.bukkit.entity.Player; | ||
|
||
public class ArcheryOffenseCondition extends Condition { | ||
private final int offense; | ||
|
||
public ArcheryOffenseCondition(Instruction instruction, boolean forceSync) throws InstructionParseException { | ||
super(instruction, forceSync); | ||
this.offense = instruction.getInt(); | ||
} | ||
|
||
@Override | ||
protected Boolean execute(String s) throws QuestRuntimeException { | ||
Player player = PlayerConverter.getPlayer(s); | ||
ThunderPlayer thunderPlayer = PlayerUtil.findPlayer(player.getUniqueId()); | ||
if (thunderPlayer != null) { | ||
return offense >= thunderPlayer.getArcheryOffense(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/net/pentlock/thunderdataengine/beton/LevelCondition.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,30 @@ | ||
package net.pentlock.thunderdataengine.beton; | ||
|
||
import net.pentlock.thunderdataengine.profiles.ThunderPlayer; | ||
import net.pentlock.thunderdataengine.utilities.PlayerUtil; | ||
import org.betonquest.betonquest.Instruction; | ||
import org.betonquest.betonquest.api.Condition; | ||
import org.betonquest.betonquest.exceptions.InstructionParseException; | ||
import org.betonquest.betonquest.exceptions.QuestRuntimeException; | ||
import org.betonquest.betonquest.utils.PlayerConverter; | ||
import org.bukkit.entity.Player; | ||
|
||
public class LevelCondition extends Condition { | ||
private final int required; | ||
|
||
public LevelCondition(Instruction instruction, boolean forceSync) throws InstructionParseException { | ||
super(instruction, forceSync); | ||
this.required = instruction.getInt(); | ||
} | ||
|
||
@Override | ||
protected Boolean execute(String s) throws QuestRuntimeException { | ||
Player player = PlayerConverter.getPlayer(s); | ||
ThunderPlayer thunderPlayer = PlayerUtil.findPlayer(player.getUniqueId()); | ||
if (thunderPlayer != null) { | ||
return required >= thunderPlayer.getLevel(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/net/pentlock/thunderdataengine/beton/PhysicalDefenseCondition.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,30 @@ | ||
package net.pentlock.thunderdataengine.beton; | ||
|
||
import net.pentlock.thunderdataengine.profiles.ThunderPlayer; | ||
import net.pentlock.thunderdataengine.utilities.PlayerUtil; | ||
import org.betonquest.betonquest.Instruction; | ||
import org.betonquest.betonquest.api.Condition; | ||
import org.betonquest.betonquest.exceptions.InstructionParseException; | ||
import org.betonquest.betonquest.exceptions.QuestRuntimeException; | ||
import org.betonquest.betonquest.utils.PlayerConverter; | ||
import org.bukkit.entity.Player; | ||
|
||
public class PhysicalDefenseCondition extends Condition { | ||
private final int defense; | ||
|
||
public PhysicalDefenseCondition(Instruction instruction, boolean forceSync) throws InstructionParseException { | ||
super(instruction, forceSync); | ||
this.defense = instruction.getInt(); | ||
} | ||
|
||
@Override | ||
protected Boolean execute(String s) throws QuestRuntimeException { | ||
Player player = PlayerConverter.getPlayer(s); | ||
ThunderPlayer thunderPlayer = PlayerUtil.findPlayer(player.getUniqueId()); | ||
if (thunderPlayer != null) { | ||
return defense >= thunderPlayer.getPhysicalDefense(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/net/pentlock/thunderdataengine/beton/PhysicalOffenseCondition.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,29 @@ | ||
package net.pentlock.thunderdataengine.beton; | ||
|
||
import net.pentlock.thunderdataengine.profiles.ThunderPlayer; | ||
import net.pentlock.thunderdataengine.utilities.PlayerUtil; | ||
import org.betonquest.betonquest.Instruction; | ||
import org.betonquest.betonquest.api.Condition; | ||
import org.betonquest.betonquest.exceptions.InstructionParseException; | ||
import org.betonquest.betonquest.exceptions.QuestRuntimeException; | ||
import org.betonquest.betonquest.utils.PlayerConverter; | ||
import org.bukkit.entity.Player; | ||
|
||
public class PhysicalOffenseCondition extends Condition { | ||
private final int offense; | ||
public PhysicalOffenseCondition(Instruction instruction, boolean forceSync) throws InstructionParseException { | ||
super(instruction, forceSync); | ||
this.offense = instruction.getInt(); | ||
} | ||
|
||
@Override | ||
protected Boolean execute(String s) throws QuestRuntimeException { | ||
Player player = PlayerConverter.getPlayer(s); | ||
ThunderPlayer thunderPlayer = PlayerUtil.findPlayer(player.getUniqueId()); | ||
if (thunderPlayer != null) { | ||
return offense >= thunderPlayer.getPhysicalOffense(); | ||
} else { | ||
return null; | ||
} | ||
} | ||
} |