Skip to content

Commit 3d66f51

Browse files
committed
registred new command and fixed some small type also move the global to mods
1 parent 62f2df9 commit 3d66f51

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/main/java/redart15/commandly/CommandlyConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public static void init() {
4141
LOGGER.info("Commandly Config initialized.");
4242
}
4343
} catch (IOException e) {
44-
LOGGER.error("Commandly Config failed, deleted the config and try again.");
44+
LOGGER.error("Commandly Config failed to generate, deleted the config and try again.");
4545
throw new RuntimeException(e);
4646
}
4747
}

src/main/java/redart15/commandly/CommandlyMod.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
public class CommandlyMod implements ModInitializer, RecipeEntrypoint, GameStartEntrypoint{
1313
public static final String MOD_ID = "commandly";
1414
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
15+
public static final int MASK = 7;
1516
public static GameRuleBoolean MOSS_SPREADING = GameRules.register(new GameRuleBoolean("doMossSpreading", true));
1617
public static GameRuleBoolean GRASS_SPREADING = GameRules.register(new GameRuleBoolean("doGrassSpreading", true));
1718
public static GameRuleBoolean VEIN_MINING = GameRules.register(new GameRuleBoolean("veinmining", false));

src/main/java/redart15/commandly/command/CommandlyCommands.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,24 @@
66

77
public class CommandlyCommands {
88

9+
public enum ReturnValues{
10+
FAIL(0),
11+
OK(1),
12+
CANNOT(2);
13+
private final int code;
14+
ReturnValues(int code){this.code = code;}
15+
public static int code(ReturnValues v){return v.code;}
16+
}
917

1018
@Environment(EnvType.CLIENT)
1119
public static void registerClientCommands() {
1220
CommandManager.registerCommand(new CommandGrow());
21+
CommandManager.registerCommand(new CommandProtect());
1322
}
1423

1524
@Environment(EnvType.SERVER)
1625
public static void registerServerCommands() {
1726
CommandManager.registerServerCommand(new CommandGrow());
27+
CommandManager.registerServerCommand(new CommandProtect());
1828
}
19-
2029
}

0 commit comments

Comments
 (0)