mirror of
https://github.com/Theaninova/new-frontiers.git
synced 2025-12-12 11:36:16 +00:00
Add test Content
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers
|
||||||
|
|
||||||
|
import net.minecraft.creativetab.CreativeTabs
|
||||||
|
import net.minecraft.init.Blocks
|
||||||
|
import net.minecraft.item.Item
|
||||||
|
import net.minecraft.item.ItemStack
|
||||||
|
import net.minecraftforge.fml.relauncher.Side
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly
|
||||||
|
|
||||||
|
class NFCreativeTabs : CreativeTabs("new_frontiers") {
|
||||||
|
override fun getTabLabel(): String {
|
||||||
|
return "new_frontiers"
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
override fun createIcon(): ItemStack {
|
||||||
|
return ItemStack(Item.getItemFromBlock(NewFrontiers.ObjectRegistryHandler.blocks[0]))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,20 @@
|
|||||||
package de.wulkanat.www.newfrontiers
|
package de.wulkanat.www.new_frontiers
|
||||||
|
|
||||||
import de.wulkanat.www.newfrontiers.blocks.NFBlock
|
import de.wulkanat.www.new_frontiers.blocks.FTLDrive
|
||||||
import de.wulkanat.www.newfrontiers.blocks.SpaceTeleporter
|
import de.wulkanat.www.new_frontiers.blocks.NFBlock
|
||||||
|
import de.wulkanat.www.new_frontiers.blocks.SpaceTeleporter
|
||||||
|
import de.wulkanat.www.new_frontiers.dimensions.Space
|
||||||
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.minecraft.item.ItemBlock
|
||||||
|
import net.minecraft.world.DimensionType
|
||||||
|
import net.minecraftforge.common.DimensionManager
|
||||||
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 = NewFrontiers.MOD_ID,
|
modid = NewFrontiers.MOD_ID,
|
||||||
@@ -20,17 +23,20 @@ import net.minecraftforge.fml.common.registry.GameRegistry
|
|||||||
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
|
modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter"
|
||||||
)
|
)
|
||||||
object NewFrontiers {
|
object NewFrontiers {
|
||||||
const val MOD_ID = "new-frontiers"
|
const val MOD_ID = "new_frontiers"
|
||||||
const val MOD_NAME = "New Frontiers"
|
const val MOD_NAME = "New Frontiers"
|
||||||
const val VERSION = "1.0-SNAPSHOT"
|
const val VERSION = "1.0-SNAPSHOT"
|
||||||
|
|
||||||
|
val NF_CREATIVE_TAB = NFCreativeTabs()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the first initialization event. Register tile entities here.
|
* This is the first initialization event. Register tile entities here.
|
||||||
* The registry events below will have fired prior to entry to this method.
|
* The registry events below will have fired prior to entry to this method.
|
||||||
*/
|
*/
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
fun preinit(event: FMLPreInitializationEvent) {
|
fun preinit(event: FMLPreInitializationEvent) {
|
||||||
|
val a = DimensionType.register("Space", "_space", 2, Space::class.java, false)
|
||||||
|
DimensionManager.registerDimension(2, a)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,8 +59,9 @@ object NewFrontiers {
|
|||||||
*/
|
*/
|
||||||
@Mod.EventBusSubscriber(modid = MOD_ID)
|
@Mod.EventBusSubscriber(modid = MOD_ID)
|
||||||
object ObjectRegistryHandler {
|
object ObjectRegistryHandler {
|
||||||
private val blocks: Array<NFBlock> = arrayOf(
|
val blocks: Array<NFBlock> = arrayOf(
|
||||||
SpaceTeleporter(MOD_ID, "space_teleporter")
|
SpaceTeleporter(),
|
||||||
|
FTLDrive()
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers
|
||||||
|
|
||||||
|
object StaticValues {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers.biomes
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers.blocks
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material
|
||||||
|
|
||||||
|
class FTLDrive : NFBlock(
|
||||||
|
material = Material.ANVIL,
|
||||||
|
name = "ftl_drive"
|
||||||
|
)
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers.blocks
|
||||||
|
|
||||||
|
import de.wulkanat.www.new_frontiers.NewFrontiers
|
||||||
|
import net.minecraft.block.Block
|
||||||
|
import net.minecraft.block.material.Material
|
||||||
|
import net.minecraft.creativetab.CreativeTabs
|
||||||
|
import net.minecraft.world.World
|
||||||
|
|
||||||
|
abstract class NFBlock(
|
||||||
|
val hasItemBlock: Boolean = true,
|
||||||
|
val collidable: Boolean = true,
|
||||||
|
val tickRate: Int = 10,
|
||||||
|
material: Material,
|
||||||
|
hardness: Float = 1.0F,
|
||||||
|
resistance: Float = 1.0F,
|
||||||
|
lightLevel: Int = 0,
|
||||||
|
lightOpacity: Int = 0,
|
||||||
|
name: String,
|
||||||
|
creativeTabs: CreativeTabs = NewFrontiers.NF_CREATIVE_TAB
|
||||||
|
) : Block(material) {
|
||||||
|
init {
|
||||||
|
// The Java code is a lot of hot garbage, so most of this is copied from the setter functions
|
||||||
|
blockResistance = resistance * 3.0f
|
||||||
|
|
||||||
|
blockHardness = hardness
|
||||||
|
if (blockResistance < hardness * 5.0f) {
|
||||||
|
blockResistance = hardness * 5.0f
|
||||||
|
}
|
||||||
|
|
||||||
|
setRegistryName("${NewFrontiers.MOD_ID}:$name")
|
||||||
|
this.translationKey = name
|
||||||
|
this.lightValue = lightLevel
|
||||||
|
this.lightOpacity = lightOpacity
|
||||||
|
this.creativeTab = creativeTabs
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun isCollidable(): Boolean {
|
||||||
|
return collidable
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun tickRate(p_tickRate_1_: World): Int {
|
||||||
|
return tickRate
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers.blocks
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material
|
||||||
|
|
||||||
|
class SpaceTeleporter : NFBlock(
|
||||||
|
material = Material.GROUND,
|
||||||
|
hardness = 1.5F,
|
||||||
|
resistance = 2.5F,
|
||||||
|
lightLevel = 15,
|
||||||
|
name = "space_teleporter"
|
||||||
|
)
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers.dimensions
|
||||||
|
|
||||||
|
import net.minecraft.world.DimensionType
|
||||||
|
import net.minecraft.world.WorldProvider
|
||||||
|
import net.minecraft.world.gen.IChunkGenerator
|
||||||
|
|
||||||
|
abstract class NFDimension(
|
||||||
|
private val canRespawn: Boolean = true,
|
||||||
|
private val surfaceDimension: Boolean = false
|
||||||
|
) : WorldProvider() {
|
||||||
|
abstract override fun getDimensionType(): DimensionType
|
||||||
|
abstract override fun createChunkGenerator(): IChunkGenerator
|
||||||
|
|
||||||
|
override fun canRespawnHere(): Boolean {
|
||||||
|
return canRespawn
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun isSurfaceWorld(): Boolean {
|
||||||
|
return surfaceDimension
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package de.wulkanat.www.new_frontiers.dimensions
|
||||||
|
|
||||||
|
import net.minecraft.world.DimensionType
|
||||||
|
import net.minecraft.world.gen.IChunkGenerator
|
||||||
|
|
||||||
|
class Space : NFDimension(
|
||||||
|
canRespawn = true,
|
||||||
|
surfaceDimension = false
|
||||||
|
) {
|
||||||
|
override fun getDimensionType(): DimensionType {
|
||||||
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createChunkGenerator(): IChunkGenerator {
|
||||||
|
TODO("not implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
package de.wulkanat.www.newfrontiers
|
|
||||||
|
|
||||||
object StaticValues {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"normal": {
|
||||||
|
"model": "new_frontiers:space_teleporter"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4
src/main/resources/assets/new_frontiers/lang/en_US.lang
Normal file
4
src/main/resources/assets/new_frontiers/lang/en_US.lang
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
tile.space_teleporter.name=Space Teleporter
|
||||||
|
tile.ftl_drive.name=FTL Drive
|
||||||
|
|
||||||
|
itemGroup.new_frontiers=New Frontiers
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "minecraft:block/cube_all",
|
||||||
|
"textures": {
|
||||||
|
"all": "new_frontiers:blocks/space_teleporter"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "new_frontiers:block/space_teleporter"
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"pattern": [
|
||||||
|
" d ",
|
||||||
|
"oxo",
|
||||||
|
"ooo"
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"d": {
|
||||||
|
"item": "minecraft:diamond"
|
||||||
|
},
|
||||||
|
"o": {
|
||||||
|
"item": "minecraft:obsidian"
|
||||||
|
},
|
||||||
|
"x": {
|
||||||
|
"item": "minecraft:coal"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "new_frontiers:space_teleporter",
|
||||||
|
"count": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 300 B |
@@ -1,6 +1,6 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"modid": "new-frontiers",
|
"modid": "new_frontiers",
|
||||||
"name": "New Frontiers",
|
"name": "New Frontiers",
|
||||||
"description": "Make Minecraft a true Space Exploation Game",
|
"description": "Make Minecraft a true Space Exploation Game",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
|
|||||||
Reference in New Issue
Block a user