Browse Source

Fix

master
SeraphJACK 3 years ago
parent
commit
8083c2d281
Signed by: SeraphJACK <seraphjack@outlook.com> GPG Key ID: 14162B46567AB06F
2 changed files with 5 additions and 3 deletions
  1. +1
    -0
      .gitignore
  2. +4
    -3
      src/main/java/top/seraphjack/ofhcmc/CommandOfh.java

+ 1
- 0
.gitignore View File

@@ -1,3 +1,4 @@
.idea/
build/
.gradle/
run

+ 4
- 3
src/main/java/top/seraphjack/ofhcmc/CommandOfh.java View File

@@ -33,7 +33,7 @@ public class CommandOfh extends CommandBase {

@Override
public void processCommand(ICommandSender sender, String[] args) {
if (args.length <= 1) throw new CommandException("Invalid arguments");
if (args.length < 1) throw new CommandException("Invalid arguments");
ChunkPos chunkPos = new ChunkPos(sender.getPlayerCoordinates());
FieldPos pos = new FieldPos(chunkPos);
int dim = sender.getEntityWorld().getWorldInfo().getVanillaDimension();
@@ -90,7 +90,7 @@ public class CommandOfh extends CommandBase {
break;
}
case "search": {
if (args.length <= 2) throw new CommandException("Invalid arguments");
if (args.length < 2) throw new CommandException("Invalid arguments");
String fluid = args[1];
manager.getFields(dim).stream().filter(f -> f.fluid.equals(fluid)).forEach(f -> {
FieldPos p = new FieldPos(f);
@@ -100,9 +100,10 @@ public class CommandOfh extends CommandBase {
"Z between " + p.getMinBlockZ() + " and " + p.getMaxBlockZ() + ", " +
"min product is " + f.minProduct + " and max product is " + f.maxProduct + "."
)
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED))
.setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD))
);
});
break;
}
default: {
throw new CommandException("Invalid arguments");


Loading…
Cancel
Save