Skip to content

Commit

Permalink
Add empty documenting comments
Browse files Browse the repository at this point in the history
  • Loading branch information
OldSerpskiStalker committed Sep 17, 2024
1 parent 6daafcd commit 4f17fbb
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public class DynamicSpawnControl
*/
public static File getGlobalPathToConfigs()
{
//
return globalDirectory;
}

Expand All @@ -100,7 +101,7 @@ public static File getGlobalPathToConfigs()
*/
public DynamicSpawnControl()
{
/* */
//
Instance = this;
}

Expand All @@ -112,19 +113,20 @@ public DynamicSpawnControl()
@EventHandler
public synchronized void preInit(FMLPreInitializationEvent event)
{
/* */
//
checkDebugger = new CheckDebugger();

/* */
//
globalDirectory = event.getModConfigurationDirectory();

/* */
//
Log.createLogFile(globalDirectory.getPath() + File.separator + NAME_DIRECTORY);
Log.writeDataToLogFile(Log.TypeLog[0], "Check debugger -> " + checkDebugger.IsRunDebugger);

/* */
//
EventGameplayManager.registerClasses();

//
Proxy.preInit(event);
}

Expand All @@ -136,6 +138,7 @@ public synchronized void preInit(FMLPreInitializationEvent event)
@EventHandler
public synchronized void init(FMLInitializationEvent event)
{
//
Proxy.init(event);
}

Expand All @@ -147,6 +150,7 @@ public synchronized void init(FMLInitializationEvent event)
@EventHandler
public synchronized void postInit(FMLPostInitializationEvent event)
{
//
Proxy.postInit(event);
}

Expand Down Expand Up @@ -178,6 +182,7 @@ public synchronized void serverLoad(FMLServerStartingEvent event)
@EventHandler
public synchronized void serverStopped(FMLServerStoppedEvent event)
{
//
Log.closeExecutor();
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
package org.imesense.dynamicspawncontrol.debug;

/**
*
*/
public final class CheckDebugger
{
/**
*
*/
public boolean IsRunDebugger;

/**
*
*/
private static CheckDebugger instance = null;

/**
*
*/
public CheckDebugger()
{
instance = this;
IsRunDebugger = run();
}

/**
*
* @return
*/
public static CheckDebugger getInstance()
{
return instance;
}

/**
*
* @return
*/
private boolean run()
{
return (System.getProperty("java.class.path").toLowerCase().contains("idea_rt.jar"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package org.imesense.dynamicspawncontrol.debug;

/**
*
*/
public interface IDebug
{

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package org.imesense.dynamicspawncontrol.debug.events;

/**
*
*/
public final class OnEventDummy
{
/**
*
*/
public OnEventDummy()
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,30 @@
import org.imesense.dynamicspawncontrol.gameplay.events.OnUpdateTorchLogic;
import org.imesense.dynamicspawncontrol.technical.customlibrary.Log;

/**
*
*/
public final class EventGameplayManager
{
/**
*
*/
private static final Class<?>[] EVENT_CLASSES =
{
OnUpdateTorchLogic.class
};

/**
*
*/
public EventGameplayManager()
{

}

/**
*
*/
public static void registerClasses()
{
for (Class<?> eventClass : EVENT_CLASSES)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@

import net.minecraftforge.fml.common.event.FMLServerStartingEvent;

/**
*
*/
public final class RegisterCommands
{
/**
*
*/
public RegisterCommands()
{

}

/**
*
* @param event
*/
public void registerGameCommands(FMLServerStartingEvent event)
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,24 @@
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.imesense.dynamicspawncontrol.technical.customlibrary.Log;

/**
*
*/
public final class OnUpdateTorchLogic
{
/**
*
* @param nameClass
*/
public OnUpdateTorchLogic(final String nameClass)
{
Log.writeDataToLogFile(Log.TypeLog[0], nameClass);
}

/**
*
* @param event
*/
@SubscribeEvent
public synchronized void onHit(LivingHurtEvent event)
{
Expand Down Expand Up @@ -63,6 +74,10 @@ else if (entityGetTrueSource instanceof EntitySkeleton)
}
}

/**
*
* @param event
*/
@SubscribeEvent
public synchronized void onBreak(BlockEvent.BreakEvent event)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@
import java.util.ArrayList;
import java.util.List;

/**
*
*/
public class ConfigManager
{
/**
*
*/
private static final List<IConfig> settingList = new ArrayList<>();

/**
*
*/
static
{
settingList.add(new SettingsLogFile());
}

/**
*
* @param event
*/
public static void init(FMLPreInitializationEvent event)
{
for (IConfig config : settingList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

/**
*
*/
public interface IConfig
{
/**
*
* @param event
* @param nameClass
*/
void init(FMLPreInitializationEvent event, String nameClass);

/**
*
* @param configuration
*/
void readProperties(Configuration configuration);

/**
*
*/
void read();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@

import java.io.File;

/**
*
*/
public final class SettingsLogFile implements IConfig
{
/**
*
*/
public static int LogMaxLines = 32767;

/**
*
* @param event
* @param nameClass
*/
@Override
public void init(FMLPreInitializationEvent event, String nameClass)
{
Expand All @@ -23,6 +34,10 @@ public void init(FMLPreInitializationEvent event, String nameClass)
read();
}

/**
*
* @param configuration
*/
@Override
public void readProperties(Configuration configuration)
{
Expand All @@ -32,6 +47,9 @@ public void readProperties(Configuration configuration)
"The parameter is responsible for the maximum number of lines in the log");
}

/**
*
*/
@Override
public void read()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,30 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
*
*/
public final class Log
{
/**
*
*/
private static File logFile;

/**
*
*/
public static final String[] TypeLog = { "[INFO]: ", "[WARN]: ", "[ERROR]: " };

/**
*
*/
private static final ExecutorService executor = Executors.newSingleThreadExecutor();

/**
*
* @param path
*/
public static void createLogFile(String path)
{
try
Expand Down Expand Up @@ -61,6 +77,11 @@ public static void createLogFile(String path)
}
}

/**
*
* @param file
* @param maxLines
*/
private static void cleanFile(File file, int maxLines)
{
try
Expand Down Expand Up @@ -112,6 +133,11 @@ private static void cleanFile(File file, int maxLines)
}
}

/**
*
* @param typeInfo
* @param data
*/
public static void writeDataToLogFile(@Nonnull String typeInfo, String data)
{
if (logFile != null)
Expand Down Expand Up @@ -140,6 +166,9 @@ public static void writeDataToLogFile(@Nonnull String typeInfo, String data)
}
}

/**
*
*/
public static void closeExecutor()
{
executor.shutdown();
Expand Down

0 comments on commit 4f17fbb

Please sign in to comment.