diff options
-rw-r--r-- | README.md | 129 | ||||
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | og-guide.md | 33 | ||||
-rw-r--r-- | src/main/java/com/MylesAndMore/tumble/EventListener.java | 4 | ||||
-rw-r--r-- | src/main/java/com/MylesAndMore/tumble/Game.java | 35 | ||||
-rw-r--r-- | src/main/java/com/MylesAndMore/tumble/TumbleManager.java | 3 | ||||
-rw-r--r-- | src/main/java/com/MylesAndMore/tumble/api/Generator.java | 3 | ||||
-rw-r--r-- | src/main/resources/config.yml | 12 | ||||
-rw-r--r-- | src/main/resources/plugin.yml | 2 |
9 files changed, 132 insertions, 91 deletions
@@ -1,50 +1,79 @@ -# tumble-alphatest (@MylesAndMore @CraivMan) - -please let me know if there is anything more you think we should add @CraivMan! -once this list is complete and all bugs are fixed, we *should* be ready for release... - -## generation - -- [x] layers should be able to generate w/ "clumps" of blocks; instead of only one material as a whole - - [x] the clump size should be customizable (for later); be able to set a min/max val and it will choose randomly per each clump (not in config file yet, just internally) - - *Note: this is done through the amount of times each Material shows up in the List--there's no config for it.* -- [x] make shovels generation actually work properly - - make different types of platforms (square, circle, multi-tiered, etc.); still should be pseudo-random -- [x] make snowballs generation actually work properly (shocker) - - make three layers generate (same layer types as shovels, just multiple of them) - -## game realism - -- [x] make the shovel in shovels mode not lose any durabilty -- [x] make it so that you can't move until the game begins -- [x] make the game blocks breakable very fast, but **not instantly--very important for balancing!!** - - Basically, just set a "cooldown" on both snowballs and shovels--not a long one--but one at that -- [x] add infinite snowballs in the gamemanager for tumble mode -- [x] make it so that you can't remove any of the game items from your inventory -- [x] make snowballs actually break blocks (duh) -- [x] make the randomized mode logic -- [x] make it so rounds end in a draw after 5m -- [x] make it so that players get snowballs instead of shovels in shovels rounds after 2m 30s -- [x] remove snowball knockback - -## game logic - -- [x] make a Game class and object that we can initialize a new instance of with a gameType -- [x] prevent players from joining/autojoining during a game -- [x] keep track of when someone wins; start a new round when this happens -- [x] keep track of how many wins each player has; end the game when a player reaches 3 - - [x] add a section in the config for a place to tp the winning player - - [x] add logic to do this - -## configuration/customization - -- [x] add two configs where you can: - - [x] set if you want the game to auto-start - - [x] set the amt of players you want the game to auto-start at - - [x] program the auto-start (just add an if statement on the PlayerJoin listener to run the StartGame method on a certain amt of players in the config) - -## etc - -- [x] refactor EventListener null checker code - - if (TumbleManager.getGameWorld() == null && TumbleManager.getLobbyWorld() == null) { return; } -- [x] add game music? but probably only for us; I feel like the og music must be copyrighted +# tumble + +## Overview + +Tumble is a Spigot/Paper plugin that aims to recreate the Tumble minigame from the bygone era of the Minecraft Legacy Console Editions. + +## What *is* Tumble? + +If you've never heard of it, [Tumble](https://minecraft-archive.fandom.com/wiki/Tumble_Mode) is a twist on the classic Minecraft minigame of spleef, where the objective is to break the blocks under your opponents. But in Tumble, you play on randomly generated layers of blocks, using shovels, snowballs, or both to try and eliminate your opponents. + +## Features + +- Choose from three different game modes present in the original game--shovels, snowballs, and mixed +- Four types of random layer generation +- 15 unique, themed layer varieties +- Quick and easy setup and use +- Support for 2-8 players +- Highly customizable +- Open-source codebase + +## Setup + +1. Simply [download](https://github.com/MylesAndMore/tumble/releases/tag/stable) the plugin's JAR file and place it in your server's plugins directory. + + - *Note: Multiverse is also required for the plugin to run, you may download it [here](https://www.spigotmc.org/resources/multiverse-core.390/).* + +2. Make sure that you have at least two worlds in your world directory! One is for your lobby world, and the other is for your game arena. + + - If you would like an experience similar to the original game, see [my guide](https://github.com/MylesAndMore/tumble/blob/main/og-guide.md) for using the original worlds. + +3. Start your server. The plugin will generate a couple of warnings, these are normal. +4. Ensure that you have imported your worlds into Multiverse. This can be done with the command ```/mv import <your-world-name> normal```. +5. Now you need to tell Tumble which world is your lobby and which world is your game arena. You can do this with ```/tumble:link <your-lobby-world> lobby``` and ```/tumble:link <your-game-world> game``` respectively. +6. **VERY IMPORTANT:** The plugin will teleport players to the world spawn point of each world, and generate the game's blocks around the spawn point of the game world. Ensure that your spawn points are clear of any obstructions, and that a 20x20x20 cube is cleared out from the spawn of whatever game world you are using. **Any blocks in this area will be destroyed when the game begins.** +7. You're done! You can now start games with the command ```/tumble:start```. + +Scroll down for more options to configure your game. + +## Commands + +- ```/tumble:reload``` + + - *Description:* Reloads the plugin's configuration. + - *Usage:* ```/tumble:reload``` + - *Permission:* ```tumble.reload``` +- ```/tumble:link``` + - *Description:* Links a world on the server as a lobby or game world. + - *Usage:* ```/tumble:link <world> (lobby|game)``` + - *Permission:* ```tumble.link``` +- ```/tumble:start``` + - *Description:* Force starts a Tumble match (with an optional game type). + - *Usage:* ```/tumble:start [game-type]``` + - *Permission:* ```tumble.start``` +- ```/tumble:winlocation``` + - *Description:* Sets the location to teleport the winning player of a game. Uses the player's location if no arguments are specified. + - *Usage:* ```/tumble:winlocation [x] [y] [z]``` + - *Permission:* ```tumble.winlocation``` +- ```/tumble:autostart``` + - *Description:* Configures the auto start functions of Tumble. + - *Usage:* ```/tumble:autostart <playerAmount> [enable|disable]``` + - *Permission:* ```tumble.autostart``` + +## Configuration + +- ```gameMode``` + - Customize the default game mode of Tumble. + - Acceptable options include: shovels, snowballs, mixed + - *Default:* ```mixed``` + +- ```hideJoinLeaveMessages``` + - Hides join/leave messages in public chat. + - *Default:* ```false``` + +- ```permissionMessage``` + - Customize the message that displays when the player does not have permission to execute a command from this plugin. + +## Issues & Feedback + +Feel free to report any bugs, leave feedback, ask questions, or submit ideas for new features on our [GitHub issues page](https://github.com/MylesAndMore/tumble/issues/new)! diff --git a/build.gradle b/build.gradle index 019bafd..a7f815e 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ java { } group 'tumble' -version '0.0.1-SNAPSHOT' +version '1.0.0' repositories { // Use Maven Central for resolving dependencies. diff --git a/og-guide.md b/og-guide.md new file mode 100644 index 0000000..314ddf8 --- /dev/null +++ b/og-guide.md @@ -0,0 +1,33 @@ +# tumble + +## Guide for original worlds + +In this guide, I'll go over how to set up the Tumble plugin with the original game worlds from the Legacy Console Editions. + +## Steps + +1. Download the worlds and unzip them into your server's main/root directory. **Ensure you download the Java and not the Bedrock versions**! +A huge thanks to *Catmanjoe* for porting these worlds! This game would not be the same without you! + + - [Lobby (new edition)](https://mcpedl.com/mc-2017-new-mini-games-lobby-download-map/) + - [Lobby (old edition)](https://mcpedl.com/minecraft-2016-classic-mini-games-lobby-map/) + - [Arena](https://www.planetminecraft.com/project/minecraft-2016-classic-mini-games-lobby-download-bedrock-edition/) +2. Take note of the names of the world folders (you may rename them), we will need this in a moment. +3. Start and join your server. +4. Import both worlds into Multiverse. You can do this by running the command ```/mv import <your-world-name> normal``` for both worlds. +5. Now you can link each world! Do this with ```/tumble:link <your-lobby-world> lobby``` and ```/tumble:link <your-game-world> game``` respectively. +6. Teleport to your new lobby world by using ```/mvtp <your-lobby-world>```. +7. Set the correct spawn location in this world using ```/setworlspawn```. For me, the correct coordinates were ```/setworldspawn place holder L```, but your results may vary. +8. Set the location that the winner will be teleported using ```tumble:winloc```. Again, the correct coordinates were ```tumble:winloc wait no u``` in my case. +9. Now, teleport to the game world. Use ```/mvtp <your-game world>```. +10. Set the correct spawn point of this world. This is also where the game will generate its blocks. My preferred position is ```/setworldspawn 0 60 0```, but you may place the spawn whereever you like. + +You're done! + +## Continuation + +With this, the setup for this plugin is complete, but there still may be more for you to do. There are other plugins out there to fine-tune your experience even more. Plugins like [WorldGuard](https://dev.bukkit.org/projects/worldguard) and [CyberWorldReset](https://www.spigotmc.org/resources/cyberworldreset-standard-%E2%9C%A8-regenerate-worlds-scheduled-resets-lag-optimized%E3%80%8C1-8-1-19%E3%80%8D.96834/) can protect players from breaking blocks in the lobby and reset any redstone they activated, while others like [ViaVersion](https://www.spigotmc.org/resources/viaversion.19254/) can allow you to play Tumble from your favorite Minecraft version (yes, you, 1.8.9 players). + +Whatever you choose, the experience is up to you. + +Happy playing! diff --git a/src/main/java/com/MylesAndMore/tumble/EventListener.java b/src/main/java/com/MylesAndMore/tumble/EventListener.java index d6b3ffa..5e46e87 100644 --- a/src/main/java/com/MylesAndMore/tumble/EventListener.java +++ b/src/main/java/com/MylesAndMore/tumble/EventListener.java @@ -4,7 +4,6 @@ import java.util.Objects; import org.bukkit.Bukkit; import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.entity.Snowball; import org.bukkit.event.EventHandler; @@ -17,6 +16,9 @@ import org.bukkit.event.player.*; import org.bukkit.inventory.ItemStack; import org.bukkit.util.Vector; +/** + * Tumble event listener for all plugin and game-related events. + */ public class EventListener implements Listener { @EventHandler public void PlayerJoinEvent(PlayerJoinEvent event) { diff --git a/src/main/java/com/MylesAndMore/tumble/Game.java b/src/main/java/com/MylesAndMore/tumble/Game.java index 01c3542..10b5c67 100644 --- a/src/main/java/com/MylesAndMore/tumble/Game.java +++ b/src/main/java/com/MylesAndMore/tumble/Game.java @@ -17,6 +17,9 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; import java.util.*; +/** + * This class holds all methods relating to the tumble Game in any way! + */ public class Game { // Singleton class logic // Define the gameInstance @@ -46,8 +49,6 @@ public class Game { private int gameID = -1; // Define a variable for the autostart PID private int autoStartID = -1; - // Define a variable for music ID - private int musicID = -1; // Define a variable to keep the list of tracks that have already played in the game List<String> sounds = new ArrayList<>(); @@ -56,9 +57,6 @@ public class Game { // Define the game world and its spawnpoint as a new Location for use later private final World gameWorld; private final Location gameSpawn; - -// // Make a list of the lobby's players for later -// private List<Player> lobbyPlayers = TumbleManager.getPlayersInLobby(); // Make a list of the game's players for later private List<Player> gamePlayers; // Make a list of the round's players @@ -130,7 +128,6 @@ public class Game { displayTitles(gamePlayers, ChatColor.GREEN + "Go!", null, 1, 5, 1); setGamemode(gamePlayers, GameMode.SURVIVAL); gameState = "running"; - playMusic(gamePlayers, SoundCategory.NEUTRAL, 1, 1); }, 20); }, 20); }, 20); @@ -443,30 +440,6 @@ public class Game { } } - private void playMusic(@NotNull List<Player> players, @NotNull SoundCategory category, float volume, float pitch) { - if (sounds.size() == 0) { - sounds.addAll(List.of( - "minecraft:tumble.0", - "minecraft:tumble.1", - "minecraft:tumble.2", - "minecraft:tumble.3", - "minecraft:tumble.4", - "minecraft:tumble.5", - "minecraft:tumble.6", - "minecraft:tumble.7", - "minecraft:tumble.8", - "minecraft:tumble.9")); - } - String currentSong = sounds.get(Random.nextInt(sounds.size())); - for (Player aPlayer : players) { - aPlayer.playSound(aPlayer.getLocation(), currentSong, category, volume, pitch); - } - sounds.remove(currentSong); - musicID = Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(TumbleManager.getPlugin(), () -> { - playMusic(gamePlayers, SoundCategory.NEUTRAL, 1, 1); - }, 1460); - } - /** * Teleports a list of players to the specified scatter locations in the gameWorld * @param players a List of Players to teleport @@ -603,8 +576,6 @@ public class Game { displayActionbar(gamePlayers, ChatColor.BLUE + "Returning to lobby in ten seconds..."); // Wait 10s (200t), then Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(TumbleManager.getPlugin(), () -> { - // Stop music from replaying - Bukkit.getServer().getScheduler().cancelTask(musicID); // First, check to see if there is a separate location to tp the winner to if ((TumbleManager.getPlugin().getConfig().getDouble("winnerTeleport.x") != 0) && (TumbleManager.getPlugin().getConfig().getDouble("winnerTeleport.y") != 0) && (TumbleManager.getPlugin().getConfig().getDouble("winnerTeleport.z") != 0)) { // Tp the winner to that location diff --git a/src/main/java/com/MylesAndMore/tumble/TumbleManager.java b/src/main/java/com/MylesAndMore/tumble/TumbleManager.java index 7605717..43cc241 100644 --- a/src/main/java/com/MylesAndMore/tumble/TumbleManager.java +++ b/src/main/java/com/MylesAndMore/tumble/TumbleManager.java @@ -8,6 +8,9 @@ import org.bukkit.plugin.Plugin; import java.util.List; +/** + * Class to store long return methods to make writing this plugin slightly less painful. + */ public class TumbleManager { // Tumble plugin public static Plugin getPlugin() { diff --git a/src/main/java/com/MylesAndMore/tumble/api/Generator.java b/src/main/java/com/MylesAndMore/tumble/api/Generator.java index 0a35767..db8bacc 100644 --- a/src/main/java/com/MylesAndMore/tumble/api/Generator.java +++ b/src/main/java/com/MylesAndMore/tumble/api/Generator.java @@ -11,6 +11,9 @@ import java.util.Collections; import java.util.List; import java.util.Random; +/** + * This class holds the methods that generate blocks in-game such as cylinders, cubiods, and clump logic. + */ public class Generator { /** * Generates a layer (bascally just a cylinder) as best as it can w/ blocks diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index bc68c35..ee2a2c7 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1,3 +1,8 @@ +# Customize the default game mode of Tumble +# Acceptable options include: shovels, snowballs, mixed +# Default is mixed +gameMode: mixed + # Hides join/leave messages in public chat # Default is false hideJoinLeaveMessages: false @@ -5,13 +10,8 @@ hideJoinLeaveMessages: false # Customize the message that displays when the player does not have permission to execute a command from this plugin permissionMessage: You do not have permission to perform this command! -# Customize the game mode of Tumble -# Acceptable options include: shovels, snowballs, mixed -# Default is mixed -gameMode: mixed - # Customize the auto start feature of Tumble -# Defaults are disabled and two players +# Defaults are false and two players # Players can be up to 8 autoStart: enabled: false diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index ac394bf..c78eece 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ main: com.MylesAndMore.tumble.Main name: tumble -version: 0.0.1-SNAPSHOT +version: 1.0.0 description: 'A Minecraft: Java Edition plugin recreating the Tumble minigame from Minecraft Legacy Console Edition.' api-version: 1.19 load: STARTUP |