diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/example/ExampleMod.java | 16 | ||||
-rw-r--r-- | src/main/kotlin/com/example/ExampleMod.kt | 25 | ||||
-rw-r--r-- | src/main/kotlin/com/example/mixin/MixinGuiMainMenu.java (renamed from src/main/java/com/example/mixin/MixinGuiMainMenu.java) | 0 | ||||
-rw-r--r-- | src/main/resources/assets/test/test.txt | 3 |
4 files changed, 28 insertions, 16 deletions
diff --git a/src/main/java/com/example/ExampleMod.java b/src/main/java/com/example/ExampleMod.java deleted file mode 100644 index 2ce1671..0000000 --- a/src/main/java/com/example/ExampleMod.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.example; - -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.init.Blocks; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; - -@Mod(modid = "examplemod", useMetadata=true) -public class ExampleMod { - @Mod.EventHandler - public void init(FMLInitializationEvent event) { - System.out.println("Dirt: " + Blocks.dirt.getUnlocalizedName()); - // Below is a demonstration of an access-transformed class access. - System.out.println("Color State: " + new GlStateManager.Color()); - } -} diff --git a/src/main/kotlin/com/example/ExampleMod.kt b/src/main/kotlin/com/example/ExampleMod.kt new file mode 100644 index 0000000..ad0feff --- /dev/null +++ b/src/main/kotlin/com/example/ExampleMod.kt @@ -0,0 +1,25 @@ +package com.example + +import net.minecraft.client.Minecraft +import net.minecraft.init.Blocks +import net.minecraftforge.fml.common.Mod +import net.minecraftforge.fml.common.event.FMLInitializationEvent +import net.minecraft.client.renderer.GlStateManager + +@Mod(modid = "examplemod", useMetadata = true) +class ExampleMod { + @Mod.EventHandler + fun init(event: FMLInitializationEvent) { + try { + val resource: net.minecraft.client.resources.IResource = Minecraft.getMinecraft().getResourceManager() + .getResource(net.minecraft.util.ResourceLocation("test:test.txt")) + org.apache.commons.io.IOUtils.copy(resource.getInputStream(), java.lang.System.out) + } catch (e: java.io.IOException) { + throw java.lang.RuntimeException(e) + } + + println("Dirt: ${Blocks.dirt.unlocalizedName}") + // Below is a demonstration of an access-transformed class access. + println("Color State: " + GlStateManager.Color()); + } +} diff --git a/src/main/java/com/example/mixin/MixinGuiMainMenu.java b/src/main/kotlin/com/example/mixin/MixinGuiMainMenu.java index 47eee87..47eee87 100644 --- a/src/main/java/com/example/mixin/MixinGuiMainMenu.java +++ b/src/main/kotlin/com/example/mixin/MixinGuiMainMenu.java diff --git a/src/main/resources/assets/test/test.txt b/src/main/resources/assets/test/test.txt new file mode 100644 index 0000000..ea839e2 --- /dev/null +++ b/src/main/resources/assets/test/test.txt @@ -0,0 +1,3 @@ +test +from resource pack + |