Skip to content

Commit

Permalink
Release 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
CorwinDev committed Sep 10, 2022
1 parent c0ec61e commit 4740e57
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ StreamerVSChat is a open source project that allows you to play against your fol
2. Upload the file to your plugin folder
3. Start your server
4. Edit the config file
5. Restart your server
5. Restart/reload your server

SUPPORT AT [DISCORD](https://discord.gg/KrTfebJhNH)

Expand All @@ -19,9 +19,12 @@ SUPPORT AT [DISCORD](https://discord.gg/KrTfebJhNH)
Get your YouTube API Key [here](https://console.developers.google.com/apis/credentials)<br>
Get your Discord Bot Token [here](https://discord.com/developers/applications)<br>
3. Save the file
4. Restart your server
4. Restart/reload your server

## How to use the commands
### We have now ability to make custom commands!
For more information, check out the [wiki](https://github.com/CorwinDev/StreamerVSChat/wiki#custom-commands-setup)

We have over 20 commands that you can use to control the streamer:
| Command | Description |
| --- | --- |
Expand Down Expand Up @@ -49,4 +52,3 @@ We have over 20 commands that you can use to control the streamer:
// All ! above can be replaced with your custom prefix
// More commands coming soon //


2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>StreamerVSChat</groupId>
<artifactId>StreamerVSChat</artifactId>
<version>1.3</version>
<version>1.4</version>
<packaging>jar</packaging>

<name>Streamer vs Chat</name>
Expand Down
14 changes: 13 additions & 1 deletion src/main/java/nl/corwindev/streamervschat/commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.EntityType;
Expand Down Expand Up @@ -88,6 +87,8 @@ public static void runCmd(String command) {
commands.jumpboost();
}else if(Objects.equals(command, "levitate") || Objects.equals(command, "fly")) {
commands.fly();
}else {
commands.custom(command);
}
}

Expand Down Expand Up @@ -258,4 +259,15 @@ public static void fly(){
player.addPotionEffect(new org.bukkit.potion.PotionEffect(org.bukkit.potion.PotionEffectType.LEVITATION, duration * 20, 1));
}
}

public static void custom(String command){
String command1 = plugin.getConfig().getString("customcommands." + command + ".command");
if(command1 != null){
for (Player player : getPlayers()) {
String command2 = command1.replace("%player%", player.getName());
plugin.getLogger().info(command2);
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command2);
}
}
}
}
15 changes: 15 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,18 @@ youtube: {
youtubeId: 'youtube id',
apiKey: 'youtube api key'
}

# Custom Commands
#
# You can add custom commands to the plugin
# You can add as many commands as you want
# Command name without the prefix
# Command: Command that will be executed without the /
# You can use %player% to get the player name
# Example: !test -> /give %player% diamond 1

customcommands:
'test':
command: 'give %player% diamond 1'
'test2':
command: 'give %player% diamond 2'
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: StreamerVsChat
version: '1.3'
version: '1.4'
main: nl.corwindev.streamervschat.main
api-version: 1.13
commands:
Expand Down

0 comments on commit 4740e57

Please sign in to comment.