Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
de6ecdf7a8 | |||
cdd375a673 | |||
1cfaf32ee1 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,4 @@
|
|||||||
# User-specific stuff
|
# User-specific stuff
|
||||||
.idea/
|
|
||||||
.idea
|
|
||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
*.iws
|
*.iws
|
||||||
|
3
.idea/.gitignore
generated
vendored
Normal file
3
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
13
.idea/compiler.xml
generated
Normal file
13
.idea/compiler.xml
generated
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<module name="T2CodeLib" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="ASK" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
7
.idea/encodings.xml
generated
Normal file
7
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
3
.idea/icon.svg
generated
Normal file
3
.idea/icon.svg
generated
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 295 KiB |
55
.idea/jarRepositories.xml
generated
Normal file
55
.idea/jarRepositories.xml
generated
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Central Repository" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jitpack.io" />
|
||||||
|
<option name="name" value="jitpack.io" />
|
||||||
|
<option name="url" value="https://jitpack.io" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="T2Code" />
|
||||||
|
<option name="name" value="T2Code" />
|
||||||
|
<option name="url" value="https://repo.t2code.net/repository/T2Code/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="spigot-repo" />
|
||||||
|
<option name="name" value="spigot-repo" />
|
||||||
|
<option name="url" value="https://hub.spigotmc.org/nexus/content/repositories/snapshots/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="placeholderapi" />
|
||||||
|
<option name="name" value="placeholderapi" />
|
||||||
|
<option name="url" value="https://repo.extendedclip.com/content/repositories/placeholderapi/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="minecraft-repo" />
|
||||||
|
<option name="name" value="minecraft-repo" />
|
||||||
|
<option name="url" value="https://libraries.minecraft.net/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="bungeecord-repo" />
|
||||||
|
<option name="name" value="bungeecord-repo" />
|
||||||
|
<option name="url" value="https://oss.sonatype.org/content/repositories/snapshots" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="BenCodez Repo" />
|
||||||
|
<option name="name" value="BenCodez Repo" />
|
||||||
|
<option name="url" value="https://nexus.bencodez.com/repository/maven-public/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
18
.idea/misc.xml
generated
Normal file
18
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="EntryPointsManager">
|
||||||
|
<list size="2">
|
||||||
|
<item index="0" class="java.lang.String" itemvalue="net.md_5.bungee.event.EventHandler" />
|
||||||
|
<item index="1" class="java.lang.String" itemvalue="org.bukkit.event.EventHandler" />
|
||||||
|
</list>
|
||||||
|
</component>
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK" />
|
||||||
|
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/T2CodeLib.iml" filepath="$PROJECT_DIR$/T2CodeLib.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>15.7</version>
|
<version>15.8_dev</version>
|
||||||
<!--version>VERSION_snapshot-0</version-->
|
<!--version>VERSION_snapshot-0</version-->
|
||||||
<!--version>VERSION_beta-0</version-->
|
<!--version>VERSION_beta-0</version-->
|
||||||
<!--version>VERSION_dev-0</version-->
|
<!--version>VERSION_dev-0</version-->
|
||||||
|
@@ -21,6 +21,7 @@ public class T2CmcVersion {
|
|||||||
mc1_18 = nms.contains("1_18");
|
mc1_18 = nms.contains("1_18");
|
||||||
mc1_19 = nms.contains("1_19");
|
mc1_19 = nms.contains("1_19");
|
||||||
mc1_20 = nms.contains("1_20");
|
mc1_20 = nms.contains("1_20");
|
||||||
|
mc1_21 = nms.contains("1_21");
|
||||||
|
|
||||||
nms1_8_R1 = nms.contains("1_8_R1");
|
nms1_8_R1 = nms.contains("1_8_R1");
|
||||||
nms1_8_R2 = nms.contains("1_8_R2");
|
nms1_8_R2 = nms.contains("1_8_R2");
|
||||||
@@ -44,6 +45,7 @@ public class T2CmcVersion {
|
|||||||
nms1_19_R2 = nms.contains("1_19_R2");
|
nms1_19_R2 = nms.contains("1_19_R2");
|
||||||
nms1_20_R1 = nms.contains("1_20_R1");
|
nms1_20_R1 = nms.contains("1_20_R1");
|
||||||
nms1_20_R2 = nms.contains("1_20_R2");
|
nms1_20_R2 = nms.contains("1_20_R2");
|
||||||
|
nms1_21_R1 = nms.contains("1_21_R1");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String mcVersion;
|
private static String mcVersion;
|
||||||
@@ -61,6 +63,7 @@ public class T2CmcVersion {
|
|||||||
private static boolean mc1_18;
|
private static boolean mc1_18;
|
||||||
private static boolean mc1_19;
|
private static boolean mc1_19;
|
||||||
private static boolean mc1_20;
|
private static boolean mc1_20;
|
||||||
|
private static boolean mc1_21;
|
||||||
|
|
||||||
private static String nms;
|
private static String nms;
|
||||||
private static boolean nms1_8_R1;
|
private static boolean nms1_8_R1;
|
||||||
@@ -85,6 +88,7 @@ public class T2CmcVersion {
|
|||||||
private static boolean nms1_19_R2;
|
private static boolean nms1_19_R2;
|
||||||
private static boolean nms1_20_R1;
|
private static boolean nms1_20_R1;
|
||||||
private static boolean nms1_20_R2;
|
private static boolean nms1_20_R2;
|
||||||
|
private static boolean nms1_21_R1;
|
||||||
|
|
||||||
public static String getMcVersion() {
|
public static String getMcVersion() {
|
||||||
return mcVersion;
|
return mcVersion;
|
||||||
@@ -145,6 +149,9 @@ public class T2CmcVersion {
|
|||||||
public static boolean isMc1_20() {
|
public static boolean isMc1_20() {
|
||||||
return mc1_20;
|
return mc1_20;
|
||||||
}
|
}
|
||||||
|
public static boolean isMc1_21() {
|
||||||
|
return mc1_21;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getNms() {
|
public static String getNms() {
|
||||||
return nms;
|
return nms;
|
||||||
@@ -237,6 +244,9 @@ public class T2CmcVersion {
|
|||||||
public static boolean isNms1_20_R2() {
|
public static boolean isNms1_20_R2() {
|
||||||
return nms1_20_R2;
|
return nms1_20_R2;
|
||||||
}
|
}
|
||||||
|
public static boolean isNms1_21_R1() {
|
||||||
|
return nms1_21_R1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static boolean minMc1_8() {
|
public static boolean minMc1_8() {
|
||||||
|
@@ -65,7 +65,20 @@ public final class T2CodeLibMain extends JavaPlugin {
|
|||||||
if (T2CmcVersion.isNms1_20_R2()) {
|
if (T2CmcVersion.isNms1_20_R2()) {
|
||||||
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||||
T2Csend.console(prefix);
|
T2Csend.console(prefix);
|
||||||
T2Csend.warning(plugin, "The 1.20.* (R2) is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
T2Csend.warning(plugin, "The 1.20.* (NMS R2) is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
||||||
|
T2Csend.console(prefix);
|
||||||
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||||
|
if (!SelectLibConfig.getT2cTestDevelopment()) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(5000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}if (T2CmcVersion.isMc1_21()) {
|
||||||
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||||
|
T2Csend.console(prefix);
|
||||||
|
T2Csend.warning(plugin, "The 1.21 is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
||||||
T2Csend.console(prefix);
|
T2Csend.console(prefix);
|
||||||
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||||
if (!SelectLibConfig.getT2cTestDevelopment()) {
|
if (!SelectLibConfig.getT2cTestDevelopment()) {
|
||||||
|
@@ -45,6 +45,13 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
}
|
}
|
||||||
Commands.info(sender);
|
Commands.info(sender);
|
||||||
return false;
|
return false;
|
||||||
|
case "permtoggle":
|
||||||
|
if (!sender.hasPermission("t2code.permtoggle.use")) {
|
||||||
|
T2Csend.sender(sender, "§4No Permission §8t2code.permtoggle.use");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Commands.permtoggle(sender, args);
|
||||||
|
return false;
|
||||||
case "updateinfo":
|
case "updateinfo":
|
||||||
if (!sender.hasPermission("t2code.admin")) {
|
if (!sender.hasPermission("t2code.admin")) {
|
||||||
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
||||||
@@ -52,13 +59,13 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
|||||||
}
|
}
|
||||||
Commands.updateInfo(sender, args);
|
Commands.updateInfo(sender, args);
|
||||||
return false;
|
return false;
|
||||||
// case "plugininfo": todo
|
// case "plugininfo": todo
|
||||||
// if (!sender.hasPermission("t2code.admin")) {
|
// if (!sender.hasPermission("t2code.admin")) {
|
||||||
// T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
// T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
||||||
// return false;
|
// return false;
|
||||||
// }
|
// }
|
||||||
// Commands.updateInfo(sender, args);
|
// Commands.updateInfo(sender, args);
|
||||||
// return false;
|
// return false;
|
||||||
case "reloadconfig":
|
case "reloadconfig":
|
||||||
if (!sender.hasPermission("t2code.admin")) {
|
if (!sender.hasPermission("t2code.admin")) {
|
||||||
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
T2Csend.sender(sender, "§4No Permission §8t2code.admin");
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
package net.t2code.t2codelib.SPIGOT.system.cmd;
|
package net.t2code.t2codelib.SPIGOT.system.cmd;
|
||||||
|
|
||||||
|
import net.t2code.t2codelib.SPIGOT.api.commands.T2Ccmd;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||||
|
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||||
import net.t2code.t2codelib.Util;
|
import net.t2code.t2codelib.Util;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
@@ -83,4 +85,23 @@ public class Commands {
|
|||||||
protected static void updateInfo(CommandSender sender, String[] args) {
|
protected static void updateInfo(CommandSender sender, String[] args) {
|
||||||
T2Csend.sender(sender, T2CupdateAPI.updateInfo(args, sender instanceof Player));
|
T2Csend.sender(sender, T2CupdateAPI.updateInfo(args, sender instanceof Player));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void permtoggle(CommandSender sender, String[] args) {
|
||||||
|
Player player = (Player) Bukkit.getOfflinePlayer(args[1]);
|
||||||
|
if (player == null) {
|
||||||
|
T2Csend.sender(sender, "§4Player §6" + args[1] + " §4not exist!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String permission = args[2];
|
||||||
|
|
||||||
|
if (player.hasPermission(permission)) {
|
||||||
|
T2Ccmd.console(SelectLibConfig.getCommandPermToggleCommand().replace("[player]",player.getName()).replace("[perm]",permission).replace("[value]", "false"));
|
||||||
|
T2Csend.sender(sender, "§2Permission §8'§6" + permission + "§8' §2was set to §6false §2for the player §6" + player.getName() + "§2.");
|
||||||
|
} else {
|
||||||
|
T2Ccmd.console(SelectLibConfig.getCommandPermToggleCommand().replace("[player]",player.getName()).replace("[perm]",permission).replace("[value]", "true"));
|
||||||
|
T2Csend.sender(sender, "§2Permission §8'§6" + permission + "§8' §2was set to §6true §2for the player §6" + player.getName() + "§2.");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,8 @@ public class ConfigCreate {
|
|||||||
T2Cconfig.set("BungeeCord.Enable", T2CodeLibMain.getIsBungee(), yamlConfiguration);
|
T2Cconfig.set("BungeeCord.Enable", T2CodeLibMain.getIsBungee(), yamlConfiguration);
|
||||||
T2Cconfig.set("Player.Inventories.CloseByServerStop", true, yamlConfiguration);
|
T2Cconfig.set("Player.Inventories.CloseByServerStop", true, yamlConfiguration);
|
||||||
|
|
||||||
|
T2Cconfig.set("Command.PermToggle.PermissionSetCommand","lp user [player] permission set [perm] [value]",yamlConfiguration);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfiguration.save(config);
|
yamlConfiguration.save(config);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@@ -28,6 +28,8 @@ public class SelectLibConfig {
|
|||||||
private static Boolean bungee;
|
private static Boolean bungee;
|
||||||
@Getter
|
@Getter
|
||||||
private static Boolean inventoriesCloseByServerStop;
|
private static Boolean inventoriesCloseByServerStop;
|
||||||
|
@Getter
|
||||||
|
private static String commandPermToggleCommand;
|
||||||
|
|
||||||
public static void onSelect() {
|
public static void onSelect() {
|
||||||
File config = new File(T2CodeLibMain.getPath(), "config.yml");
|
File config = new File(T2CodeLibMain.getPath(), "config.yml");
|
||||||
@@ -46,5 +48,6 @@ public class SelectLibConfig {
|
|||||||
developerTool = yamlConfiguration.getBoolean("Plugin.Not recommended to disable.developerTool");
|
developerTool = yamlConfiguration.getBoolean("Plugin.Not recommended to disable.developerTool");
|
||||||
bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
||||||
inventoriesCloseByServerStop = yamlConfiguration.getBoolean("Player.Inventories.CloseByServerStop");
|
inventoriesCloseByServerStop = yamlConfiguration.getBoolean("Player.Inventories.CloseByServerStop");
|
||||||
|
commandPermToggleCommand = yamlConfiguration.getString("Command.PermToggle.PermissionSetCommand");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,3 +29,7 @@ commands:
|
|||||||
permissions:
|
permissions:
|
||||||
t2code.admin:
|
t2code.admin:
|
||||||
default: op
|
default: op
|
||||||
|
children:
|
||||||
|
t2code.permtoggle.use: true
|
||||||
|
t2code.permtoggle.use:
|
||||||
|
default: op
|
||||||
|
Reference in New Issue
Block a user