Add mod, remove loading plugin, bump version

Closes #5
This commit is contained in:
Shadowfacts 2017-02-15 19:21:37 -05:00
parent 8a06ed849e
commit 106c697b49
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
5 changed files with 16 additions and 100 deletions

View File

@ -1,4 +1,4 @@
mod_version = 1.2.0 mod_version = 1.3.0
group = net.shadowfacts group = net.shadowfacts
archivesBaseName = Forgelin archivesBaseName = Forgelin

View File

@ -1,37 +0,0 @@
package net.shadowfacts.forgelin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import java.util.Map;
/**
* @author shadowfacts
*/
public class ForgelinPlugin implements IFMLLoadingPlugin {
@Override
public String[] getASMTransformerClass() {
return new String[0];
}
@Override
public String getModContainerClass() {
return null;
}
@Override
public String getSetupClass() {
return "net.shadowfacts.forgelin.ForgelinSetup";
}
@Override
public void injectData(Map<String, Object> data) {
}
@Override
public String getAccessTransformerClass() {
return null;
}
}

View File

@ -1,27 +0,0 @@
package net.shadowfacts.forgelin;
import net.minecraftforge.fml.relauncher.IFMLCallHook;
import java.util.Map;
/**
* @author shadowfacts
*/
public class ForgelinSetup implements IFMLCallHook {
@Override
public void injectData(Map<String, Object> data) {
ClassLoader loader = (ClassLoader)data.get("classLoader");
try {
loader.loadClass("net.shadowfacts.forgelin.KotlinAdapter");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
@Override
public Void call() throws Exception {
return null;
}
}

View File

@ -0,0 +1,15 @@
package net.shadowfacts.forgelin
import net.minecraftforge.fml.common.Mod
/**
* @author shadowfacts
*/
@Mod(modid = Forgelin.MOD_ID, name = Forgelin.NAME, version = Forgelin.VERSION, acceptableRemoteVersions = "*", acceptedMinecraftVersions = "*", modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter")
object Forgelin {
const val MOD_ID = "forgelin"
const val NAME = "Forgelin"
const val VERSION = "1.3.0"
}

View File

@ -1,35 +0,0 @@
import net.minecraftforge.fml.common.FMLLog
import net.minecraftforge.fml.common.Mod
import net.minecraftforge.fml.common.SidedProxy
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
/**
* @author shadowfacts
*/
@Mod(modid = "test", modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter")
object Test {
@SidedProxy(clientSide = "ClientProxy", serverSide = "CommonProxy")
lateinit var proxy: CommonProxy
private set
@Mod.EventHandler
fun preInit(event: FMLPreInitializationEvent) {
FMLLog.bigWarning("Hello from Kotlin!")
proxy.someMethod()
}
}
open class CommonProxy {
open fun someMethod() {
FMLLog.bigWarning("CommonProxy.someMethod")
}
}
class ClientProxy: CommonProxy() {
override fun someMethod() {
super.someMethod()
FMLLog.bigWarning("ClientProxy.someMethod")
}
}