Repo Initialization
Some checks failed
Build and test / build-and-test (push) Has been cancelled

This commit is contained in:
Yui
2024-12-01 14:52:28 -03:00
commit 4d4c8d953c
23 changed files with 911 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
package com.myname.mymodid;
public class ClientProxy extends CommonProxy {
// Override CommonProxy methods here, if you want a different behaviour on the client (e.g. registering renders).
// Don't forget to call the super methods as well.
}

View File

@@ -0,0 +1,27 @@
package com.myname.mymodid;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
public class CommonProxy {
// preInit "Run before anything else. Read your config, create blocks, items, etc, and register them with the
// GameRegistry." (Remove if not needed)
public void preInit(FMLPreInitializationEvent event) {
Config.synchronizeConfiguration(event.getSuggestedConfigurationFile());
MyMod.LOG.info(Config.greeting);
MyMod.LOG.info("I am MyMod at version " + Tags.VERSION);
}
// load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed)
public void init(FMLInitializationEvent event) {}
// postInit "Handle interaction with other mods, complete your setup based on this." (Remove if not needed)
public void postInit(FMLPostInitializationEvent event) {}
// register server commands in this event handler (Remove if not needed)
public void serverStarting(FMLServerStartingEvent event) {}
}

View File

@@ -0,0 +1,20 @@
package com.myname.mymodid;
import java.io.File;
import net.minecraftforge.common.config.Configuration;
public class Config {
public static String greeting = "Hello World";
public static void synchronizeConfiguration(File configFile) {
Configuration configuration = new Configuration(configFile);
greeting = configuration.getString("greeting", Configuration.CATEGORY_GENERAL, greeting, "How shall I greet?");
if (configuration.hasChanged()) {
configuration.save();
}
}
}

View File

@@ -0,0 +1,46 @@
package com.myname.mymodid;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
@Mod(modid = MyMod.MODID, version = Tags.VERSION, name = "MyMod", acceptedMinecraftVersions = "[1.7.10]")
public class MyMod {
public static final String MODID = "mymodid";
public static final Logger LOG = LogManager.getLogger(MODID);
@SidedProxy(clientSide = "com.myname.mymodid.ClientProxy", serverSide = "com.myname.mymodid.CommonProxy")
public static CommonProxy proxy;
@Mod.EventHandler
// preInit "Run before anything else. Read your config, create blocks, items, etc, and register them with the
// GameRegistry." (Remove if not needed)
public void preInit(FMLPreInitializationEvent event) {
proxy.preInit(event);
}
@Mod.EventHandler
// load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed)
public void init(FMLInitializationEvent event) {
proxy.init(event);
}
@Mod.EventHandler
// postInit "Handle interaction with other mods, complete your setup based on this." (Remove if not needed)
public void postInit(FMLPostInitializationEvent event) {
proxy.postInit(event);
}
@Mod.EventHandler
// register server commands in this event handler (Remove if not needed)
public void serverStarting(FMLServerStartingEvent event) {
proxy.serverStarting(event);
}
}