Class RidePigChallenge
java.lang.Object
com.storytimeproductions.models.stgames.challenges.RidePigChallenge
- All Implemented Interfaces:
StoryBlitzChallenge, org.bukkit.event.Listener
public class RidePigChallenge
extends Object
implements StoryBlitzChallenge, org.bukkit.event.Listener
A challenge where players must mount a pig with a saddle. The challenge is completed when a
player successfully mounts any of the spawned pigs.
-
Constructor Summary
ConstructorsConstructorDescriptionRidePigChallenge(List<Cuboid> spawnRegions) Constructs a RidePigChallenge using the provided spawn regions. -
Method Summary
Modifier and TypeMethodDescriptionvoidCleans up the challenge by unregistering the event listener and removing all pigs.Gets the description of the challenge.booleanisCompleted(org.bukkit.entity.Player player) Checks if the challenge is completed for a player.voidonPlayerMountPig(org.bukkit.event.player.PlayerInteractEntityEvent event) Handles the event when a player mounts a pig.voidStarts the challenge by spawning pigs at random locations.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StoryBlitzChallenge
getDescriptionWithGoobModifier and TypeMethodDescriptiondefault StringgetDescriptionWithGoob(String normalDescription) Returns a description with a chance to include "goob" for fun.
-
Constructor Details
-
RidePigChallenge
-
-
Method Details
-
getDescription
Gets the description of the challenge.- Specified by:
getDescriptionin interfaceStoryBlitzChallenge- Returns:
- Challenge description
-
start
Starts the challenge by spawning pigs at random locations.- Specified by:
startin interfaceStoryBlitzChallenge- Parameters:
players- List of players participating in the challenge
-
isCompleted
public boolean isCompleted(org.bukkit.entity.Player player) Checks if the challenge is completed for a player.- Specified by:
isCompletedin interfaceStoryBlitzChallenge- Parameters:
player- The player to check- Returns:
- true if the player has completed the challenge, false otherwise
-
cleanup
Cleans up the challenge by unregistering the event listener and removing all pigs.- Specified by:
cleanupin interfaceStoryBlitzChallenge- Parameters:
players- The players in the game.
-
onPlayerMountPig
public void onPlayerMountPig(org.bukkit.event.player.PlayerInteractEntityEvent event) Handles the event when a player mounts a pig.- Parameters:
event- The PlayerInteractEntityEvent triggered when a player interacts with a pig
-