Skip to content

Instantly share code, notes, and snippets.

View WesJD's full-sized avatar

Wesley Smith WesJD

View GitHub Profile
@WesJD
WesJD / Logging.java
Created March 12, 2016 02:29
Easy logging.
public class Logging {
private static final String PREFIX = "MyPrefix";
public static void logStatistic(String message) {
logWithExtra("Statistic", message);
}
public static void logDebug(String message) {
logWithExtra("Debug", message);
@WesJD
WesJD / Properties.java
Last active October 13, 2024 16:17
Simple class for changing Minecraft server properties easily.
public class Properties {
public static void savePropertiesFile() {
((DedicatedServer) MinecraftServer.getServer()).propertyManager.savePropertiesFile();
}
public static void setServerProperty(ServerProperty property, Object value) {
((DedicatedServer) MinecraftServer.getServer()).propertyManager.setProperty(property.getPropertyName(), value);
}
@WesJD
WesJD / MainThreadExecutor.java
Created December 30, 2015 23:25
Execute things on the main thread easily.
public abstract class MainThreadExecutor {
public MainThreadExecutor() {
MinecraftServer.getServer().processQueue.add(new Runnable() {
@Override
public void run() {
call();
}
});
}