Skip to content

Commit

Permalink
Merge pull request #3 from BentoBoxWorld/develop
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
tastybento authored Jul 16, 2023
2 parents fcc3208 + a9d3b1e commit 7135cc2
Show file tree
Hide file tree
Showing 13 changed files with 878 additions and 143 deletions.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img width="403" alt="parkour" src="https://github.com/BentoBoxWorld/Parkour/assets/4407265/10dcc201-9686-4b3a-b9c4-e5fd52b79b0d">

## Description
The Parkour addon is a BentoBox addon for Minecraft that allows players to create and play parkour courses within the game. It provides a creative mode for course creation and a survival mode for course gameplay. The plugin features gold pressure plates as the starting and ending points of the courses. It tracks the time taken by players to complete the courses and maintains a scores for each course. Additionally, creators can place checkpoints along their courses to help players restart from the last checkpoint if they fall. The plugin also supports team gameplay, allowing players to form teams and collaborate on course creation using the same engine as BSkyBlock. Players can explore and compete in various courses using the `/courses` command.
The Parkour addon is a BentoBox addon for Minecraft that allows players to create and play parkour courses within the game. It provides a creative mode for course creation and a survival mode for course gameplay. The plugin features gold pressure plates as the starting and ending points of the courses. It tracks the time taken by players to complete the courses and maintains a scores for each course. Additionally, creators can place checkpoints along their courses to help players restart from the last checkpoint if they fall. The plugin also supports team gameplay, allowing players to form teams and collaborate on course creation using the same engine as BSkyBlock. Players can expose their course using the `/pk setwarp` command and explore and compete in other courses using the `/pk courses` command.

## Features
- Course Creation: Players can create parkour courses in creative mode using the plugin.
Expand All @@ -12,11 +12,11 @@ The Parkour addon is a BentoBox addon for Minecraft that allows players to creat
- High Score: A high score is maintained for each course, allowing players to compete for the best time.
- Checkpoints: Creators can place checkpoints along their courses to assist players in restarting from the last checkpoint if they fall.
- Team Collaboration: The plugin uses the same engine as BSkyBlock, enabling players to form teams and work together on course creation.
- Course Teleportation: The `/courses` command lists all the tracks or courses made, allowing players to teleport to them.
- Course Teleportation: The `/pk courses` command lists all the tracks or courses made, allowing players to teleport to them.
- Competition: Players can compete against each other to achieve the best time on the courses.

## Usage
To get started, use the `/pk` command to access the parkour plugin. This will teleport players to an example parkour course and get them started. Admins can use blueprints to change the default course example or make additional ones.
To get started, use the `/pk` or `/parkour` command to access the parkour plugin. This will teleport players to an example parkour course and get them started. Admins can use blueprints to change the default course example or make additional ones.

### Course Creation
1. Enter creative mode. Players will need permission to do this.
Expand All @@ -26,36 +26,35 @@ To get started, use the `/pk` command to access the parkour plugin. This will te
5. Test your course to ensure it is playable and challenging.

### Course Gameplay
1. Enter survival mode.
2. Locate the course you want to play using the `/courses` command, or play your own.
3. Click on the ones available to reach the course.
4. Step on the gold pressure plate to start the course.
5. Complete the course as quickly as possible, avoiding falls and reaching each checkpoint if available.
6. Step on the gold pressure plate at the end to finish the course and record your time.
1. Locate the course you want to play using the `/pk courses` command, or play your own.
2. Click on one to reach the course.
3. Step on the gold pressure plate to start the course. You will enter survival mode.
4. Complete the course as quickly as possible, avoiding falls and reaching each checkpoint if available.
5. Step on the gold pressure plate at the end to finish the course and record your time.

### Team Collaboration
1. Form a team with other players using the team creation commands `pk team invite <player name>`.
2. Collaborate with your team members to design and build parkour courses.
3. Use the `/courses` command to view and play each other's courses.
4. Compete within the team to achieve the best times on the courses.
3. When you want to make your course available go to the starting area and set a warp point for visitors using `/pk setwarp`
4. Use the `/pk courses` command to view and play each other's courses.
5. Compete within the team to achieve the best times on the courses.

## Commands
- `/pk`: Main command to start a parkour course and teleport to the parkour world.
- `/pk courses`: List all the tracks or courses available and teleport to them.
- `/pk top`: Show the Top Ten.
- `/pk setwarp`: Places the course in the courses menu and sets the warp position visitors will arrive at
- `/pk removewarp`: Makes the course private and removes the visitor's warp

## Permissions

