Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 50 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,71 @@
Cobblemon Challenge is an extremely simple plugin for Cobblemon that makes challenging your friends and rivals to flat-level Pokemon battles
easier! This is a server-side plugin that only needs to be installed on the Server.

#### Commands

#### Command Parameters
```/challenge <username>``` - Challenges specified player to a lvl 50 pokemon battle. They may accept or deny this challenge.

```/challenge <username> level <level>``` - Challenges specified player to a lvl X battle where X can be 1-100.
```/challenge <username> level <level>``` - Challenges specified player to a lvl ```<level>``` battle where ```<level>``` can be **1 min** & **100 max**.

```/challenge <username> levelRange <minLevel> <maxLevel>``` - Challenges specified player to a lvl where the Pokemon's levels are clamped between the ```<minLevel>```&```<maxLevel>``` where ```<minLevel>```&```<maxLevel>``` can be **1 min** & **100 max**.

```/challenge <username> handicap <self> <rival>``` - Challenges specified player to a battle where ```<self>``` (the challenger) & ```<rival>``` (the challenged) Pokemon level is offset by the input level. ```<self>```&```<rival>``` can be from **-99 min** & **99 max**.

```/challenge <username> showPreview <true/false>``` - Challenges specified player to a default battle with no preview of the rivals pokemon during starter selection.

##### Notes About Command Parameters:
1. The order of parameter input must be ```username``` -> ```level/levelRange``` -> ```handicap``` -> ```showPreview```.
2. If the challenge property is optional & not specified in the command. The default values from the config file will be used.

Example: ```/challenge TurtleHoarder level 100``` challenges TurtleHoarder to a level 100 battle.
#### Configurations
There are numerous options that will allow you to customize the Challenge experience to your server's needs. These
settings can be found in the Cobblemon Challenge config file:

```challengeDistanceRestriction``` - The value that determines if challenges are restricted by distance. Set to **false** if you would
want no restrictions on distance. This value is set to **true** by default.

```maxChallengeDistance``` - If challengeDistanceRestriction is set to **true**, then this value defines the max distance
```maxChallengeDistance``` - If challengeDistanceRestriction is set to **true**, then this value defines the max distance
that a challenge can be sent. This is set to 50 blocks by default.

```defaultChallengeLevel``` - The value that determines the level of a challenge if there is not level specified by the challenger.
```defaultChallengeLevel``` - The value that determines the level of a challenge if there is no level specified by the challenger.
This is set to 50 by default for lvl 50 battles.

```defaultHandicap``` - The value that determines each player's final level of each Pokemon if a handicap is not specified by the challenger.
This is set to 0 by default.

```defaultShowPreview``` - If defaultShowPreview is set to **true** both players will see which pokemon the opponent is bringing to battle. If defaultShowPreview is set to **false** both players parties will be hidden from their opponent.
(Note: Even when defaultShowPreview is true the player will never see the opponents chosen lead pokemon)
This is set to true by default.

```challengeExpirationTime``` - The value that determines how long a challenge should be pending before it expires. This is
set to 60000 milliseconds / 1 minute by default.

```challengeCooldownTime``` - The value that determines how long a player must wait before sending a consecutive request. This value is
```challengeCooldownTime``` - The value that determines how long a player must wait before sending a consecutive request. This value is
set to 5000 milliseconds / 5 seconds by default, though players will need to wait until their existing challenge expires before sending another one.

### All Possible Commands:

```/challenge <username>```

```/challenge <username> handicap <self> <rival>```

```/challenge <username> showPreview <true/false>```

```/challenge <username> handicap <self> <rival> showPreview <true/false>```


```/challenge <username> level <level>```

```/challenge <username> level <level> handicap <self> <rival>```

```/challenge <username> level <level> showPreview <true/false>```

```/challenge <username> level <level> handicap <self> <rival> showPreview <true/false>```


```/challenge <username> levelRange <minLevel> <maxLevel>```

```/challenge <username> levelRange <minLevel> <maxLevel> handicap <self> <rival>```

```/challenge <username> levelRange <minLevel> <maxLevel> showPreview <true/false>```

```/challenge <username> levelRange <minLevel> <maxLevel> handicap <self> <rival> showPreview <true/false>```
10 changes: 3 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version "1.7.10"
id 'org.jetbrains.kotlin.jvm' version "2.0.0"
}

version = project.mod_version
group = project.maven_group

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven {url = "https://maven.parchmentmc.org"}
maven {
url "https://cursemaven.com"
Expand Down Expand Up @@ -46,6 +41,7 @@ dependencies {
//modRuntimeOnly"curse.maven:cobblemon-687131:4468330"

modImplementation"curse.maven:architectury-419699:4663010"
modImplementation("net.fabricmc:fabric-language-kotlin:1.11.0+kotlin.2.0.0")
}

base {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ org.gradle.parallel=true
# check these on https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22
loader_version=0.15.11

# Mod Properties
mod_version = 1.1.7
maven_group = com.turtlehoarder.cobblemonchallenge
archives_base_name = cobblemonchallenge

# Dependencies
fabric_version=0.89.3+1.20.1
cloth_config_version=11.1.106
fabric_version=0.92.2+1.20.1
cloth_config_version=11.1.118
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
24 changes: 24 additions & 0 deletions src/main/java/com/cobblemontournament/CobblemonTournament.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.cobblemontournament;

import com.cobblemontournament.config.TournamentConfig;
import com.cobblemontournament.testing.command.TournamentCommandTest;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CobblemonTournament implements ModInitializer
{
public static String MODID = "cobblemontournament";
public static final Logger LOGGER = LoggerFactory.getLogger("cobblemontournament");

@Override
public void onInitialize()
{
TournamentConfig.registerConfigs();

// for testing
CommandRegistrationCallback.EVENT.register((commandDispatcher, commandBuildContext, commandSelection) ->
TournamentCommandTest.register(commandDispatcher));
}
}
Loading