Merge branch 'main' of https://gitea.codersquack.nl/NeoFlock/NeoComputers
# Conflicts: # src/main/kotlin/org/neoflock/neocomputers/NeoComputers.kt
This commit is contained in:
204
build.gradle.kts
204
build.gradle.kts
@@ -39,7 +39,6 @@ dependencies {
|
|||||||
mappings(loom.officialMojangMappings())
|
mappings(loom.officialMojangMappings())
|
||||||
|
|
||||||
var archversion = "idk"
|
var archversion = "idk"
|
||||||
println(minecraft)
|
|
||||||
when(minecraft) { // NOTE: add more entries if you want to add more versions
|
when(minecraft) { // NOTE: add more entries if you want to add more versions
|
||||||
"1.20.1" -> archversion = "9.2.14"
|
"1.20.1" -> archversion = "9.2.14"
|
||||||
"1.20.4" -> archversion = "11.1.17"
|
"1.20.4" -> archversion = "11.1.17"
|
||||||
@@ -57,7 +56,6 @@ dependencies {
|
|||||||
//some features (like automatic resource loading from non vanilla namespaces) work only with fabric API installed
|
//some features (like automatic resource loading from non vanilla namespaces) work only with fabric API installed
|
||||||
//for example translations from assets/modid/lang/en_us.json won't be working, same stuff with textures
|
//for example translations from assets/modid/lang/en_us.json won't be working, same stuff with textures
|
||||||
//but we keep runtime only to not accidentally depend on fabric's api, because it doesn't exist in neo/forge
|
//but we keep runtime only to not accidentally depend on fabric's api, because it doesn't exist in neo/forge
|
||||||
println(archversion)
|
|
||||||
modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:${mod.dep("fabric_version")}")
|
modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:${mod.dep("fabric_version")}")
|
||||||
modImplementation("net.fabricmc:fabric-language-kotlin:1.13.10+kotlin.2.3.20")
|
modImplementation("net.fabricmc:fabric-language-kotlin:1.13.10+kotlin.2.3.20")
|
||||||
modApi("dev.architectury:architectury-fabric:${archversion}")
|
modApi("dev.architectury:architectury-fabric:${archversion}")
|
||||||
@@ -239,205 +237,3 @@ tasks.build {
|
|||||||
group = "versioned"
|
group = "versioned"
|
||||||
description = "Must run through 'chiseledBuild'"
|
description = "Must run through 'chiseledBuild'"
|
||||||
}
|
}
|
||||||
|
|
||||||
//import java.util.*
|
|
||||||
//
|
|
||||||
//plugins {
|
|
||||||
// id("dev.architectury.loom")
|
|
||||||
// id("architectury-plugin")
|
|
||||||
// id("me.modmuss50.mod-publish-plugin")
|
|
||||||
// id("com.gradleup.shadow")
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//val minecraft = stonecutter.current.version
|
|
||||||
//val loader = loom.platform.get().name.lowercase()
|
|
||||||
//
|
|
||||||
//version = "${mod.version}+$minecraft"
|
|
||||||
//group = mod.group
|
|
||||||
//base {
|
|
||||||
// archivesName.set("${mod.id}-$loader")
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//architectury.common(stonecutter.tree.branches.mapNotNull {
|
|
||||||
// if (stonecutter.current.project !in it) null
|
|
||||||
// else it.prop("loom.platform")
|
|
||||||
//})
|
|
||||||
//repositories {
|
|
||||||
// maven("https://maven.neoforged.net/releases/")
|
|
||||||
//
|
|
||||||
// //modmenu
|
|
||||||
// maven("https://maven.terraformersmc.com/")
|
|
||||||
// //placeholder api (modmenu depencency)
|
|
||||||
// maven("https://maven.nucleoid.xyz/")
|
|
||||||
//}
|
|
||||||
//dependencies {
|
|
||||||
// minecraft("com.mojang:minecraft:$minecraft")
|
|
||||||
// mappings(loom.officialMojangMappings())
|
|
||||||
//
|
|
||||||
// if (loader == "fabric") {
|
|
||||||
// modImplementation("net.fabricmc:fabric-loader:${mod.dep("fabric_loader")}")
|
|
||||||
//// mappings("net.fabricmc:yarn:$minecraft+build.${mod.dep("yarn_build")}:v2")
|
|
||||||
// modImplementation("com.terraformersmc:modmenu:${mod.dep("modmenu_version")}")
|
|
||||||
//
|
|
||||||
// //some features (like automatic resource loading from non vanilla namespaces) work only with fabric API installed
|
|
||||||
// //for example translations from assets/modid/lang/en_us.json won't be working, same stuff with textures
|
|
||||||
// //but we keep runtime only to not accidentally depend on fabric's api, because it doesn't exist in neo/forge
|
|
||||||
// modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:${mod.dep("fabric_version")}")
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// if (loader == "forge") {
|
|
||||||
// "forge"("net.minecraftforge:forge:${minecraft}-${mod.dep("forge_loader")}")
|
|
||||||
//// mappings("net.fabricmc:yarn:$minecraft+build.${mod.dep("yarn_build")}:v2")
|
|
||||||
//
|
|
||||||
// "io.github.llamalad7:mixinextras-forge:${mod.dep("mixin_extras")}".let {
|
|
||||||
// implementation(it)
|
|
||||||
// include(it)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (loader == "neoforge") {
|
|
||||||
// "neoForge"("net.neoforged:neoforge:${mod.dep("neoforge_loader")}")
|
|
||||||
//// mappings(loom.layered {
|
|
||||||
//// mappings("net.fabricmc:yarn:$minecraft+build.${mod.dep("yarn_build")}:v2")
|
|
||||||
//// mod.dep("neoforge_patch").takeUnless { it.startsWith('[') }?.let {
|
|
||||||
//// mappings("dev.architectury:yarn-mappings-patch-neoforge:$it")
|
|
||||||
//// }
|
|
||||||
//// })
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//loom {
|
|
||||||
//// accessWidenerPath = rootProject.file("src/main/resources/template.accesswidener")
|
|
||||||
//
|
|
||||||
// decompilers {
|
|
||||||
// get("vineflower").apply { // Adds names to lambdas - useful for mixins
|
|
||||||
// options.put("mark-corresponding-synthetics", "1")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (loader == "forge") {
|
|
||||||
// forge.mixinConfigs(
|
|
||||||
// "template-common.mixins.json",
|
|
||||||
// "template-forge.mixins.json",
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//val localProperties = Properties()
|
|
||||||
//val localPropertiesFile = rootProject.file("local.properties")
|
|
||||||
//if (localPropertiesFile.exists()) {
|
|
||||||
// localProperties.load(localPropertiesFile.inputStream())
|
|
||||||
//}
|
|
||||||
//publishMods {
|
|
||||||
// val modrinthToken = localProperties.getProperty("publish.modrinthToken", "")
|
|
||||||
// val curseforgeToken = localProperties.getProperty("publish.curseforgeToken", "")
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// file = project.tasks.remapJar.get().archiveFile
|
|
||||||
// dryRun = modrinthToken == null || curseforgeToken == null
|
|
||||||
//
|
|
||||||
// displayName = "${mod.name} ${loader.replaceFirstChar { it.uppercase() }} ${property("mod.mc_title")}-${mod.version}"
|
|
||||||
// version = mod.version
|
|
||||||
// changelog = rootProject.file("CHANGELOG.md").readText()
|
|
||||||
// type = BETA
|
|
||||||
//
|
|
||||||
// modLoaders.add(loader)
|
|
||||||
//
|
|
||||||
// val targets = property("mod.mc_targets").toString().split(' ')
|
|
||||||
// modrinth {
|
|
||||||
// projectId = property("publish.modrinth").toString()
|
|
||||||
// accessToken = modrinthToken
|
|
||||||
// targets.forEach(minecraftVersions::add)
|
|
||||||
// if (loader == "fabric") {
|
|
||||||
// requires("fabric-api")
|
|
||||||
// optional("modmenu")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// curseforge {
|
|
||||||
// projectId = property("publish.curseforge").toString()
|
|
||||||
// accessToken = curseforgeToken.toString()
|
|
||||||
// targets.forEach(minecraftVersions::add)
|
|
||||||
// if (loader == "fabric") {
|
|
||||||
// requires("fabric-api")
|
|
||||||
// optional("modmenu")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//java {
|
|
||||||
// withSourcesJar()
|
|
||||||
// val java = if (stonecutter.eval(minecraft, ">=1.20.5")) JavaVersion.VERSION_21 else JavaVersion.VERSION_17
|
|
||||||
// targetCompatibility = java
|
|
||||||
// sourceCompatibility = java
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//val shadowBundle: Configuration by configurations.creating {
|
|
||||||
// isCanBeConsumed = false
|
|
||||||
// isCanBeResolved = true
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//tasks.shadowJar {
|
|
||||||
// configurations = listOf(shadowBundle)
|
|
||||||
// archiveClassifier = "dev-shadow"
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//tasks.remapJar {
|
|
||||||
// injectAccessWidener = true
|
|
||||||
// input = tasks.shadowJar.get().archiveFile
|
|
||||||
// archiveClassifier = null
|
|
||||||
// dependsOn(tasks.shadowJar)
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//tasks.jar {
|
|
||||||
// archiveClassifier = "dev"
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//val buildAndCollect = tasks.register<Copy>("buildAndCollect") {
|
|
||||||
// group = "versioned"
|
|
||||||
// description = "Must run through 'chiseledBuild'"
|
|
||||||
// from(tasks.remapJar.get().archiveFile, tasks.remapSourcesJar.get().archiveFile)
|
|
||||||
// into(rootProject.layout.buildDirectory.file("libs/${mod.version}/$loader"))
|
|
||||||
// dependsOn("build")
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//if (stonecutter.current.isActive) {
|
|
||||||
// rootProject.tasks.register("buildActive") {
|
|
||||||
// group = "project"
|
|
||||||
// dependsOn(buildAndCollect)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// rootProject.tasks.register("runActive") {
|
|
||||||
// group = "project"
|
|
||||||
// dependsOn(tasks.named("runClient"))
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//tasks.processResources {
|
|
||||||
// properties(
|
|
||||||
// listOf("fabric.mod.json"),
|
|
||||||
// "id" to mod.id,
|
|
||||||
// "name" to mod.name,
|
|
||||||
// "version" to mod.version,
|
|
||||||
// "minecraft" to mod.prop("mc_dep_fabric")
|
|
||||||
// )
|
|
||||||
// properties(
|
|
||||||
// listOf("META-INF/mods.toml", "pack.mcmeta"),
|
|
||||||
// "id" to mod.id,
|
|
||||||
// "name" to mod.name,
|
|
||||||
// "version" to mod.version,
|
|
||||||
// "minecraft" to mod.prop("mc_dep_forgelike")
|
|
||||||
// )
|
|
||||||
// properties(
|
|
||||||
// listOf("META-INF/neoforge.mods.toml", "pack.mcmeta"),
|
|
||||||
// "id" to mod.id,
|
|
||||||
// "name" to mod.name,
|
|
||||||
// "version" to mod.version,
|
|
||||||
// "minecraft" to mod.prop("mc_dep_forgelike")
|
|
||||||
// )
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//tasks.build {
|
|
||||||
// group = "versioned"
|
|
||||||
// description = "Must run through 'chiseledBuild'"
|
|
||||||
//}
|
|
||||||
@@ -6,7 +6,6 @@ import dev.architectury.registry.registries.RegistrarManager
|
|||||||
import org.neoflock.neocomputers.block.Blocks
|
import org.neoflock.neocomputers.block.Blocks
|
||||||
import org.neoflock.neocomputers.item.Items
|
import org.neoflock.neocomputers.item.Items
|
||||||
import org.neoflock.neocomputers.item.Tabs
|
import org.neoflock.neocomputers.item.Tabs
|
||||||
import org.neoflock.neocomputers.network.Networking
|
|
||||||
import org.slf4j.Logger
|
import org.slf4j.Logger
|
||||||
import org.slf4j.LoggerFactory
|
import org.slf4j.LoggerFactory
|
||||||
import java.util.function.Supplier
|
import java.util.function.Supplier
|
||||||
@@ -25,14 +24,6 @@ object NeoComputers {
|
|||||||
Blocks.registerBlockItems();
|
Blocks.registerBlockItems();
|
||||||
Items.ITEMS.register();
|
Items.ITEMS.register();
|
||||||
|
|
||||||
val logA = Networking.LoggerNode("LogA");
|
|
||||||
val logB = Networking.LoggerNode("LogB");
|
|
||||||
logA.connectTo(logB);
|
|
||||||
// actually register them (else UB can happen)
|
|
||||||
Networking.addNode(logA);
|
|
||||||
Networking.addNode(logB);
|
|
||||||
Networking.emitMessage(logA, Networking.ClassicPacket(logA, "shitfuck", "shitfuck2", 0, listOf(), 0));
|
|
||||||
|
|
||||||
Tabs.TABS.register();
|
Tabs.TABS.register();
|
||||||
LOGGER.info("Registered!")
|
LOGGER.info("Registered!")
|
||||||
//LOGGER.info("Started mod in %s loader".formatted(NeoComputersInit.PLATFORM.getModloader()))
|
//LOGGER.info("Started mod in %s loader".formatted(NeoComputersInit.PLATFORM.getModloader()))
|
||||||
|
|||||||
@@ -1,11 +1,23 @@
|
|||||||
package org.neoflock.neocomputers.block
|
package org.neoflock.neocomputers.block
|
||||||
|
|
||||||
|
import dev.architectury.registry.registries.RegistrySupplier
|
||||||
|
import net.minecraft.core.registries.Registries
|
||||||
|
import net.minecraft.resources.Identifier
|
||||||
|
import net.minecraft.resources.ResourceKey
|
||||||
import net.minecraft.world.level.block.Block
|
import net.minecraft.world.level.block.Block
|
||||||
|
import net.minecraft.world.level.block.state.BlockBehaviour
|
||||||
|
import org.neoflock.neocomputers.NeoComputers
|
||||||
|
import java.util.function.Supplier
|
||||||
|
|
||||||
class BaseBlock : Block {
|
open class BaseBlock : Block { // TODO: create a TieredBaseBlock class that extends this or something
|
||||||
val tier: Int
|
// val tier: Int
|
||||||
|
|
||||||
constructor(tier: Int): super(Properties.of()) {
|
constructor(name: String):super(
|
||||||
this.tier = tier
|
BlockBehaviour.Properties.of()
|
||||||
|
.setId(ResourceKey
|
||||||
|
.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NeoComputers.MODID, name))))
|
||||||
|
|
||||||
|
companion object Registry {
|
||||||
|
fun register(name: String, sup: Supplier<BaseBlock>): RegistrySupplier<Block> = Blocks.BLOCKS.register(name, sup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,47 +22,15 @@ import java.util.function.Consumer
|
|||||||
import java.util.function.Supplier
|
import java.util.function.Supplier
|
||||||
|
|
||||||
object Blocks {
|
object Blocks {
|
||||||
// val CASE: MutableList<RegistrySupplier<Block?>?>? =
|
|
||||||
// BaseBlock.register(intArrayOf(0, 1, 2), "case", { tier -> CaseBlock(tier) })
|
|
||||||
|
|
||||||
|
|
||||||
val BLOCKS: DeferredRegister<Block?> = DeferredRegister.create(NeoComputers.MODID, Registries.BLOCK)
|
val BLOCKS: DeferredRegister<Block> = DeferredRegister.create(NeoComputers.MODID, Registries.BLOCK)
|
||||||
// val TESTBLOCK : RegistrySupplier<Block> = registerBlock("test")
|
val TEST_BLOCK: RegistrySupplier<Block> = BaseBlock.register("test") { BaseBlock("test") }
|
||||||
val TESTBLOCK: RegistrySupplier<Block> = BLOCKS.register("test") { Block(BlockBehaviour.Properties.of().setId(ResourceKey.create(Registries.BLOCK, Identifier.fromNamespaceAndPath(NeoComputers.MODID, "test")))) }
|
val SCREEN_BLOCK: RegistrySupplier<Block> = BaseBlock.register("screen") { ScreenBlock() }
|
||||||
|
|
||||||
|
|
||||||
// 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 registerBlock(name: String): RegistrySupplier<Block> {
|
|
||||||
// // var Registrar<Item> items = MANAGER.get().get(Registries.ITEM);
|
|
||||||
// var blocks: Registrar<Block> = NeoComputers.MANAGER.get().get(Registries.BLOCK);
|
|
||||||
// return blocks.register(Identifier.fromNamespaceAndPath(NeoComputers.MODID, name)) {
|
|
||||||
// Block(
|
|
||||||
// BlockBehaviour.Properties.of().setId(
|
|
||||||
// ResourceKey.create(
|
|
||||||
// Registries.BLOCK,
|
|
||||||
// Identifier.fromNamespaceAndPath(NeoComputers.MODID, name)
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
fun registerBlockItems() {
|
fun registerBlockItems() {
|
||||||
BLOCKS.forEach(Consumer { sup: RegistrySupplier<Block?>? ->
|
BLOCKS.forEach(Consumer { sup: RegistrySupplier<Block> ->
|
||||||
NeoComputers.LOGGER.info("mango viagra")
|
Items.ITEMS.register(sup.id.path) { BlockItem(sup.get()!!, Item.Properties().`arch$tab`(Tabs.TAB).setId(ResourceKey.create(Registries.ITEM, sup.id)))}
|
||||||
// TODO: base blocks
|
|
||||||
// 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!!.id.path) { BlockItem(sup.get()!!, Item.Properties().`arch$tab`(Tabs.TAB).setId(ResourceKey.create(Registries.ITEM, sup.id)))}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package org.neoflock.neocomputers.block;
|
||||||
|
|
||||||
|
import dev.architectury.registry.menu.MenuRegistry
|
||||||
|
import net.minecraft.core.BlockPos
|
||||||
|
import net.minecraft.network.chat.Component
|
||||||
|
import net.minecraft.server.level.ServerPlayer
|
||||||
|
import net.minecraft.world.InteractionHand
|
||||||
|
import net.minecraft.world.InteractionResult
|
||||||
|
import net.minecraft.world.MenuProvider
|
||||||
|
import net.minecraft.world.entity.player.Inventory
|
||||||
|
import net.minecraft.world.entity.player.Player
|
||||||
|
import net.minecraft.world.inventory.AbstractContainerMenu
|
||||||
|
import net.minecraft.world.item.ItemStack
|
||||||
|
import net.minecraft.world.level.Level
|
||||||
|
import net.minecraft.world.level.block.EntityBlock
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity
|
||||||
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
|
import net.minecraft.world.phys.BlockHitResult
|
||||||
|
import org.neoflock.neocomputers.NeoComputers
|
||||||
|
import org.neoflock.neocomputers.entity.ScreenEntity
|
||||||
|
import org.neoflock.neocomputers.gui.menu.Menus
|
||||||
|
|
||||||
|
class ScreenBlock() : BaseBlock("screen"), EntityBlock {
|
||||||
|
|
||||||
|
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity? {
|
||||||
|
return ScreenEntity(blockPos, blockState)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun useWithoutItem(
|
||||||
|
blockState: BlockState,
|
||||||
|
level: Level,
|
||||||
|
blockPos: BlockPos,
|
||||||
|
player: Player,
|
||||||
|
blockHitResult: BlockHitResult
|
||||||
|
): InteractionResult {
|
||||||
|
if(!level.isClientSide) {
|
||||||
|
MenuRegistry.openMenu(player as ServerPlayer, object : MenuProvider {
|
||||||
|
override fun getDisplayName(): Component = Component.literal("SCREEEEEN!")
|
||||||
|
override fun createMenu(i: Int, inventory: Inventory, player: Player): AbstractContainerMenu {
|
||||||
|
return Menus.SCREEN_MENU.get().create(i, inventory);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return InteractionResult.SUCCESS
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.neoflock.neocomputers.entity;
|
||||||
|
|
||||||
|
import dev.architectury.registry.registries.DeferredRegister
|
||||||
|
import dev.architectury.registry.registries.RegistrySupplier
|
||||||
|
import net.minecraft.core.registries.Registries
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||||
|
import org.neoflock.neocomputers.NeoComputers
|
||||||
|
import org.neoflock.neocomputers.block.Blocks
|
||||||
|
|
||||||
|
object BlockEntities {
|
||||||
|
val BLOCKENTITIES: DeferredRegister<BlockEntityType<*>> = DeferredRegister.create(NeoComputers.MODID, Registries.BLOCK_ENTITY_TYPE);
|
||||||
|
|
||||||
|
val SCREEN_ENTITY: RegistrySupplier<BlockEntityType<ScreenEntity>> = BLOCKENTITIES.register("screen_entity") { BlockEntityType(::ScreenEntity, mutableSetOf(Blocks.SCREEN_BLOCK.get()))}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.neoflock.neocomputers.entity;
|
||||||
|
|
||||||
|
import net.minecraft.core.BlockPos
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntity
|
||||||
|
import net.minecraft.world.level.block.entity.BlockEntityType
|
||||||
|
import net.minecraft.world.level.block.state.BlockState
|
||||||
|
|
||||||
|
class ScreenEntity(blockPos: BlockPos, blockState: BlockState) :
|
||||||
|
BlockEntity(BlockEntities.SCREEN_ENTITY.get(), blockPos, blockState) {
|
||||||
|
|
||||||
|
// stuff
|
||||||
|
}
|
||||||
15
src/main/kotlin/org/neoflock/neocomputers/gui/menu/Menus.kt
Normal file
15
src/main/kotlin/org/neoflock/neocomputers/gui/menu/Menus.kt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
package org.neoflock.neocomputers.gui.menu;
|
||||||
|
|
||||||
|
import dev.architectury.registry.menu.MenuRegistry
|
||||||
|
import dev.architectury.registry.registries.DeferredRegister
|
||||||
|
import dev.architectury.registry.registries.RegistrySupplier
|
||||||
|
import net.minecraft.core.registries.Registries
|
||||||
|
import net.minecraft.world.inventory.MenuType
|
||||||
|
import org.neoflock.neocomputers.NeoComputers
|
||||||
|
import org.neoflock.neocomputers.gui.menu.ScreenMenu
|
||||||
|
|
||||||
|
object Menus {
|
||||||
|
val MENUS: DeferredRegister<MenuType<*>> = DeferredRegister.create(NeoComputers.MODID, Registries.MENU)
|
||||||
|
|
||||||
|
val SCREEN_MENU: RegistrySupplier<MenuType<ScreenMenu>> = MENUS.register("screen_menu") { MenuRegistry.of(::ScreenMenu)} // "deprecated" my ass
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package org.neoflock.neocomputers.gui.menu;
|
||||||
|
|
||||||
|
import net.minecraft.world.entity.player.Inventory
|
||||||
|
import org.neoflock.neocomputers.gui.menu.Menus;
|
||||||
|
import net.minecraft.world.entity.player.Player
|
||||||
|
import net.minecraft.world.inventory.AbstractContainerMenu
|
||||||
|
import net.minecraft.world.inventory.MenuType
|
||||||
|
import net.minecraft.world.item.ItemStack
|
||||||
|
|
||||||
|
class ScreenMenu(i: Int, inv: Inventory) : AbstractContainerMenu(Menus.SCREEN_MENU.get(), i) {
|
||||||
|
|
||||||
|
override fun stillValid(player: Player) = true // TODO: implement this properly
|
||||||
|
override fun quickMoveStack(player: Player, i: Int): ItemStack = ItemStack.EMPTY // there's no container here anyways
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package org.neoflock.neocomputers.gui.screen;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.vertex.BufferBuilder
|
||||||
|
import com.mojang.blaze3d.vertex.Tesselator
|
||||||
|
import net.minecraft.client.gui.GuiGraphics
|
||||||
|
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen
|
||||||
|
import net.minecraft.network.chat.Component
|
||||||
|
import net.minecraft.world.entity.player.Inventory
|
||||||
|
import org.neoflock.neocomputers.gui.menu.ScreenMenu
|
||||||
|
|
||||||
|
class ScreenScreen(abstractContainerMenu: ScreenMenu, inventory: Inventory, component: Component) : AbstractContainerScreen<ScreenMenu>(abstractContainerMenu, inventory, component) {
|
||||||
|
override fun renderBg(guiGraphics: GuiGraphics, f: Float, i: Int, j: Int) {}
|
||||||
|
|
||||||
|
override fun getTitle(): Component {
|
||||||
|
return Component.literal("Mango Vlud!")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +1,3 @@
|
|||||||
accessWidener v2 named
|
accessWidener v2 named
|
||||||
|
|
||||||
|
accessible method net/minecraft/world/level/block/entity/BlockEntityType <init> (Lnet/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier;Ljava/util/Set;)V
|
||||||
Reference in New Issue
Block a user