parent
8a06ed849e
commit
106c697b49
|
@ -1,4 +1,4 @@
|
|||
mod_version = 1.2.0
|
||||
mod_version = 1.3.0
|
||||
group = net.shadowfacts
|
||||
archivesBaseName = Forgelin
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -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"
|
||||
|
||||
}
|
|
@ -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")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue