mirror of
https://github.com/Theaninova/new-frontiers.git
synced 2025-12-11 02:56:16 +00:00
Add test Block
This commit is contained in:
6
.idea/encodings.xml
generated
Normal file
6
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/gradle.properties" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
62
README.md
62
README.md
@@ -1,61 +1,3 @@
|
|||||||
# Minecraft Forge Kotlin Template
|
# Minecraft New Frontiers Mod
|
||||||
Minecraft 1.12.2 で Forge と Kotlin を用いた Mod のテンプレートです。
|
|
||||||
Minecraft 1.12.2 Mod template using Forge and Kotlin.
|
|
||||||
|
|
||||||
## Getting Started
|
This mod will make Minecraft to a true space exploration game.
|
||||||
### Clone template
|
|
||||||
Please click [Use this template](https://github.com/proudust/minecraft-forge-kotlin-template/generate)
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```sh
|
|
||||||
git clone --depth=1 https://github.com/proudust/minecraft-forge-kotlin-template <your_project_name>
|
|
||||||
cd <your_project_name>
|
|
||||||
rm -rf .git
|
|
||||||
```
|
|
||||||
|
|
||||||
### Install dependencies
|
|
||||||
```sh
|
|
||||||
./gradlew build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Fix properties
|
|
||||||
**gradle.properties**
|
|
||||||
```
|
|
||||||
modGroup=<your_package_name>
|
|
||||||
modVersion=<your_project_version>
|
|
||||||
modBaseName=<your_project_name>
|
|
||||||
```
|
|
||||||
|
|
||||||
**mcmod.info**
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"modid": "<your_package_name>",
|
|
||||||
"name": "<Your Project Name>",
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
**MinecraftForgeKotlinTemplate.kt**
|
|
||||||
```kt
|
|
||||||
package <your_package_name>.<your_project_name>
|
|
||||||
|
|
||||||
//...
|
|
||||||
|
|
||||||
object <YourProjectName> {
|
|
||||||
const val MOD_ID = <your_project_name>
|
|
||||||
const val MOD_NAME = <Your Project Name>
|
|
||||||
const val VERSION = <your_project_version>
|
|
||||||
|
|
||||||
//...
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
|
|
||||||
- [Minecraft Forge](https://files.minecraftforge.net/)
|
|
||||||
- [shadowfacts/Forgelin](https://github.com/shadowfacts/Forgelin)
|
|
||||||
|
|
||||||
## References
|
|
||||||
|
|
||||||
- [C6H2Cl2/MCDevNightSample](https://github.com/C6H2Cl2/MCDevNightSample)
|
|
||||||
- [therealfarfetchd/build.gradle.kts](https://gist.github.com/therealfarfetchd/db8fc601df89703a360bccc0395ec590)
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
modGroup=io.github.proudust
|
modGroup=de.wulkanat.www
|
||||||
modVersion=1.0-SNAPSHOT
|
modVersion=1.0-SNAPSHOT
|
||||||
modBaseName=minecraft-forge-kotlin-template
|
modBaseName=new-frontiers
|
||||||
forgeVersion=1.12.2-14.23.5.2768
|
forgeVersion=1.12.2-14.23.5.2768
|
||||||
mappingVersion=stable_39
|
mappingVersion=stable_39
|
||||||
|
|||||||
@@ -1,24 +1,28 @@
|
|||||||
package io.github.proudust.minecraftforgekotlintemplate
|
package de.wulkanat.www.newfrontiers
|
||||||
|
|
||||||
|
import de.wulkanat.www.newfrontiers.blocks.NFBlock
|
||||||
|
import de.wulkanat.www.newfrontiers.blocks.SpaceTeleporter
|
||||||
import net.minecraft.block.Block
|
import net.minecraft.block.Block
|
||||||
import net.minecraft.item.Item
|
import net.minecraft.item.Item
|
||||||
|
import net.minecraft.item.ItemBlock
|
||||||
import net.minecraftforge.event.RegistryEvent
|
import net.minecraftforge.event.RegistryEvent
|
||||||
import net.minecraftforge.fml.common.Mod
|
import net.minecraftforge.fml.common.Mod
|
||||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent
|
||||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent
|
||||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry
|
||||||
|
|
||||||
@Mod(
|
@Mod(
|
||||||
modid = MinecraftForgeKotlinTemplate.MOD_ID,
|
modid = NewFrontiers.MOD_ID,
|
||||||
name = MinecraftForgeKotlinTemplate.MOD_NAME,
|
name = NewFrontiers.MOD_NAME,
|
||||||
version = MinecraftForgeKotlinTemplate.VERSION,
|
version = NewFrontiers.VERSION,
|
||||||
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
|
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
|
||||||
)
|
)
|
||||||
object MinecraftForgeKotlinTemplate {
|
object NewFrontiers {
|
||||||
const val MOD_ID = "minecraft-forge-kotlin-template"
|
const val MOD_ID = "new-frontiers"
|
||||||
const val MOD_NAME = "Minecraft Forge Kotlin Template"
|
const val MOD_NAME = "New Frontiers"
|
||||||
const val VERSION = "2019.1-1.2.23"
|
const val VERSION = "1.0-SNAPSHOT"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the first initialization event. Register tile entities here.
|
* This is the first initialization event. Register tile entities here.
|
||||||
@@ -34,7 +38,6 @@ object MinecraftForgeKotlinTemplate {
|
|||||||
*/
|
*/
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
fun init(event: FMLInitializationEvent) {
|
fun init(event: FMLInitializationEvent) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -48,37 +51,35 @@ object MinecraftForgeKotlinTemplate {
|
|||||||
/**
|
/**
|
||||||
* This is a special class that listens to registry events, to allow creation of mod blocks and items at the proper time.
|
* This is a special class that listens to registry events, to allow creation of mod blocks and items at the proper time.
|
||||||
*/
|
*/
|
||||||
@Mod.EventBusSubscriber
|
@Mod.EventBusSubscriber(modid = MOD_ID)
|
||||||
object ObjectRegistryHandler {
|
object ObjectRegistryHandler {
|
||||||
|
private val blocks: Array<NFBlock> = arrayOf(
|
||||||
|
SpaceTeleporter(MOD_ID, "space_teleporter")
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen for the register event for creating custom items
|
* Listen for the register event for creating custom items
|
||||||
*/
|
*/
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
@JvmStatic
|
||||||
fun addItems(event: RegistryEvent.Register<Item>) {
|
fun addItems(event: RegistryEvent.Register<Item>) {
|
||||||
/*
|
for (block in blocks) {
|
||||||
event.registry.register(ItemBlock(MySpecialBlock).setRegistryName(MOD_ID, "myBlock"))
|
if (block.hasItemBlock) {
|
||||||
event.registry.register(MySpecialItem.setRegistryName(MOD_ID, "mySpecialItem"))
|
event.registry.register(ItemBlock(block).setRegistryName(block.registryName))
|
||||||
*/
|
}
|
||||||
|
}
|
||||||
|
// TODO: register items
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen for the register event for creating custom blocks
|
* Listen for the register event for creating custom blocks
|
||||||
*/
|
*/
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
@JvmStatic
|
||||||
fun addBlocks(event: RegistryEvent.Register<Block>) {
|
fun addBlocks(event: RegistryEvent.Register<Block>) {
|
||||||
/*
|
for (block in blocks) {
|
||||||
event.registry.register(MySpecialBlock.setRegistryName(MOD_ID, "mySpecialBlock"))
|
event.registry.register(block)
|
||||||
*/
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EXAMPLE ITEM AND BLOCK - you probably want these in separate files
|
|
||||||
object MySpecialItem : Item() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
object MySpecialBlock : Block() {
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package de.wulkanat.www.newfrontiers
|
||||||
|
|
||||||
|
object StaticValues {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package de.wulkanat.www.newfrontiers.blocks
|
||||||
|
|
||||||
|
import net.minecraft.block.Block
|
||||||
|
import net.minecraft.block.material.Material
|
||||||
|
|
||||||
|
abstract class NFBlock(material: Material) : Block(material) {
|
||||||
|
val hasItemBlock = true
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package de.wulkanat.www.newfrontiers.blocks
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material
|
||||||
|
import net.minecraft.creativetab.CreativeTabs
|
||||||
|
|
||||||
|
class SpaceTeleporter(modid: String, name: String) : NFBlock(Material.GROUND) {
|
||||||
|
init {
|
||||||
|
setHardness(1.5F)
|
||||||
|
setResistance(2.5F)
|
||||||
|
setRegistryName("$modid:$name")
|
||||||
|
creativeTab = CreativeTabs.BUILDING_BLOCKS
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"modid": "minecraft-forge-kotlin-template",
|
"modid": "new-frontiers",
|
||||||
"name": "Minecraft Forge Kotlin Template",
|
"name": "New Frontiers",
|
||||||
"description": "injection point type '%s'",
|
"description": "Make Minecraft a true Space Exploation Game",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
"mcversion": "${mcversion}",
|
"mcversion": "${mcversion}",
|
||||||
"url": "",
|
"url": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user