-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reflection to initialize console commands, other amendments
- Loading branch information
1 parent
4f17fbb
commit 1daf7b8
Showing
9 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...12.2/src/main/java/org/imesense/dynamicspawncontrol/gameplay/RegisterCommandsManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.imesense.dynamicspawncontrol.gameplay; | ||
|
||
import net.minecraft.command.ICommand; | ||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent; | ||
import org.imesense.dynamicspawncontrol.technical.customlibrary.Log; | ||
|
||
/** | ||
* | ||
*/ | ||
public class RegisterCommandsManager | ||
{ | ||
/** | ||
* | ||
*/ | ||
private static final Class<?>[] COMMAND_CLASSES = | ||
{ | ||
|
||
}; | ||
|
||
/** | ||
* | ||
* @param nameClass | ||
*/ | ||
public RegisterCommandsManager(final String nameClass) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* | ||
* @param event | ||
*/ | ||
public static void registerCommands(FMLServerStartingEvent event) | ||
{ | ||
for (Class<?> cmdClass : COMMAND_CLASSES) | ||
{ | ||
try | ||
{ | ||
Object commandInstance = cmdClass.getConstructor(String.class).newInstance(cmdClass.getSimpleName()); | ||
event.registerServerCommand((ICommand)commandInstance); | ||
} | ||
catch (Exception exception) | ||
{ | ||
Log.writeDataToLogFile(Log.TypeLog[2], "Exception in class: " + cmdClass.getName() + " - " + exception.getMessage()); | ||
} | ||
} | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
....2/src/main/java/org/imesense/dynamicspawncontrol/gameplay/commands/RegisterCommands.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters