beginning of the neocomputer
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
package com.example.template;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TempLateInit
|
||||
{
|
||||
public static final String MODID = "template";
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger("Template");
|
||||
public static ModPlatform PLATFORM = null;
|
||||
|
||||
public static void entrypoint(ModPlatform platform) {
|
||||
TempLateInit.PLATFORM = platform;
|
||||
LOGGER.info("Started mod in %s loader".formatted(TempLateInit.PLATFORM.getModloader()));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.template;
|
||||
package org.neoflock.neocomputers;
|
||||
|
||||
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.template;
|
||||
package org.neoflock.neocomputers;
|
||||
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.neoflock.neocomputers;
|
||||
|
||||
import org.neoflock.neocomputers.platforms.fabric.NeoComputersFabric;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/*public class NeoComputersInit
|
||||
{
|
||||
public static final String MODID = "neocomputers";
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger("NeoComputers");
|
||||
public static ModPlatform PLATFORM = null;
|
||||
|
||||
public static void entrypoint(ModPlatform platform) {
|
||||
NeoComputersInit.PLATFORM = platform;
|
||||
LOGGER.info("Started mod in %s loader".formatted(NeoComputersInit.PLATFORM.getModloader()));
|
||||
LOGGER.info("Kotlin: %s".formatted(NeoComputers.INSTANCE.hello()));
|
||||
|
||||
}
|
||||
}*/
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.example.template.mixin;
|
||||
package org.neoflock.neocomputers.mixin;
|
||||
|
||||
import com.example.template.TempLateInit;
|
||||
import org.neoflock.neocomputers.NeoComputers;
|
||||
import net.minecraft.client.gui.screens.TitleScreen;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
@@ -12,7 +12,7 @@ public class ExampleMixin {
|
||||
|
||||
@Inject(method = "init",at=@At("HEAD"))
|
||||
void init(CallbackInfo ci){
|
||||
TempLateInit.LOGGER.info("Stonecutter example mixin init in %s".formatted(TempLateInit.PLATFORM.getModloader()));
|
||||
NeoComputers.INSTANCE.getLOGGER().info("Stonecutter example mixin init in %s".formatted(NeoComputers.INSTANCE.getPLATFORM().getModloader()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
//? if fabric {
|
||||
/*package com.example.template.platforms.fabric;
|
||||
package org.neoflock.neocomputers.platforms.fabric;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
import com.example.template.ConfigScreen;
|
||||
import org.neoflock.neocomputers.ConfigScreen;
|
||||
|
||||
public class ModMenuIntegration implements ModMenuApi {
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return ConfigScreen::createConfigScreen;
|
||||
}
|
||||
}
|
||||
*///?}
|
||||
//?}
|
||||
@@ -1,15 +1,15 @@
|
||||
//? if fabric {
|
||||
/*package com.example.template.platforms.fabric;
|
||||
package org.neoflock.neocomputers.platforms.fabric;
|
||||
|
||||
import com.example.template.ModPlatform;
|
||||
import org.neoflock.neocomputers.ModPlatform;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import com.example.template.TempLateInit;
|
||||
import org.neoflock.neocomputers.NeoComputers;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
public class TempLateFabric implements ModInitializer {
|
||||
public class NeoComputersFabric implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
TempLateInit.entrypoint(new FabricPlatform());
|
||||
NeoComputers.INSTANCE.entrypoint(new FabricPlatform());
|
||||
}
|
||||
public static class FabricPlatform implements ModPlatform{
|
||||
|
||||
@@ -24,4 +24,4 @@ public class TempLateFabric implements ModInitializer {
|
||||
}
|
||||
}
|
||||
}
|
||||
*///?}
|
||||
//?}
|
||||
@@ -1,17 +1,18 @@
|
||||
//? if forge {
|
||||
/*package com.example.template.platforms.forge;
|
||||
/*package org.neoflock.neocomputers.neocomputers.platforms.forge;
|
||||
|
||||
import com.example.template.ConfigScreen;
|
||||
import com.example.template.TempLateInit;
|
||||
import com.example.template.ModPlatform;
|
||||
import org.neoflock.neocomputers.ConfigScreen;
|
||||
import org.neoflock.neocomputers.NeoComputersInit;
|
||||
import org.neoflock.neocomputers.ModPlatform;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import org.neoflock.neocomputers.NeoComputers;
|
||||
|
||||
@Mod("template")
|
||||
public class TempLateForge {
|
||||
public TempLateForge() {
|
||||
TempLateInit.entrypoint(new ForgePlatform());
|
||||
@Mod("neocomputers")
|
||||
public class NeoComputersForge {
|
||||
public NeoComputersForge() {
|
||||
NeoComputers.INSTANCE.entrypoint(new ForgePlatform());
|
||||
MinecraftForge.registerConfigScreen(ConfigScreen::createConfigScreen);
|
||||
}
|
||||
public static class ForgePlatform implements ModPlatform {
|
||||
@@ -1,28 +1,29 @@
|
||||
//? if neoforge {
|
||||
package com.example.template.platforms.neoforge;
|
||||
/*package org.neoflock.neocomputers.neocomputers.platforms.neoforge;
|
||||
|
||||
import com.example.template.ConfigScreen;
|
||||
import com.example.template.TempLateInit;
|
||||
import com.example.template.ModPlatform;
|
||||
import org.neoflock.neocomputers.ConfigScreen;
|
||||
import org.neoflock.neocomputers.NeoComputersInit;
|
||||
import org.neoflock.neocomputers.ModPlatform;
|
||||
import net.neoforged.fml.ModList;
|
||||
import net.neoforged.fml.ModLoadingContext;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import org.neoflock.neocomputers.NeoComputers;
|
||||
//? if <1.21 {
|
||||
/*import net.neoforged.neoforge.client.ConfigScreenHandler;
|
||||
*///?} else {
|
||||
/^import net.neoforged.neoforge.client.ConfigScreenHandler;
|
||||
^///?} else {
|
||||
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
|
||||
//?}
|
||||
@Mod("template")
|
||||
public class TempLateNeoForge {
|
||||
public TempLateNeoForge() {
|
||||
TempLateInit.entrypoint(new NeoForgePlatform());
|
||||
@Mod("neocomputers")
|
||||
public class NeoComputersNeoForge {
|
||||
public NeoComputersNeoForge() {
|
||||
NeoComputers.INSTANCE.entrypoint(new NeoForgePlatform());
|
||||
ModLoadingContext.get().registerExtensionPoint(
|
||||
//? if <1.21 {
|
||||
/*ConfigScreenHandler.ConfigScreenFactory.class,
|
||||
/^ConfigScreenHandler.ConfigScreenFactory.class,
|
||||
() -> new ConfigScreenHandler.ConfigScreenFactory(
|
||||
((client, parent) -> ConfigScreen.createConfigScreen(parent))
|
||||
)
|
||||
*///?} else {
|
||||
^///?} else {
|
||||
IConfigScreenFactory.class,
|
||||
() -> (client, parent) -> ConfigScreen.createConfigScreen(parent)
|
||||
//?}
|
||||
@@ -40,4 +41,4 @@ public class TempLateNeoForge {
|
||||
}
|
||||
}
|
||||
}
|
||||
//?}
|
||||
*///?}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.example.template.util;
|
||||
package org.neoflock.neocomputers.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
19
src/main/kotlin/org/neoflock/neocomputers/NeoComputers.kt
Normal file
19
src/main/kotlin/org/neoflock/neocomputers/NeoComputers.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package org.neoflock.neocomputers
|
||||
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
|
||||
object NeoComputers {
|
||||
const val MODID: String = "neocomputers"
|
||||
val LOGGER: Logger = LoggerFactory.getLogger("NeoComputers")
|
||||
var PLATFORM: ModPlatform? = null
|
||||
|
||||
fun entrypoint(platform: ModPlatform?) {
|
||||
PLATFORM = platform
|
||||
//LOGGER.info("Started mod in %s loader".formatted(NeoComputersInit.PLATFORM.getModloader()))
|
||||
//LOGGER.info("Kotlin: %s".formatted(NeoComputers.hello()))
|
||||
LOGGER.info("Started mod in ${NeoComputers.PLATFORM?.modloader} loader")
|
||||
LOGGER.info("Hello from kotlin!")
|
||||
}
|
||||
}
|
||||
14
src/main/kotlin/org/neoflock/neocomputers/block/BaseBlock.kt
Normal file
14
src/main/kotlin/org/neoflock/neocomputers/block/BaseBlock.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
package org.neoflock.neocomputers.block
|
||||
|
||||
import net.minecraft.world.level.block.Block
|
||||
|
||||
class BaseBlock : Block {
|
||||
protected val tier: Int
|
||||
constructor(tier: Int): super(Properties.of()) {
|
||||
this.tier = tier
|
||||
}
|
||||
|
||||
public fun getTier(): Int {
|
||||
return tier
|
||||
}
|
||||
}
|
||||
50
src/main/kotlin/org/neoflock/neocomputers/block/Blocks.kt
Normal file
50
src/main/kotlin/org/neoflock/neocomputers/block/Blocks.kt
Normal file
@@ -0,0 +1,50 @@
|
||||
package org.libreflock.neocomputers.block
|
||||
|
||||
import dev.architectury.registry.registries.DeferredRegister
|
||||
import dev.architectury.registry.registries.RegistrySupplier
|
||||
import net.minecraft.core.registries.Registries
|
||||
import net.minecraft.world.item.BlockItem
|
||||
import net.minecraft.world.item.Item
|
||||
import net.minecraft.world.level.block.Block
|
||||
import org.libreflock.neocomputers.item.Items
|
||||
import org.libreflock.neocomputers.item.Tabs
|
||||
import org.neoflock.neocomputers.NeoComputers
|
||||
import org.neoflock.neocomputers.block.BaseBlock
|
||||
import java.util.function.Consumer
|
||||
import java.util.function.Supplier
|
||||
|
||||
object Blocks {
|
||||
val BLOCKS: DeferredRegister<Block?> = DeferredRegister.create(NeoComputers.MODID, Registries.BLOCK)
|
||||
|
||||
|
||||
val CASE: MutableList<RegistrySupplier<Block?>?>? =
|
||||
BaseBlock.register(intArrayOf(0, 1, 2), "case", { tier -> CaseBlock(tier) })
|
||||
|
||||
// public static final RegistrySupplier<Block> CASE0 = BLOCKS.register("case0", () -> new CaseBlock(0));
|
||||
// public static final RegistrySupplier<Block> CASE1 = BLOCKS.register("case1", () -> new CaseBlock(1));
|
||||
// public static final RegistrySupplier<Block> CASE2 = BLOCKS.register("case2", () -> new CaseBlock(2));
|
||||
// public static final RegistrySupplier<Block> CABLE = BLOCKS.register("cable", () -> new CableBlock());
|
||||
val SCREEN: RegistrySupplier<Block?>? = BLOCKS.register<Block?>("screen", Supplier { ScreenBlock() })
|
||||
val CABLE: RegistrySupplier<Block?>? = BLOCKS.register<Block?>("cable", Supplier { CableBlock() })
|
||||
|
||||
fun registerBlockItems() {
|
||||
BLOCKS.forEach(Consumer { sup: RegistrySupplier<Block?>? ->
|
||||
// sup.pre
|
||||
// sup.((blk) -> {
|
||||
// NeoComputers.LOGGER.info(blk.getDescriptionId());
|
||||
// if (blk instanceof BaseBlock) {
|
||||
// Items.ITEMS.register(sup.getId().getPath(), () -> new BaseBlock.BaseBlockItem(blk, new Item.Properties().arch$tab(Tabs.TAB)));
|
||||
// } else {
|
||||
// Items.ITEMS.register(sup.getId().getPath(), () -> new BlockItem(blk, new Item.Properties().arch$tab(Tabs.TAB)));
|
||||
// }
|
||||
// });
|
||||
Items.ITEMS.register(sup!!.getId().getPath(), {
|
||||
if (sup.get() is BaseBlock) {
|
||||
return@register BaseBlockItem(sup.get(), Item.Properties().`arch$tab`(Tabs.TAB))
|
||||
} else {
|
||||
return@register BlockItem(sup.get(), Item.Properties().`arch$tab`(Tabs.TAB))
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "*"
|
||||
license = "LGPLv3"
|
||||
issueTrackerURL="https://AuthorExample/TempLate/issues"
|
||||
issueTrackerURL="https://github.com/NeoFlock/NeoComputers/issues"
|
||||
|
||||
[[mods]]
|
||||
modId = "template"
|
||||
modId = "neocomputers"
|
||||
version = "${version}"
|
||||
displayName = "${name}"
|
||||
authors = "AuthorExample"
|
||||
authors = "NeoFlock Team"
|
||||
description = ""
|
||||
logoFile = "assets/template/icon.png"
|
||||
logoFile = "assets/neocomputers/icon.png"
|
||||
logoBlur = false
|
||||
|
||||
[[mixins]]
|
||||
config = "template-common.mixins.json"
|
||||
config = "neocomputers-common.mixins.json"
|
||||
|
||||
[[mixins]]
|
||||
config = "template-neoforge.mixins.json"
|
||||
config = "neocomputers-neoforge.mixins.json"
|
||||
@@ -1,19 +1,19 @@
|
||||
modLoader = "javafml"
|
||||
loaderVersion = "*"
|
||||
license = "LGPLv3"
|
||||
issueTrackerURL="https://AuthorExample/TempLate/issues"
|
||||
issueTrackerURL="https://github.com/NeoFlock/NeoComputers/issues"
|
||||
|
||||
[[mods]]
|
||||
modId = "template"
|
||||
modId = "neocomputers"
|
||||
version = "${version}"
|
||||
displayName = "${name}"
|
||||
authors = "AuthorExample"
|
||||
authors = "NeoFlock Team"
|
||||
description = ""
|
||||
logoFile = "assets/template/icon.png"
|
||||
logoFile = "assets/neocomputers/icon.png"
|
||||
logoBlur = false
|
||||
|
||||
[[mixins]]
|
||||
config = "template-common.mixins.json"
|
||||
config = "neocomputers-common.mixins.json"
|
||||
|
||||
[[mixins]]
|
||||
config = "template-neoforge.mixins.json"
|
||||
config = "neocomputers-neoforge.mixins.json"
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"accessWidener": "template.accesswidener"
|
||||
"accessWidener": "neocomputers.accesswidener"
|
||||
}
|
||||
4
src/main/resources/assets/neocomputers/lang/en_us.json
Normal file
4
src/main/resources/assets/neocomputers/lang/en_us.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"neocomputers.confirm": "Confirm",
|
||||
"neocomputers.cancel": "Cancel"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"template.confirm": "Confirm",
|
||||
"template.cancel": "Cancel"
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
"name": "${name}",
|
||||
"description": "",
|
||||
"authors": [
|
||||
"AuthorExample"
|
||||
"NeoFlock Team"
|
||||
],
|
||||
"contact": {
|
||||
},
|
||||
@@ -14,18 +14,19 @@
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"com.example.template.platforms.fabric.TempLateFabric"
|
||||
"org.neoflock.neocomputers.platforms.fabric.NeoComputersFabric"
|
||||
],
|
||||
"modmenu": [
|
||||
"com.example.template.platforms.fabric.ModMenuIntegration"
|
||||
"org.neoflock.neocomputers.platforms.fabric.ModMenuIntegration"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"template-common.mixins.json",
|
||||
"template-fabric.mixins.json"
|
||||
"neocomputers-common.mixins.json",
|
||||
"neocomputers-fabric.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15",
|
||||
"minecraft": "${minecraft}"
|
||||
"minecraft": "${minecraft}",
|
||||
"fabric-language-kotlin": ">=1.13.10+kotlin.2.3.20"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "com.example.template.mixin",
|
||||
"package": "org.neoflock.neocomputers.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "com.example.template.platforms.forge.mixin",
|
||||
"package": "org.neoflock.neocomputers.platforms.fabric.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "com.example.template.platforms.fabric.mixin",
|
||||
"package": "org.neoflock.neocomputers.platforms.forge.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"required": true,
|
||||
"package": "com.example.template.platforms.neoforge.mixin",
|
||||
"package": "org.neoflock.neocomputers.platforms.neoforge.mixin",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
],
|
||||
Reference in New Issue
Block a user