Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

Commit 4598492

Browse files
committed
Initial commit
0 parents  commit 4598492

File tree

7 files changed

+164
-0
lines changed

7 files changed

+164
-0
lines changed

Writerside/c.list

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE categories
3+
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
4+
<categories>
5+
<category id="wrs" name="Writerside documentation" order="1"/>
6+
</categories>

Writerside/cfg/buildprofiles.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
5+
<variables></variables>
6+
<build-profile instance="hi">
7+
<variables>
8+
<noindex-content>true</noindex-content>
9+
</variables>
10+
</build-profile>
11+
12+
</buildprofiles>

Writerside/litecommands.tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE instance-profile
3+
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">
4+
5+
<instance-profile id="litecommands"
6+
name="LiteCommands"
7+
start-page="Why-use-LiteCommands.md">
8+
9+
<toc-element topic="Why-use-LiteCommands.md"/>
10+
</instance-profile>

Writerside/redirection-rules.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE rules SYSTEM "https://resources.jetbrains.com/writerside/1.0/redirection-rules.dtd">
3+
<rules>
4+
<!-- format is as follows
5+
<rule id="<unique id>">
6+
<accepts>page.html</accepts>
7+
</rule>
8+
-->
9+
<rule id="38ff21a5">
10+
<description>Created after removal of "Why use LiteCommands?" from Help Instance</description>
11+
<accepts>Why-use-LiteCommands.html</accepts>
12+
</rule>
13+
<rule id="8edb26f">
14+
<description>Created after removal of "This is the first topic" from Help Instance</description>
15+
<accepts>Default-topic.html</accepts>
16+
</rule>
17+
</rules>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Why use LiteCommands?
2+
3+
LiteCommands is a versatile and feature-rich command framework designed to simplify
4+
command handling for a wide range of platforms and implementations. Whether you're
5+
developing for Velocity, Bukkit, Paper, BungeeCord, Minestom, JDA, or other systems,
6+
LiteCommands has got you covered.
7+
8+
## Easy Integration
9+
LiteCommands seamlessly integrates with various platforms, making it effortless to manage
10+
commands across different systems. Whether you're building a plugin or a mod,
11+
LiteCommands ensures a consistent and convenient command experience.
12+
13+
## More Clear Logic
14+
LiteCommands offers a more intuitive and clear approach to handling commands when
15+
compared to the traditional Bukkit method.
16+
17+
For example if you want to create a command that toggles chat, you would have to do something like this:
18+
19+
```java
20+
@Command(name = "chat")
21+
@Permission("command.chat")
22+
public class ChatCommand {
23+
24+
private final ChatManager chatManager = new ChatManager();
25+
26+
@Execute(name = "on")
27+
void enableChat(@Context CommandSender sender) {
28+
this.chatManager.enableChat();
29+
}
30+
31+
@Execute(name = "off")
32+
void disableChat(@Context CommandSender sender) {
33+
this.chatManager.disableChat();
34+
}
35+
36+
@Execute(name = "clear")
37+
@Permission("command.chat.clear")
38+
void clearChat(@Context CommandSender sender, @Arg int lines) {
39+
this.chatManager.clearChat(lines);
40+
}
41+
42+
}
43+
```
44+
45+
Compared to the Bukkit way:
46+
47+
```Java
48+
public class BukkitWayCommand implements CommandExecutor {
49+
50+
private final ChatManager chatManager = new ChatManager();
51+
52+
@Override
53+
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
54+
if (!sender.hasPermission("command.chat")) {
55+
sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
56+
return true;
57+
}
58+
59+
if (args.length == 0) {
60+
this.usage(sender);
61+
return true;
62+
}
63+
64+
if (args[0].equalsIgnoreCase("on")) {
65+
this.chatManager.enableChat();
66+
return true;
67+
}
68+
69+
if (args[0].equalsIgnoreCase("off")) {
70+
this.chatManager.disableChat();
71+
return true;
72+
}
73+
74+
if (args.length == 2 && args[0].equalsIgnoreCase("clear")) {
75+
if (!sender.hasPermission("command.chat.clear")) {
76+
sender.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
77+
return true;
78+
}
79+
80+
try {
81+
int lines = Integer.parseInt(args[1]);
82+
this.chatManager.clearChat(lines);
83+
} catch (NumberFormatException exeption) {
84+
sender.sendMessage(ChatColor.RED + "Invalid argument: " + args[1] + " is not a number.");
85+
}
86+
87+
return true;
88+
}
89+
90+
this.usage(sender);
91+
return true;
92+
}
93+
94+
private void usage(CommandSender sender) {
95+
sender.sendMessage(ChatColor.RED + "Usage:");
96+
sender.sendMessage(ChatColor.RED + " - /chat on");
97+
sender.sendMessage(ChatColor.RED + " - /chat off");
98+
sender.sendMessage(ChatColor.RED + " - /chat clear <lines>");
99+
}
100+
101+
}
102+
```
103+
104+

Writerside/v.list

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE vars SYSTEM "https://resources.jetbrains.com/writerside/1.0/vars.dtd">
3+
<vars>
4+
<var name="product" value="Writerside"/>
5+
</vars>

Writerside/writerside.cfg

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE ihp SYSTEM "https://resources.jetbrains.com/writerside/1.0/ihp.dtd">
3+
4+
<ihp version="2.0">
5+
<topics dir="topics" web-path="topics"/>
6+
<images dir="images" web-path="images"/>
7+
<categories src="c.list"/>
8+
<vars src="v.list"/>
9+
<instance src="litecommands.tree"/>
10+
</ihp>

0 commit comments

Comments
 (0)