- `parkour.island.create`: Permission to create parkour courses.
See [addon.yml](https://github.com/BentoBoxWorld/Parkour/blob/aeb01c8ef8ca1c07d9dde570e7ab61201710c6d5/src/main/resources/addon.yml#L11) for a full list.

## Compatibility
The Parkour plugin is compatible with Minecraft versions 1.20.1 and requires BentoBox 1.24.0 or later.

## Troubleshooting
If you encounter any issues or have questions regarding the Parkour plugin, please reach out to our support team for assistance.

## Permissions
See the addon.yml file for permissions

## License
The Parkour plugin is released under the [Eclipse Public License 2.0](https://github.com/BentoBoxWorld/Parkour/blob/develop/LICENSE).
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.0.0</build.version>
<build.version>1.1.0</build.version>
<sonar.organization>bentobox-world</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/world/bentobox/parkour/Parkour.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.event.Listener;
import org.bukkit.generator.ChunkGenerator;
import org.eclipse.jdt.annotation.Nullable;
Expand All @@ -15,6 +15,8 @@
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.configuration.WorldSettings;
import world.bentobox.parkour.commands.CoursesCommand;
import world.bentobox.parkour.commands.RemoveWarpCommand;
import world.bentobox.parkour.commands.SetWarpCommand;
import world.bentobox.parkour.commands.TopCommand;
import world.bentobox.parkour.generators.ChunkGeneratorWorld;
import world.bentobox.parkour.gui.RankingsUI;
Expand Down Expand Up @@ -55,8 +57,10 @@ public void onLoad() {
public void setup()
{
super.setup();
new TopCommand(getAddon(), this);
new CoursesCommand(getAddon(), this);
new TopCommand(this);
new CoursesCommand(this);
new SetWarpCommand(this);
new RemoveWarpCommand(this);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.panels.builders.TabbedPanelBuilder;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.parkour.Parkour;
import world.bentobox.parkour.gui.CoursesTab;

public class CoursesCommand extends CompositeCommand {

public CoursesCommand(Parkour addon, CompositeCommand parent) {
public CoursesCommand(CompositeCommand parent) {
super(parent, "courses", "tracks");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package world.bentobox.parkour.commands;

import java.util.List;
import java.util.Objects;

import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.parkour.Parkour;
import world.bentobox.parkour.ParkourManager;

public class RemoveWarpCommand extends CompositeCommand {

public RemoveWarpCommand(CompositeCommand parent) {
super(parent, "removewarp");
}

@Override
public void setup() {
this.setPermission("parkour.removewarp");
setOnlyPlayer(true);
setDescription("parkour.commands.parkour.removewarp.description");
setConfigurableRankCommand();
}

@Override
public boolean canExecute(User user, String label, List<String> args) {
if (!args.isEmpty()) {
this.showHelp(this, user);
return false;
}
Island island = getIslands().getIsland(getWorld(), user);
// Check rank to use command
int rank = Objects.requireNonNull(island).getRank(user);
if (rank < island.getRankCommand(getUsage())) {
user.sendMessage("general.errors.insufficient-rank", TextVariables.RANK, user.getTranslation(getPlugin().getRanksManager().getRank(rank)));
return false;
}

ParkourManager pm = ((Parkour)getAddon()).getPm();
if (pm.getWarpSpot(island).isEmpty()) {
user.sendMessage("parkour.errors.no-warp");
return false;
}
return true;
}

@Override
public boolean execute(User user, String label, List<String> args) {
ParkourManager pm = ((Parkour)getAddon()).getPm();
Island island = getIslands().getIsland(getWorld(), user);
user.sendMessage("parkour.warp.removed");
pm.setWarpSpot(island, null);
return true;
}

}
63 changes: 63 additions & 0 deletions src/main/java/world/bentobox/parkour/commands/SetWarpCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package world.bentobox.parkour.commands;

import java.util.List;
import java.util.Objects;

import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.bentobox.database.objects.Island;
import world.bentobox.parkour.Parkour;
import world.bentobox.parkour.ParkourManager;

public class SetWarpCommand extends CompositeCommand {



public SetWarpCommand(CompositeCommand parent) {
super(parent, "setwarp");
}

@Override
public void setup() {
this.setPermission("parkour.setwarp");
setOnlyPlayer(true);
setDescription("parkour.commands.parkour.setwarp.description");
setConfigurableRankCommand();
}

@Override
public boolean canExecute(User user, String label, List<String> args) {
if (!args.isEmpty()) {
this.showHelp(this, user);
return false;
}
if (!getIslands().userIsOnIsland(getWorld(), user)) {
user.sendMessage("parkour.errors.not-on-island");
return false;
}
// Check rank to use command
Island island = getIslands().getIsland(getWorld(), user);
int rank = Objects.requireNonNull(island).getRank(user);
if (rank < island.getRankCommand(getUsage())) {
user.sendMessage("general.errors.insufficient-rank", TextVariables.RANK, user.getTranslation(getPlugin().getRanksManager().getRank(rank)));
return false;
}
return true;
}

@Override
public boolean execute(User user, String label, List<String> args) {
ParkourManager pm = ((Parkour)getAddon()).getPm();
Island island = getIslands().getIsland(getWorld(), user);
if (pm.getWarpSpot(island).isEmpty()) {
user.sendMessage("parkour.warp.set");
} else {
user.sendMessage("parkour.warp.replaced");
}
pm.setWarpSpot(island, user.getLocation());

return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TopCommand extends CompositeCommand {

private Island island;

public TopCommand(Parkour addon, CompositeCommand parent) {
public TopCommand(CompositeCommand parent) {
super(parent, "top");
}

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/world/bentobox/parkour/gui/CoursesTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ private PanelItem getHead(ParkourData pd, UUID playerUUID) {

@Override
public Map<Integer, PanelItem> getTabIcons() {
Map<Integer, PanelItem> icons = new HashMap<>();

return icons;
return new HashMap<>();
}

/* (non-Javadoc)
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/world/bentobox/parkour/objects/ParkourData.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/
@Table(name = "Parkour")
public class ParkourData implements DataObject, Comparable<Integer> {
public class ParkourData implements DataObject, Comparable<ParkourData> {

/**
* uniqueId is the island's UUID
Expand Down Expand Up @@ -84,10 +84,6 @@ public void setUniqueId(String uniqueId) {
this.uniqueId = uniqueId;
}

@Override
public int compareTo(Integer o) {
return Integer.compare(runCount, o);
}

/**
* @return the start
Expand Down Expand Up @@ -131,5 +127,9 @@ public void setWarpSpot(Location warpSpot) {
this.warpSpot = warpSpot;
}

@Override
public int compareTo(ParkourData o) {
return Integer.compare(this.runCount, o.getRunCount());
}

}
Loading

0 comments on commit 7135cc2

Please sign in to comment.