Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from Timongcraft/dev
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Timongcraft authored May 18, 2023
2 parents a5b14ca + b31db56 commit 3281e87
Show file tree
Hide file tree
Showing 22 changed files with 431 additions and 174 deletions.
68 changes: 62 additions & 6 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Tgc-System
**Information**
- Bug Reports and Feature Request are welcome, but I maybe won't implement them!
- [Bug Report](https://github.com/Timongcraft/Tgc-System/issues/new?labels=bug&projects=&template=bug_report.yml&title=%5BBug%5D%3A+)s and [Feature Request](https://github.com/Timongcraft/Tgc-System/issues/new?labels=enhancement&projects=&template=feature_request.yml&title=%5BFeature+Request%5D%3A+)s are welcome, but I maybe won't implement them!
- You can toggle most features look at the config below
- The status system will break things if you are using teams because it is not packet based and uses teams to display the status in the tab list!
- Version 1.4.2 and higher: Vanilla teams prefix/suffix is only updated while the player joins for performance reason!
- Version 1.4.1 and below: Vanilla teams can't be used at all if you use the statuses feature!

[![Modrinth](https://raw.githubusercontent.com/Timongcraft/Tgc-System/master/modrinth.png)](https://modrinth.com/plugin/tgc-system)

-----

# Features
- SpawnElytra
- Statuses
- AntiChatReporting (by overriding the default msg command and sending chat messages as server)
- AntiChatReporting (by overriding the default msg and say command and sending chat messages as server)
- A reply command
- A colorcodes command, so you can check the colorcodes if you forgot them
- Join & quit message
Expand All @@ -19,9 +22,10 @@
- A permission system
- A maintenance system
- A auto save system
- A team chat
- A resource pack system
- A alert/broadcast command
- A fly speed command
- A speed, walkspeed and flyspeed command
- A reboot command that reboots server after a specified amount of minutes with a reason
- A plugin command to disable plugins
- Time in chat messages with formatting
Expand All @@ -37,11 +41,13 @@

````
#Do not edit or things might break!
version: 1.5
version: 1.6
prefix:
pluginPrefix: '§7[§1System§7] §f'
alertPrefix: '§7[§4Alert§7] §f'
teamChatPrefix: '§7[§4TeamChat§7] §r'
teamChatPrefixInChat: '#'
#You can use color codes and "%Player%" will be replaced with the player name
joinQuitMessage:
Expand Down Expand Up @@ -142,11 +148,13 @@ blockedPrefixes: []

````
#Do not edit or things might break!
version: 1.5
version: 1.6
prefix:
pluginPrefix: '§7[§1System§7] §f'
alertPrefix: '§7[§4Alert§7] §f'
teamChatPrefix: '§7[§4TeamChat§7] §r'
teamChatPrefixInChat: '#'
#You can use color codes and "%Player%" will be replaced with the player name
joinQuitMessage:
Expand Down
Binary file added modrinth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>timongcraft</groupId>
<artifactId>Tgc-System</artifactId>
<version>1.41</version>
<version>1.42</version>
<packaging>jar</packaging>

<name>Tgc-System</name>
Expand Down Expand Up @@ -74,7 +74,7 @@
<dependency>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-bukkit-shade</artifactId>
<version>9.0.0</version>
<version>9.0.1</version>
</dependency>
</dependencies>
</project>
8 changes: 5 additions & 3 deletions src/main/java/timongcraft/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void onDisable() {

private void configVersionCheck() {
double configVersion = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml")).getDouble("configVersion");
if(configVersion != 1.5) {
if(configVersion != 1.6) {
getLogger().info("§cThe version of the config.yml does not match with the current plugin version!");
getLogger().info("§cUnless you delete the config and restart the server the plugin will be stopped!");
getLogger().info("§cDo not edit the version in the config.yml or things will break!");
Expand All @@ -89,9 +89,11 @@ private void registerCommandsInOnEnable() {
ReloadConfigsCommand.register();
ResourcePackCommand.register();
if(Main.get().getConfig().getBoolean("statuses.enabled")) {
PermissionManagerCommand.register();
StatusCommand.register();
}
StatusCommand.register();
SayCommand.register();
SpeedCommand.register();
WalkSpeedCommand.register();
}

private void registerEvents() {
Expand Down
27 changes: 19 additions & 8 deletions src/main/java/timongcraft/commands/FlySpeedCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import timongcraft.Main;
import timongcraft.util.TeamUtils;
import timongcraft.util.PlayerUtils;

public class FlySpeedCommand {
public static void register() {
Expand Down Expand Up @@ -42,35 +42,46 @@ public void run(CommandSender sender, CommandArguments args) throws WrapperComma

player.setFlySpeed(0.1f);
player.sendMessage(Main.get().getPrefix() + "Fly speed has been reset");
TeamUtils.sendToTeam(player.getName(), null, "Reset his fly speed");
PlayerUtils.sendToTeam(player.getName(), null, "Reset his fly speed");
} else if(args.args().length == 1 || (args.args().length == 2 && sender == args.get("target"))) {
if(!(sender instanceof Player player)) {
sender.sendMessage(Main.get().getPrefix() + "§cUsage: /flyspeed [<flyspeed>] [<player>]");
return;
}

float flySpeed = Float.parseFloat(args.get("flyspeed").toString())/10;
float flySpeed = 0.2f;

if((int) args.get("speed") <= 9) {
flySpeed = Float.parseFloat("0." + args.get("speed"));

} else if((int) args.get("speed") == 10) flySpeed = 1f;

player.setFlySpeed(flySpeed);
if((int) args.get("flyspeed") == 1) {
player.sendMessage(Main.get().getPrefix() + "Fly speed has been reset");
TeamUtils.sendToTeam(player.getName(), null, "Reset his fly speed" );
PlayerUtils.sendToTeam(player.getName(), null, "Reset his fly speed" );
} else {
player.sendMessage(Main.get().getPrefix() + "Set fly speed to " + args.get("flyspeed"));
TeamUtils.sendToTeam(player.getName(), null, "Set his fly speed to " + args.get("flyspeed"));
PlayerUtils.sendToTeam(player.getName(), null, "Set his fly speed to " + args.get("flyspeed"));
}
} else if(args.args().length == 2) {
float flySpeed = Float.parseFloat(args.get("flyspeed").toString())/10;
float flySpeed = 0.2f;

if((int) args.get("speed") <= 9) {
flySpeed = Float.parseFloat("0." + args.get("speed"));

} else if((int) args.get("speed") == 10) flySpeed = 1f;

Player target = (Player) args.get("target");
target.setFlySpeed(flySpeed);
if((int) args.get("flyspeed") == 1) {
target.sendMessage(Main.get().getPrefix() + "Fly speed has been reset by " + sender.getName());
sender.sendMessage(Main.get().getPrefix() + "Reset fly speed of " + target.getName());
TeamUtils.sendToTeam(sender.getName(), target.getName(), "Reset the fly speed of " + target.getName());
PlayerUtils.sendToTeam(sender.getName(), target.getName(), "Reset the fly speed of " + target.getName());
} else {
target.sendMessage(Main.get().getPrefix() + "Fly speed has been set to " + args.get("flyspeed") + " by " + sender.getName());
sender.sendMessage(Main.get().getPrefix() + "Set fly speed of " + target.getName() + " to " + args.get("flyspeed"));
TeamUtils.sendToTeam(sender.getName(), target.getName(), "Set the fly speed of " + target.getName() + " to " + args.get("flyspeed"));
PlayerUtils.sendToTeam(sender.getName(), target.getName(), "Set the fly speed of " + target.getName() + " to " + args.get("flyspeed"));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/timongcraft/commands/MaintenanceCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import timongcraft.Main;
import timongcraft.util.TeamUtils;
import timongcraft.util.PlayerUtils;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -70,15 +70,15 @@ public void run(CommandSender sender, CommandArguments args) throws WrapperComma

if(maintenanceMode) {
sender.sendMessage(Main.get().getPrefix() + "Maintenance mode enabled.");
TeamUtils.sendToTeam(sender.getName(), null, "Enabled maintenance mode");
PlayerUtils.sendToTeam(sender.getName(), null, "Enabled maintenance mode");
for(Player player : Bukkit.getOnlinePlayers()) {
if(!isAllowed(player)) {
player.kickPlayer(maintenanceKickMessage);
}
}
} else {
sender.sendMessage(Main.get().getPrefix() + "Maintenance mode disabled.");
TeamUtils.sendToTeam(sender.getName(), null, "Disabled maintenance mode");
PlayerUtils.sendToTeam(sender.getName(), null, "Disabled maintenance mode");
}

}
Expand Down
Loading

0 comments on commit 3281e87

Please sign in to comment.