Skip to content

Commit d2b41e3

Browse files
committed
small fixes to commands, multi group, crafting block recipe
1 parent 192b6a1 commit d2b41e3

6 files changed

Lines changed: 9 additions & 12 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>io.github.mooy1</groupId>
88
<artifactId>InfinityLib</artifactId>
9-
<version>1.3.2</version>
9+
<version>1.3.3</version>
1010

1111
<properties>
1212
<maven.compiler.source>1.8</maven.compiler.source>

src/main/java/io/github/mooy1/infinitylib/commands/AddonCommand.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
public final class AddonCommand extends ParentCommand implements TabExecutor, Listener {
3131

3232
private final String help;
33-
private final String slashHelp;
3433

3534
public AddonCommand(String command) {
3635
this(Objects.requireNonNull(AbstractAddon.instance().getCommand(command),
@@ -46,25 +45,22 @@ public AddonCommand(PluginCommand command) {
4645
Events.registerListener(this);
4746

4847
help = "help" + command.getName();
49-
slashHelp = "/" + help;
5048

5149
addSub(new InfoCommand(AbstractAddon.instance()));
5250
addSub(new AliasesCommand(command));
5351
}
5452

55-
// TODO test
5653
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
5754
private void onServerCommand(ServerCommandEvent e) {
5855
if (e.getCommand().toLowerCase(Locale.ROOT).startsWith(help)) {
5956
e.setCommand(name());
6057
}
6158
}
6259

63-
// TODO test
6460
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
6561
private void onPlayerCommand(PlayerCommandPreprocessEvent e) {
66-
if (e.getMessage().toLowerCase(Locale.ROOT).startsWith(slashHelp)) {
67-
e.setMessage("/" + name());
62+
if (e.getMessage().toLowerCase(Locale.ROOT).startsWith(help)) {
63+
e.setMessage(name());
6864
}
6965
}
7066

src/main/java/io/github/mooy1/infinitylib/commands/AliasesCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ final class AliasesCommand extends SubCommand {
1414

1515
AliasesCommand(PluginCommand command) {
1616
super("aliases", "lists the available aliases for this command");
17-
message = "Aliases for /" + command.getName() + command.getAliases();
17+
message = "Aliases for /" + command.getName() + ": " + command.getAliases();
1818
}
1919

2020
@Override

src/main/java/io/github/mooy1/infinitylib/commands/HelpCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import org.bukkit.ChatColor;
88
import org.bukkit.command.CommandSender;
99

10+
import io.github.thebusybiscuit.slimefun4.libraries.dough.common.ChatColors;
11+
1012
@ParametersAreNonnullByDefault
1113
final class HelpCommand extends SubCommand {
1214

@@ -20,7 +22,7 @@ final class HelpCommand extends SubCommand {
2022
@Override
2123
public void execute(CommandSender sender, String[] args) {
2224
sender.sendMessage("");
23-
sender.sendMessage("&7----------&b /" + command.fullName() + " Help &7----------");
25+
sender.sendMessage(ChatColors.color("&7----------&b /" + command.fullName() + " Help &7----------"));
2426
sender.sendMessage("");
2527
for (SubCommand sub : command.available(sender)) {
2628
sender.sendMessage("/" + sub.fullName() + ChatColor.YELLOW + " - " + sub.description());

src/main/java/io/github/mooy1/infinitylib/groups/MultiGroup.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
*
2929
* @author Mooy1
3030
*/
31-
// TODO check if it works in cheat mode
3231
@ParametersAreNonnullByDefault
3332
public final class MultiGroup extends FlexItemGroup {
3433

@@ -48,7 +47,7 @@ public MultiGroup(String key, ItemStack item, int tier, ItemGroup... subGroups)
4847

4948
@Override
5049
public boolean isVisible(Player p, PlayerProfile profile, SlimefunGuideMode mode) {
51-
return true;
50+
return mode == SlimefunGuideMode.SURVIVAL_MODE;
5251
}
5352

5453
@Override

src/main/java/io/github/mooy1/infinitylib/machines/CraftingBlockRecipe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public final class CraftingBlockRecipe {
2424

2525
boolean check(ItemStackSnapshot[] input) {
2626
for (int i = 0; i < inputs.length; i++) {
27-
if (!SlimefunUtils.isItemSimilar(input[i], inputs[i], true, true)) {
27+
if (!SlimefunUtils.isItemSimilar(input[i], inputs[i], false, true)) {
2828
return false;
2929
}
3030
}

0 commit comments

Comments
 (0)