diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 99184e730..4e42c1258 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,96 +4,96 @@ # Contributing to CC: Tweaked If you've any other questions, [just ask the community][community] or [open an issue][new-issue]. +## Table of Contents + - [Reporting issues](#reporting-issues) + - [Translations](#translations) + - [Setting up a development environment](#setting-up-a-development-environment) + - [Developing CC: Tweaked](#developing-cc-tweaked) + - [Writing documentation](#writing-documentation) + ## Reporting issues -If you have a bug, suggestion, or other feedback, the best thing to do is [file an issue][new-issue]. When doing so, -do use the issue templates - they provide a useful hint on what information to provide. +If you have a bug, suggestion, or other feedback, the best thing to do is [file an issue][new-issue]. When doing so, do +use the issue templates - they provide a useful hint on what information to provide. ## Translations Translations are managed through [Weblate], an online interface for managing language strings. This is synced automatically with GitHub, so please don't submit PRs adding/changing translations! -## Developing -In order to develop CC: Tweaked, you'll need to download the source code and then run it. This is a pretty simple -process. When building on Windows, Use `gradlew.bat` instead of `./gradlew`. +## Setting up a development environment +In order to develop CC: Tweaked, you'll need to download the source code and then run it. - - **Clone the repository:** `git clone https://github.com/cc-tweaked/CC-Tweaked.git && cd CC-Tweaked` - - **Setup Forge:** `./gradlew build` - - **Run Minecraft:** `./gradlew runClient` (or run the `GradleStart` class from your IDE). - - **Optionally:** For small PRs (especially those only touching Lua code), it may be easier to use GitPod, which - provides a pre-configured environment: [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-2b2b2b?logo=gitpod)](https://gitpod.io/#https://github.com/cc-tweaked/CC-Tweaked/) + - Make sure you've got the following software instealled: + - Java Development Kit (JDK) installed. This can be downloaded from [Adoptium]. + - [Git](https://git-scm.com/). + - If you want to work on documentation, [NodeJS][node]. - Do note you will need to download the mod after compiling to test. + - Download CC: Tweaked's source code: + ``` + git clone https://github.com/cc-tweaked/CC-Tweaked.git + cd CC-Tweaked + ``` -If you want to run CC:T in a normal Minecraft instance, run `./gradlew build` and copy the `.jar` from `build/libs`. -These commands may take a few minutes to run the first time, as the environment is set up, but should be much faster -afterwards. + - Build CC: Tweaked with `./gradlew build`. This will be very slow the first time it runs, as it needs to download a + lot of dependencies (and decompile Minecraft several times). Subsequent runs should be much faster! -The following sections describe the more niche sections of CC: Tweaked's build system. Some bits of these are -quite-complex, and (dare I say) over-engineered, so you may wish to ignore them. Well tested/documented PRs are always -preferred (and I'd definitely recommend setting up the tooling if you're doing serious development work), but for -small changes it can be a lot. + - You're now ready to start developing CC: Tweaked. Running `./gradlew :forge:runClient` or + `./gradle :fabric:runClient` will start Minecraft under Forge and Fabric respectively. -### Code linters -CC: Tweaked uses a couple of "linters" on its source code, to enforce a consistent style across the project. While these -are run whenever you submit a PR, it's often useful to run this before committing. +If you want to run CC:T in a normal Minecraft instance, run `./gradlew assemble` and copy the `.jar` from +`projects/forge/build/libs` (for Forge) or `projects/fabric/build/libs` (for Fabric). - - **[Checkstyle]:** Checks Java code to ensure it is consistently formatted. This can be run with `./gradlew build` or - `./gradle check`. - - **[illuaminate]:** Checks Lua code for semantic and styleistic issues. This can be run with `./gradlew lintLua`. +## Developing CC: Tweaked +Before making any major changes to CC: Tweaked, I'd recommend you have a read of the [the architecture +document][architecture] first. While it's not a comprehensive document, it gives a good hint of where you should start +looking to make your changes. As always, if you're not sure [do ask the community][community]! -### Documentation +### Testing +When making larger changes, it's may be useful to write a test to make sure your code works as expected. + +CC: Tweaked has several test suites, each designed to test something different: + + - In order to test CraftOS and its builtin APIs, we have a test suite written in Lua located at + `projects/core/src/test/resources/test-rom/`. These don't rely on any Minecraft code, which means they can run on + emulators, acting as a sort of compliance test. + + These tests are written using a test system called "mcfly", heavily inspired by [busted]. Groups of tests go inside + `describe` blocks, and a single test goes inside `it`. Assertions are generally written using `expect` (inspired by + Hamcrest and the like). For instance, `expect(foo):eq("bar")` asserts that your variable `foo` is equal to the + expected value `"bar"`. + + These tests can be run with `./gradlew :core:test`. + + - In-game functionality, such as the behaviour of blocks and items, is tested using [Minecraft's gametest + system][mc-test] (`projects/common/src/testMod`). These tests spin up a server, spawn a structure for each test, and + then run some code on the blocks defined in that structure. + + These tests can be run with `./gradlew runGametest` (or `./gradle :forge:runGametest`/`./gradlew :fabric:runGametest` + for a single loader). + +For more information, [see the architecture document][architecture]. + +## Writing documentation When writing documentation for [CC: Tweaked's documentation website][docs], it may be useful to build the documentation and preview it yourself before submitting a PR. -Our documentation generation pipeline is rather complex, and involves invoking several external tools. Most of this -complexity is hidden by Gradle, but you will need to perform some initial setup: +You'll first need to [set up a development environment as above](#setting-up-a-development-environment). - - Install [Node/npm][node]. - - Run `npm ci` to install our Node dependencies. +Once this is set up, you can now run `./gradlew :web:site`. This generates documentation from our Lua and Java code, +writing the resulting HTML into `./projects/web/build/site`, which can then be opened in a browser. When iterating on +documentation, you can instead run `./gradlew :web:site -t`, which will rebuild documentation every time you change a +file. -You can now run `./gradlew docWebsite`. This generates documentation from our Lua and Java code, writing the resulting -HTML into `./projects/web/build/site`. +Documentation is built using [illuaminate] which, while not currently documented (somewhat ironic), is largely the same +as [ldoc][ldoc]. Documentation comments are written in Markdown, though note that we do not support many GitHub-specific +markdown features - if you can, do check what the documentation looks like locally! -#### Writing documentation -illuaminate's documentation system is not currently documented (somewhat ironic), but is _largely_ the same as -[ldoc][ldoc]. Documentation comments are written in Markdown, - -Our markdown engine does _not_ support GitHub flavoured markdown, and so does not support all the features one might -expect. It is recommended that you build and preview the docs locally first. - -When iterating on documentation, you can get Gradle to rebuild the website every time a file changes by running -`./gradlew docWebsite -t`. This will take a couple of seconds to run, but definitely beats running it manually! - -### Testing -Thankfully running tests is much simpler than running the documentation generator! `./gradlew check` will run the -entire test suite (and some additional bits of verification). - -Before we get into writing tests, it's worth mentioning the various test suites that CC: Tweaked has: - - "Core" Java (`./src/test/java`): These test core bits of the mod which don't require any Minecraft interaction. - This includes the `@LuaFunction` system, file system code, etc... - - These tests are run by `./gradlew test`. - - - CraftOS (`./src/test/resources/test-rom/`): These tests are written in Lua, and ensure the Lua environment, libraries - and programs work as expected. These are (generally) written to be able to be run on emulators too, to provide some - sort of compliance test. - - These tests are run by the '"Core" Java' test suite, and so are also run with `./gradlew test`. - - - In-game (`./src/testMod/java/dan200/computercraft/ingame/`): These tests are run on an actual Minecraft server, using - the same system Mojang do][mc-test]. The aim of these is to test in-game behaviour of blocks and peripherals. - - These tests are run with `./gradlew runGametest`. - -## CraftOS tests -CraftOS's tests are written using a test system called "mcfly", heavily inspired by [busted] (and thus RSpec). Groups of -tests go inside `describe` blocks, and a single test goes inside `it`. - -Assertions are generally written using `expect` (inspired by Hamcrest and the like). For instance, `expect(foo):eq("bar")` -asserts that your variable `foo` is equal to the expected value `"bar"`. +When writing long-form documentation (such as the guides in [doc/guides](doc/guides)), I find it useful to tell a +narrative. Think of what you want the user to learn or achieve, then start introducing a simple concept and then talk +about how you can build on that, until you've covered everything! [new-issue]: https://github.com/cc-tweaked/CC-Tweaked/issues/new/choose "Create a new issue" -[community]: README.md#Community "Get in touch with the community." +[community]: README.md#community "Get in touch with the community." +[Adoptium]: https://adoptium.net/temurin/releases?version=17 "Download OpenJDK 17" [checkstyle]: https://checkstyle.org/ [illuaminate]: https://github.com/SquidDev/illuaminate/ "Illuaminate on GitHub" [weblate]: https://i18n.tweaked.cc/projects/cc-tweaked/minecraft/ "CC: Tweaked weblate instance" @@ -102,3 +102,4 @@ ## CraftOS tests [mc-test]: https://www.youtube.com/watch?v=vXaWOJTCYNg [busted]: https://github.com/Olivine-Labs/busted "busted: Elegant Lua unit testing." [node]: https://nodejs.org/en/ "Node.js" +[architecture]: projects/ARCHITECTURE.md diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 1bf925e50..517dcf18c 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -34,6 +34,13 @@ repositories { includeGroup("org.spongepowered") } } + + maven("https://maven.fabricmc.net/") { + name = "Fabric" + content { + includeGroup("net.fabricmc") + } + } } dependencies { @@ -41,9 +48,11 @@ dependencies { implementation(libs.kotlin.plugin) implementation(libs.spotless) - implementation(libs.vanillaGradle) + implementation(libs.fabric.loom) implementation(libs.forgeGradle) implementation(libs.librarian) + implementation(libs.quiltflower) + implementation(libs.vanillaGradle) } gradlePlugin { diff --git a/buildSrc/src/main/kotlin/cc-tweaked.fabric.gradle.kts b/buildSrc/src/main/kotlin/cc-tweaked.fabric.gradle.kts new file mode 100644 index 000000000..a8ae4e0e8 --- /dev/null +++ b/buildSrc/src/main/kotlin/cc-tweaked.fabric.gradle.kts @@ -0,0 +1,66 @@ +/** Default configuration for Fabric projects. */ + +import cc.tweaked.gradle.CCTweakedExtension +import cc.tweaked.gradle.CCTweakedPlugin +import cc.tweaked.gradle.IdeaRunConfigurations +import cc.tweaked.gradle.MinecraftConfigurations + +plugins { + `java-library` + id("fabric-loom") + id("io.github.juuxel.loom-quiltflower") + id("cc-tweaked.java-convention") +} + +plugins.apply(CCTweakedPlugin::class.java) + +val mcVersion: String by extra + +repositories { + maven("https://maven.parchmentmc.org/") { + name = "Parchment" + content { + includeGroup("org.parchmentmc.data") + } + } +} + +loom { + splitEnvironmentSourceSets() + splitModDependencies.set(true) +} + +MinecraftConfigurations.setup(project) + +extensions.configure(CCTweakedExtension::class.java) { + linters(minecraft = true, loader = "fabric") +} + +dependencies { + val libs = project.extensions.getByType().named("libs") + + minecraft("com.mojang:minecraft:$mcVersion") + mappings( + loom.layered { + officialMojangMappings() + parchment( + project.dependencies.create( + group = "org.parchmentmc.data", + name = "parchment-${libs.findVersion("parchmentMc").get()}", + version = libs.findVersion("parchment").get().toString(), + ext = "zip", + ), + ) + }, + ) + + modImplementation(libs.findLibrary("fabric-loader").get()) + modImplementation(libs.findLibrary("fabric-api").get()) + + // Depend on error prone annotations to silence a lot of compile warnings. + compileOnlyApi(libs.findLibrary("errorProne.annotations").get()) +} + +tasks.ideaSyncTask { + doLast { IdeaRunConfigurations(project).patch() } +} diff --git a/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts b/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts index 63afdcdd4..1d29372c8 100644 --- a/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts +++ b/buildSrc/src/main/kotlin/cc-tweaked.java-convention.gradle.kts @@ -42,6 +42,7 @@ repositories { includeGroup("org.squiddev") includeGroup("cc.tweaked") // Things we mirror + includeGroup("dev.architectury") includeGroup("maven.modrinth") includeGroup("me.shedaniel") includeGroup("me.shedaniel.cloth") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f047f664d..e3f38cda9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,11 +2,13 @@ # Minecraft # MC version is specified in gradle.properties, as we need that in settings.gradle. +fabric-api = "0.66.0+1.19.2" +fabric-loader = "0.14.10" forge = "43.1.1" forgeSpi = "6.0.0" +mixin = "0.8.5" parchment = "2022.10.16" parchmentMc = "1.19.2" -mixin = "0.8.5" # Normal dependencies asm = "9.3" @@ -32,6 +34,7 @@ oculus = "1.2.5" rei = "9.1.550" # Testing +byteBuddy = "1.12.18" hamcrest = "2.2" jqwik = "1.7.0" junit = "5.9.1" @@ -42,6 +45,7 @@ checkstyle = "10.3.4" curseForgeGradle = "1.0.11" errorProne-core = "2.14.0" errorProne-plugin = "2.0.2" +fabric-loom = "1.0-SNAPSHOT" forgeGradle = "5.1.+" githubRelease = "2.2.12" ideaExt = "1.1.6" @@ -50,6 +54,7 @@ librarian = "1.+" minotaur = "2.+" mixinGradle = "0.7.+" nullAway = "0.9.9" +quiltflower = "1.7.3" shadow = "7.1.2" spotless = "6.8.0" taskTree = "2.1.0" @@ -74,14 +79,21 @@ nightConfig-toml = { module = "com.electronwill.night-config:toml", version.ref slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } # Minecraft mods +fabric-api = { module = "net.fabricmc.fabric-api:fabric-api", version.ref = "fabric-api" } +fabric-loader = { module = "net.fabricmc:fabric-loader", version.ref = "fabric-loader" } forgeConfig = { module = "net.minecraftforge:forgeconfigapiport-fabric", version.ref = "forgeConfig" } +iris = { module = "maven.modrinth:iris", version.ref = "iris" } jei-api = { module = "mezz.jei:jei-1.19.2-common-api", version.ref = "jei" } jei-fabric = { module = "mezz.jei:jei-1.19.2-fabric", version.ref = "jei" } jei-forge = { module = "mezz.jei:jei-1.19.2-forge", version.ref = "jei" } mixin = { module = "org.spongepowered:mixin", version.ref = "mixin" } oculus = { module = "maven.modrinth:oculus", version.ref = "oculus" } +rei-api = { module = "me.shedaniel:RoughlyEnoughItems-api", version.ref = "rei" } +rei-builtin = { module = "me.shedaniel:RoughlyEnoughItems-default-plugin", version.ref = "rei" } +rei-fabric = { module = "me.shedaniel:RoughlyEnoughItems-fabric", version.ref = "rei" } # Testing +byteBuddyAgent = { module ="net.bytebuddy:byte-buddy-agent", version.ref = "byteBuddy" } hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" } jqwik-api = { module = "net.jqwik:jqwik-api", version.ref = "jqwik" } jqwik-engine = { module = "net.jqwik:jqwik-engine", version.ref = "jqwik" } @@ -97,10 +109,12 @@ errorProne-api = { module = "com.google.errorprone:error_prone_check_api", versi errorProne-core = { module = "com.google.errorprone:error_prone_core", version.ref = "errorProne-core" } errorProne-plugin = { module = "net.ltgt.gradle:gradle-errorprone-plugin", version.ref = "errorProne-plugin" } errorProne-testHelpers = { module = "com.google.errorprone:error_prone_test_helpers", version.ref = "errorProne-core" } +fabric-loom = { module = "net.fabricmc:fabric-loom", version.ref = "fabric-loom" } forgeGradle = { module = "net.minecraftforge.gradle:ForgeGradle", version.ref = "forgeGradle" } kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } librarian = { module = "org.parchmentmc:librarian", version.ref = "librarian" } nullAway = { module = "com.uber.nullaway:nullaway", version.ref = "nullAway" } +quiltflower = { module = "io.github.juuxel:loom-quiltflower", version.ref = "quiltflower" } spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version.ref = "spotless" } vanillaGradle = { module = "org.spongepowered:vanillagradle", version.ref = "vanillaGradle" } @@ -123,6 +137,9 @@ kotlin = ["kotlin-stdlib", "kotlin-coroutines"] externalMods-common = ["jei-api", "forgeConfig", "nightConfig-core", "nightConfig-toml"] externalMods-forge-compile = ["oculus", "jei-api"] externalMods-forge-runtime = ["jei-forge"] +externalMods-fabric = ["fabric-loader", "fabric-api", "forgeConfig", "nightConfig-core", "nightConfig-toml"] +externalMods-fabric-compile = ["iris", "jei-api", "rei-api", "rei-builtin"] +externalMods-fabric-runtime = ["jei-fabric"] # Testing test = ["junit-jupiter-api", "junit-jupiter-params", "hamcrest", "jqwik-api"] diff --git a/projects/ARCHITECTURE.md b/projects/ARCHITECTURE.md new file mode 100644 index 000000000..e52699629 --- /dev/null +++ b/projects/ARCHITECTURE.md @@ -0,0 +1,159 @@ +# Architecture +CC: Tweaked has a rather complex project layout, as there's several use-cases we want to support (multiple mod loaders, +usable outside of Minecraft). As such, it can be tricky to understand how the code is structured and how the various +sub-projects interact. This document provides a high-level overview of the entire mod. + +## Project Outline +CC: Tweaked is split into 4 primary modules (`core`, `common`, `fabric`, `forge`). These themselves are then split into +a public API (i.e `core-api`) and the actual implementation (i.e. `core`). + + - `core`: This contains the core "computer" part of ComputerCraft, such as the Lua VM, filesystem and builtin APIs. + This is also where the Lua ROM is located (`projects/core/src/main/resources/data/computercraft/lua`). Notably this + project does _not_ depend on Minecraft, making it possible to use it emulators and other tooling. + + - `common`: This contains all non mod-loader-specific Minecraft code. This is where computers, turtles and peripherals + are defined (and everything else Minecraft-related!). + + This project is separates client code into its own separate source set (suitably named `client`). This helps us + ensure that server code can never reference client-only code (such as LWJGL). + + - `forge` and `fabric`: These contain any mod-loader specific code. + +When we need to call loader-specific code from our own code (for instance, sending network messages or firing +loader-specific events), we use a `PlatformHelper` interface (defined in +`projects/common/src/main/java/dan200/computercraft/shared/platform/PlatformHelper.java`). This abstracts over most +loader-specific code we need to use, and is then implemented by each mod-loader-specific project. The concrete +implementation is then loaded with Java's [`ServiceLoader`][ServiceLoader], in a design based on [jaredlll08's +multi-loader template][MultiLoader-Template]. We use a similar system for communicating between the API and its +implementation. + +```mermaid +flowchart LR +subgraph Common + platform(PlatformHelper) + impl[AbstractComputerCraftAPIImpl] +end +subgraph API + api(ComputerCraft API) --> impl +end +subgraph Forge[Forge] + platform --> forgePlatform[PlatformHelperImpl] + impl -.-> forgeImpl[ComputerCraftAPIImpl] +end +subgraph Fabric + platform --> fabricPlatform[PlatformHelperImpl] + impl -.-> fabricImpl[ComputerCraftAPIImpl] +end +``` + +Note the `PlatformHelper` is only used when calling from our code into loader-specific code. While we use this to _fire_ +events, we do not use it to _subscribe_ to events. For that we just subscribe to the events in the loader-specific +project, and then dispatch to the common `CommonHooks` (for shared code) and `ClientHooks` (for client-specific code). + +You may notice there's a couple of other, smaller modules in the codebase. These you can probably ignore, but are worth +mentioning: + + - `lints`: This defines an [ErrorProne] plugin which adds a couple of compile-time checks to our code. This is what + enforces that no client-specific code is used inside the `main` source set (and a couple of other things!). + + - `web`: This contains the additional tooling for building [the documentation website][tweaked.cc], such as support for + rendering recipes + + - `build-logic` (in the base directory, not in `projects/`): This contains any build logic shared between modules. For + instance, `cc-tweaked.java-convention.gradle.kts` sets up the defaults for Java that we use across the whole project. + +> **Note** +> The Forge and Fabric modules (and their API counterparts) depend on the common modules. However, in order to correctly +> process mixins we need to compile the common code along with the Forge/Fabric code. This leads to a slightly strange +> build process: +> +> - In your IDE, Forge/Fabric depend on the common as normal. +> - When building via Gradle, the common code is compiled alongside Forge/Fabric. +> +> You shouldn't need to worry about this - it should all be set up automatically - but hopefully explains a little bit +> why our Gradle scripts are slightly odd! + +## Testing +CC: Tweaked has a small (though growing!) test suite to ensure various features behave correctly. Most tests are written +in Java using [JUnit], though we also make use of [jqwik] for property testing. + +### Test Fixtures +Some projects define an additional `testFixtures` folder alongside their main `test` code (i.e. +`projects/core/src/testFixtures`). This source set contains test-related code which might be consumed in dependent +projects. For instance, core's test fixtures defines additional [Hamcrest] matchers, which are used in both `core` and +`common`'s test suite. + +Test fixtures may also define [Test Interfaces]. This is a pattern for writing tests to ensure that an implementation +obeys its interface's contract. For instance, we might have a `ListContract` test, which asserts an abstract list +behaves as expected: + +```java +interface ListContract> { + T newList(); + + @Test + default void testAddInsert() { + var list = newList(); + assertTrue(list.add(123)); + assertTrue(list.contains(123)); + } +} +``` + +We can then use this interface to create tests for a specific implementation: + +```java +class ArrayListTest implements ListContract> { + @Override public ArrayList newList() { return new ArrayList<>(); } +} +``` + +This is especially useful when testing `PlatformHelper` and other mod loader abstractions. + +### Lua tests +While the majority of CC: Tweaked is written in Java, a significant portion of the code is written in Lua. As such, it's +also useful to test that. + +This is done by starting a Lua VM with all of ComputerCraft's APIs loaded, then starting a custom test framework +(`mcfly.lua`). This test framework discovers tests and sends them back to the Java side. These are turned into JUnit +tests which are then in turn run on the computer again. This allows the tests to integrate with existing Java testing +tooling (for instance, XML test reports and IDE integration). + +There's a slightly more detailed description of the process at `CraftOsLuaTest.java`. + +### Game tests +CC: Tweaked also runs several tests in-game using Minecraft's [gametest framework][mc-test]. These work by starting +a Minecraft server and then, for each test, spawning a structure and then interacting with the blocks inside the +structure, asserting they behave as expected. + +Unlike most of our other tests, these are written in Kotlin. We make extensive use of [extension methods] to augment +vanilla's own test classes, which helps give a more consistent feel to the API. + +Each test works by defining a sequence of steps. Each step can either run an action (`thenExecute`), sleep for a period +(`thenIdle`) or sleep until a condition is met (`thenWaitUntil`). + +```kotlin +fun Some_test(context: GameTestHelper) = context.sequence { + thenExecute { context.setBlock(BlockPos(2, 2, 2), Blocks.AIR) } + thenIdle(4) + thenExecute { context.assertBlockHas(lamp, RedstoneLampBlock.LIT, false, "Lamp should not be lit") } +} +``` + +Some tests need to use Lua APIs from a computer, such as when testing `turtle.dig`. In order to do this, we install +a custom "Lua" runtime (see `ManagedComputers.kt`) which actually runs Java functions. Tests can then enqueue a function +to run on a particular computer and then wait for it to finish. + +While the internals of this is quite complex, it ends up being a much nicer workflow than writing parts of the test in +Lua. It also ends up being much more efficient, which is important when running a dozen tests at once! + +[MultiLoader-Template]: https://github.com/jaredlll08/MultiLoader-Template/ "MultiLoader-Template - A template for a Forge + Fabric project setup using a Common source set." +[ServiceLoader]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/ServiceLoader.html "ServiceLoader (Java SE 17 and JDK 17)" +[ErrorProne]: https://errorprone.info/ "ErrorProne" +[tweaked.cc]: https://tweaked.cc "CC: Tweaked" +[JUnit]: https://junit.org/junit5/ "JUnit 5" +[jqwik]: https://jqwik.net/ +[Hamcrest]: https://hamcrest.org/JavaHamcrest/ "Java Hamcrest" +[Test Interfaces]: https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-interfaces-and-default-methods +[mc-test]: https://www.youtube.com/watch?v=vXaWOJTCYNg "Testing Minecraft in Minecraft on YouTube" +[extension methods]: https://kotlinlang.org/docs/extensions.html "Extensions | Kotlin" diff --git a/projects/common/src/main/java/dan200/computercraft/mixin/CreativeModeTabAccessor.java b/projects/common/src/main/java/dan200/computercraft/mixin/CreativeModeTabAccessor.java index 80a075392..e49bb4f7b 100644 --- a/projects/common/src/main/java/dan200/computercraft/mixin/CreativeModeTabAccessor.java +++ b/projects/common/src/main/java/dan200/computercraft/mixin/CreativeModeTabAccessor.java @@ -6,11 +6,19 @@ package dan200.computercraft.mixin; import net.minecraft.world.item.CreativeModeTab; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(CreativeModeTab.class) public interface CreativeModeTabAccessor { @Accessor("langId") String computercraft$langId(); + + @Final + @Mutable + @Accessor("TABS") + static void computercraft$setTabs(CreativeModeTab[] tabs) { + } } diff --git a/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java b/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java index ceb68a8c7..8fc5a3675 100644 --- a/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java +++ b/projects/common/src/main/java/dan200/computercraft/shared/config/ConfigSpec.java @@ -18,6 +18,8 @@ import org.apache.logging.log4j.core.Filter; import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.filter.MarkerFilter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.Arrays; import java.util.List; @@ -25,6 +27,8 @@ import java.util.concurrent.TimeUnit; public final class ConfigSpec { + private static final Logger LOG = LoggerFactory.getLogger(ConfigSpec.class); + private static final int MODEM_MAX_RANGE = 100000; private static final String TRANSLATION_PREFIX = "gui.computercraft.config."; @@ -337,6 +341,8 @@ CIDR notation ("127.0.0.0/8"). } private static void syncServer() { + if (!serverSpec.isLoaded()) return; + // General Config.computerSpaceLimit = computerSpaceLimit.get(); Config.floppySpaceLimit = floppySpaceLimit.get(); @@ -399,6 +405,8 @@ private static void syncServer() { } private static void syncClient() { + if (!clientSpec.isLoaded()) return; + Config.monitorRenderer = monitorRenderer.get(); Config.monitorDistance = monitorDistance.get(); Config.uploadNagDelay = uploadNagDelay.get(); @@ -406,7 +414,17 @@ private static void syncClient() { public static void sync(ModConfig config) { if (!config.getModId().equals(ComputerCraftAPI.MOD_ID)) return; - if (config.getType() == ModConfig.Type.SERVER) syncServer(); - if (config.getType() == ModConfig.Type.CLIENT) syncClient(); + + try { + if (config.getType() == ModConfig.Type.SERVER) syncServer(); + if (config.getType() == ModConfig.Type.CLIENT) syncClient(); + } catch (IllegalStateException e) { + // TODO: Remove when https://github.com/Fuzss/forgeconfigapiport-fabric/issues/26 is fixed. + if (e.getMessage() != null && e.getMessage().startsWith("Cannot get config value before config is loaded.")) { + return; + } + + throw e; + } } } diff --git a/projects/fabric-api/build.gradle.kts b/projects/fabric-api/build.gradle.kts new file mode 100644 index 000000000..1067f8e8e --- /dev/null +++ b/projects/fabric-api/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + id("cc-tweaked.publishing") + id("cc-tweaked.fabric") +} + +val mcVersion: String by extra + +java { + withJavadocJar() +} + +cct.inlineProject(":common-api") + +dependencies { + api(project(":core-api")) + compileOnly(project(":forge-stubs")) +} diff --git a/projects/fabric-api/src/main/java/dan200/computercraft/api/detail/FabricDetailRegistries.java b/projects/fabric-api/src/main/java/dan200/computercraft/api/detail/FabricDetailRegistries.java new file mode 100644 index 000000000..728cd4886 --- /dev/null +++ b/projects/fabric-api/src/main/java/dan200/computercraft/api/detail/FabricDetailRegistries.java @@ -0,0 +1,22 @@ +/* + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ +package dan200.computercraft.api.detail; + +import dan200.computercraft.impl.ComputerCraftAPIFabricService; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; + +/** + * {@link DetailRegistry}s for Fabric's types. + * + * @see VanillaDetailRegistries Detail registries for vanilla types. + */ +public class FabricDetailRegistries { + /** + * Detail provider for {@link FluidVariant}s. + */ + public static final DetailRegistry> FLUID_VARIANT = ComputerCraftAPIFabricService.get().getFluidDetailRegistry(); +} diff --git a/projects/fabric-api/src/main/java/dan200/computercraft/api/node/wired/WiredElementLookup.java b/projects/fabric-api/src/main/java/dan200/computercraft/api/node/wired/WiredElementLookup.java new file mode 100644 index 000000000..4e25c6fbe --- /dev/null +++ b/projects/fabric-api/src/main/java/dan200/computercraft/api/node/wired/WiredElementLookup.java @@ -0,0 +1,29 @@ +/* + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ +package dan200.computercraft.api.node.wired; + +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.network.wired.IWiredElement; +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup; +import net.minecraft.core.Direction; +import net.minecraft.resources.ResourceLocation; + +/** + * {@linkplain BlockApiLookup Block API lookup} for {@link IWiredElement}s. This should be used to query wired elements + * from a block. + */ +public final class WiredElementLookup { + public static final ResourceLocation ID = new ResourceLocation(ComputerCraftAPI.MOD_ID, "wired_node"); + + private static final BlockApiLookup lookup = BlockApiLookup.get(ID, IWiredElement.class, Direction.class); + + private WiredElementLookup() { + } + + public static BlockApiLookup get() { + return lookup; + } +} diff --git a/projects/fabric-api/src/main/java/dan200/computercraft/api/peripheral/PeripheralLookup.java b/projects/fabric-api/src/main/java/dan200/computercraft/api/peripheral/PeripheralLookup.java new file mode 100644 index 000000000..ae00f7dc7 --- /dev/null +++ b/projects/fabric-api/src/main/java/dan200/computercraft/api/peripheral/PeripheralLookup.java @@ -0,0 +1,28 @@ +/* + * This file is part of the public ComputerCraft API - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. This API may be redistributed unmodified and in full only. + * For help using the API, and posting your mods, visit the forums at computercraft.info. + */ +package dan200.computercraft.api.peripheral; + +import dan200.computercraft.api.ComputerCraftAPI; +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup; +import net.minecraft.core.Direction; +import net.minecraft.resources.ResourceLocation; + +/** + * {@linkplain BlockApiLookup Block API lookup} for {@link IPeripheral}s. This should be used to register peripherals + * for a block. It should NOT be used to query peripherals. + */ +public final class PeripheralLookup { + public static final ResourceLocation ID = new ResourceLocation(ComputerCraftAPI.MOD_ID, "peripheral"); + + private static final BlockApiLookup lookup = BlockApiLookup.get(ID, IPeripheral.class, Direction.class); + + private PeripheralLookup() { + } + + public static BlockApiLookup get() { + return lookup; + } +} diff --git a/projects/fabric-api/src/main/java/dan200/computercraft/impl/ComputerCraftAPIFabricService.java b/projects/fabric-api/src/main/java/dan200/computercraft/impl/ComputerCraftAPIFabricService.java new file mode 100644 index 000000000..49a574fe2 --- /dev/null +++ b/projects/fabric-api/src/main/java/dan200/computercraft/impl/ComputerCraftAPIFabricService.java @@ -0,0 +1,25 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.impl; + +import dan200.computercraft.api.detail.DetailRegistry; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; +import org.jetbrains.annotations.ApiStatus; + +/** + * A Fabric-specific version of {@link ComputerCraftAPIService}. + *

+ * Do NOT directly reference this class. It exists for internal use by the API. + */ +@ApiStatus.Internal +public interface ComputerCraftAPIFabricService extends ComputerCraftAPIService { + static ComputerCraftAPIFabricService get() { + return (ComputerCraftAPIFabricService) ComputerCraftAPIService.get(); + } + + DetailRegistry> getFluidDetailRegistry(); +} diff --git a/projects/fabric/build.gradle.kts b/projects/fabric/build.gradle.kts new file mode 100644 index 000000000..1c052b724 --- /dev/null +++ b/projects/fabric/build.gradle.kts @@ -0,0 +1,155 @@ +import cc.tweaked.gradle.annotationProcessorEverywhere +import cc.tweaked.gradle.clientClasses +import cc.tweaked.gradle.commonClasses +import net.fabricmc.loom.configuration.ide.RunConfigSettings + +plugins { + id("cc-tweaked.fabric") + id("cc-tweaked.gametest") +} + +val modVersion: String by extra +val mcVersion: String by extra + +val allProjects = listOf(":core-api", ":core", ":fabric-api").map { evaluationDependsOn(it) } +cct { + inlineProject(":common") + allProjects.forEach { externalSources(it) } +} + +dependencies { + modImplementation(libs.bundles.externalMods.fabric) + modCompileOnly(libs.bundles.externalMods.fabric.compile) { + exclude("net.fabricmc", "fabric-loader") + exclude("net.fabricmc.fabric-api") + } + modClientRuntimeOnly(libs.bundles.externalMods.fabric.runtime) { + exclude("net.fabricmc", "fabric-loader") + exclude("net.fabricmc.fabric-api") + } + + include(libs.cobalt) + include(libs.netty.http) // It might be better to shadowJar this, as we don't use half of it. + include(libs.forgeConfig) + include(libs.nightConfig.core) + include(libs.nightConfig.toml) + + // Pull in our other projects. See comments in MinecraftConfigurations on this nastiness. + implementation(project(":core")) + compileOnly(project(":forge-stubs")) + implementation(commonClasses(project(":fabric-api"))) + clientImplementation(clientClasses(project(":fabric-api"))) + + annotationProcessorEverywhere(libs.autoService) + + testModImplementation(testFixtures(project(":core"))) + testModImplementation(testFixtures(project(":fabric"))) + + testImplementation(libs.byteBuddyAgent) + testImplementation(libs.bundles.test) + testRuntimeOnly(libs.bundles.testRuntime) +} + +sourceSets.main { resources.srcDir("src/generated/resources") } + +loom { + accessWidenerPath.set(project(":common").file("src/main/resources/computercraft.accesswidener")) + mixin.defaultRefmapName.set("computercraft.refmap.json") + + mods { + register("computercraft") { + // Configure sources when running via the IDE. Note these don't add build dependencies (hence why it's safe + // to use common), only change how the launch.cfg file is generated. + cct.sourceDirectories.get().forEach { sourceSet(it.sourceSet) } + + // Running via Gradle + dependency(dependencies.project(":core").apply { isTransitive = false }) + } + + register("cctest") { + sourceSet(sourceSets.testMod.get()) + sourceSet(project(":common").sourceSets.testMod.get()) + } + } + + runs { + configureEach { + ideConfigGenerated(true) + } + + named("client") { + configName = "Client" + } + + named("server") { + configName = "Server" + runDir("run/server") + } + + register("data") { + configName = "Datagen" + server() + + runDir("run/dataGen") + property("cct.pretty-json") + property("fabric-api.datagen") + property("fabric-api.datagen.output-dir", file("src/generated/resources").absolutePath) + property("fabric-api.datagen.strict-validation") + } + + fun configureForGameTest(config: RunConfigSettings) = config.run { + source(sourceSets.testMod.get()) + + val testSources = project(":common").file("src/testMod/resources/data/cctest").absolutePath + property("cctest.sources", testSources) + + // Load cctest last, so it can override resources. This bypasses Fabric's shuffling of mods + property("fabric.debug.loadLate", "cctest") + } + + val testClient by registering { + configName = "Test Client" + client() + configureForGameTest(this) + + runDir("run/testClient") + } + + register("gametest") { + configName = "Game Test" + server() + configureForGameTest(this) + + property("fabric-api.gametest") + property("fabric-api.gametest.report-file", project.buildDir.resolve("test-results/gametest/gametest.xml").absolutePath) + runDir("run/gametest") + } + } +} + +tasks.processResources { + inputs.property("version", modVersion) + + filesMatching("fabric.mod.json") { + expand(mapOf("version" to modVersion)) + } + exclude(".cache") +} + +tasks.jar { + from(allProjects.map { zipTree(it.tasks.jar.get().archiveFile) }) +} + +val validateMixinNames by tasks.registering(net.fabricmc.loom.task.ValidateMixinNameTask::class) { + source(sourceSets.main.get().output) + source(sourceSets.client.get().output) + source(sourceSets.testMod.get().output) +} + +tasks.test { dependsOn(tasks.generateDLIConfig) } + +val runGametest = tasks.named("runGametest") + +cct.jacoco(runGametest) + +tasks.check { dependsOn(validateMixinNames, runGametest) } diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/ComputerCraftClient.java b/projects/fabric/src/client/java/dan200/computercraft/client/ComputerCraftClient.java new file mode 100644 index 000000000..841ef13bb --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/ComputerCraftClient.java @@ -0,0 +1,71 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client; + +import dan200.computercraft.client.model.turtle.TurtleModelLoader; +import dan200.computercraft.shared.ModRegistry; +import dan200.computercraft.shared.network.client.ClientNetworkContext; +import dan200.computercraft.shared.peripheral.modem.wired.CableBlock; +import dan200.computercraft.shared.platform.NetworkHandler; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; +import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry; +import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; +import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry; +import net.fabricmc.fabric.api.client.rendering.v1.ColorProviderRegistry; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; +import net.fabricmc.fabric.api.event.client.player.ClientPickBlockGatherCallback; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; + +import static dan200.computercraft.core.util.Nullability.assertNonNull; + +public class ComputerCraftClient { + public static void init() { + ClientPlayNetworking.registerGlobalReceiver(NetworkHandler.ID, (client, handler, buf, responseSender) -> { + var packet = NetworkHandler.decodeClient(buf); + if (packet != null) client.execute(() -> packet.handle(ClientNetworkContext.get())); + }); + + ClientRegistry.register(); + ClientRegistry.registerItemColours(ColorProviderRegistry.ITEM::register); + ClientRegistry.registerBlockEntityRenderers(BlockEntityRendererRegistry::register); + ClientRegistry.registerMainThread(); + + + ModelLoadingRegistry.INSTANCE.registerModelProvider((manager, out) -> ClientRegistry.registerExtraModels(out)); + ModelLoadingRegistry.INSTANCE.registerResourceProvider(loader -> (path, ctx) -> TurtleModelLoader.load(loader, path)); + BlockRenderLayerMap.INSTANCE.putBlock(ModRegistry.Blocks.MONITOR_NORMAL.get(), RenderType.cutout()); + BlockRenderLayerMap.INSTANCE.putBlock(ModRegistry.Blocks.MONITOR_ADVANCED.get(), RenderType.cutout()); + + ClientTickEvents.START_CLIENT_TICK.register(client -> ClientHooks.onTick()); + // This isn't 100% consistent with Forge, but not worth a mixin. + WorldRenderEvents.START.register(context -> ClientHooks.onRenderTick()); + WorldRenderEvents.BLOCK_OUTLINE.register((context, hitResult) -> { + var hit = Minecraft.getInstance().hitResult; + if (hit instanceof BlockHitResult blockHit && blockHit.getBlockPos().equals(hitResult.blockPos())) { + return !ClientHooks.drawHighlight(context.matrixStack(), assertNonNull(context.consumers()), context.camera(), blockHit); + } else { + return true; + } + }); + + // Easier to hook in as an event than use BlockPickInteractionAware. + ClientPickBlockGatherCallback.EVENT.register((player, hit) -> { + if (hit.getType() != HitResult.Type.BLOCK) return ItemStack.EMPTY; + + var pos = ((BlockHitResult) hit).getBlockPos(); + var level = Minecraft.getInstance().level; + var state = level.getBlockState(pos); + if (!(state.getBlock() instanceof CableBlock cable)) return ItemStack.EMPTY; + + return cable.getCloneItemStack(state, hit, level, pos, player); + }); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/integration/IrisShaderMod.java b/projects/fabric/src/client/java/dan200/computercraft/client/integration/IrisShaderMod.java new file mode 100644 index 000000000..e0d7a9f3c --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/integration/IrisShaderMod.java @@ -0,0 +1,72 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.integration; + +import com.google.auto.service.AutoService; +import com.mojang.blaze3d.vertex.VertexFormat; +import dan200.computercraft.client.render.RenderTypes; +import dan200.computercraft.client.render.text.DirectFixedWidthFontRenderer; +import net.fabricmc.loader.api.FabricLoader; +import net.irisshaders.iris.api.v0.IrisApi; +import net.irisshaders.iris.api.v0.IrisTextVertexSink; + +import java.nio.ByteBuffer; +import java.util.Optional; +import java.util.function.IntFunction; + +@AutoService(ShaderMod.Provider.class) +public class IrisShaderMod implements ShaderMod.Provider { + @Override + public Optional get() { + return FabricLoader.getInstance().isModLoaded("iris") ? Optional.of(new Impl()) : Optional.empty(); + } + + private static final class Impl extends ShaderMod { + @Override + public boolean isRenderingShadowPass() { + return IrisApi.getInstance().isRenderingShadowPass(); + } + + @Override + public boolean isShaderMod() { + return true; + } + + @Override + public DirectFixedWidthFontRenderer.QuadEmitter getQuadEmitter(int vertexCount, IntFunction makeBuffer) { + return IrisApi.getInstance().getMinorApiRevision() >= 1 + ? new IrisQuadEmitter(vertexCount, makeBuffer) + : super.getQuadEmitter(vertexCount, makeBuffer); + } + + private static final class IrisQuadEmitter implements DirectFixedWidthFontRenderer.QuadEmitter { + private final IrisTextVertexSink sink; + + private IrisQuadEmitter(int vertexCount, IntFunction makeBuffer) { + sink = IrisApi.getInstance().createTextVertexSink(vertexCount, makeBuffer); + } + + @Override + public VertexFormat format() { + return sink.getUnderlyingVertexFormat(); + } + + @Override + public ByteBuffer buffer() { + return sink.getUnderlyingByteBuffer(); + } + + @Override + public void quad(float x1, float y1, float x2, float y2, float z, byte[] rgba, float u1, float v1, float u2, float v2) { + sink.quad(x1, y1, x2, y2, z, pack(rgba[0], rgba[1], rgba[2], rgba[3]), u1, v1, u2, v2, RenderTypes.FULL_BRIGHT_LIGHTMAP); + } + + private static int pack(int r, int g, int b, int a) { + return (a & 255) << 24 | (b & 255) << 16 | (g & 255) << 8 | r & 255; + } + } + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/integration/rei/REIComputerCraft.java b/projects/fabric/src/client/java/dan200/computercraft/client/integration/rei/REIComputerCraft.java new file mode 100644 index 000000000..d94e30ef1 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/integration/rei/REIComputerCraft.java @@ -0,0 +1,55 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.integration.rei; + +import dan200.computercraft.api.turtle.TurtleSide; +import dan200.computercraft.shared.ModRegistry; +import dan200.computercraft.shared.integration.RecipeModHelpers; +import dan200.computercraft.shared.pocket.items.PocketComputerItem; +import dan200.computercraft.shared.turtle.items.TurtleItem; +import dev.architectury.event.EventResult; +import me.shedaniel.rei.api.client.plugins.REIClientPlugin; +import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; +import me.shedaniel.rei.api.common.entry.comparison.ItemComparatorRegistry; +import me.shedaniel.rei.plugin.common.BuiltinPlugin; + +/** + * REI integration for ComputerCraft. + *

+ * This is Fabric-only for now - getting the common jar working outside of architectury is awkward. + */ +public class REIComputerCraft implements REIClientPlugin { + @Override + public void registerItemComparators(ItemComparatorRegistry registry) { + registry.register((context, stack) -> { + var turtle = (TurtleItem) stack.getItem(); + + long hash = 1; + + var left = turtle.getUpgrade(stack, TurtleSide.LEFT); + var right = turtle.getUpgrade(stack, TurtleSide.RIGHT); + if (left != null) hash = hash * 31 + left.getUpgradeID().hashCode(); + if (right != null) hash = hash * 31 + right.getUpgradeID().hashCode(); + + return hash; + }, ModRegistry.Items.TURTLE_NORMAL.get(), ModRegistry.Items.TURTLE_ADVANCED.get()); + + registry.register((context, stack) -> { + var upgrade = PocketComputerItem.getUpgrade(stack); + return upgrade == null ? 1 : upgrade.getUpgradeID().hashCode(); + }, ModRegistry.Items.POCKET_COMPUTER_NORMAL.get(), ModRegistry.Items.POCKET_COMPUTER_ADVANCED.get()); + } + + @Override + public void registerDisplays(DisplayRegistry registry) { + registry.registerDisplayGenerator(BuiltinPlugin.CRAFTING, new UpgradeDisplayGenerator()); + + // Hide all upgrade recipes + registry.registerVisibilityPredicate((category, display) -> + display.getDisplayLocation().map(RecipeModHelpers::shouldRemoveRecipe).orElse(false) + ? EventResult.interruptFalse() : EventResult.pass()); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/integration/rei/UpgradeDisplayGenerator.java b/projects/fabric/src/client/java/dan200/computercraft/client/integration/rei/UpgradeDisplayGenerator.java new file mode 100644 index 000000000..8cbe0a34c --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/integration/rei/UpgradeDisplayGenerator.java @@ -0,0 +1,32 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.integration.rei; + +import dan200.computercraft.shared.integration.UpgradeRecipeGenerator; +import me.shedaniel.rei.api.client.registry.display.DynamicDisplayGenerator; +import me.shedaniel.rei.api.common.entry.EntryStack; +import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes; +import me.shedaniel.rei.plugin.common.displays.crafting.DefaultCraftingDisplay; + +import java.util.List; +import java.util.Optional; + +/** + * Provides custom recipe and usage hints for pocket/turtle upgrades. + */ +class UpgradeDisplayGenerator implements DynamicDisplayGenerator> { + private final UpgradeRecipeGenerator> resolver = new UpgradeRecipeGenerator<>(DefaultCraftingDisplay::of); + + @Override + public Optional>> getRecipeFor(EntryStack entry) { + return entry.getType() == VanillaEntryTypes.ITEM ? Optional.of(resolver.findRecipesWithOutput(entry.castValue())) : Optional.empty(); + } + + @Override + public Optional>> getUsageFor(EntryStack entry) { + return entry.getType() == VanillaEntryTypes.ITEM ? Optional.of(resolver.findRecipesWithInput(entry.castValue())) : Optional.empty(); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/model/CompositeBakedModel.java b/projects/fabric/src/client/java/dan200/computercraft/client/model/CompositeBakedModel.java new file mode 100644 index 000000000..6937b4c6b --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/model/CompositeBakedModel.java @@ -0,0 +1,74 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.model; + +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.block.state.BlockState; + +import javax.annotation.Nullable; +import java.util.*; +import java.util.stream.Stream; + +/** + * A {@link BakedModel} formed from two or more other models stitched together. + */ +public class CompositeBakedModel extends CustomBakedModel { + private final List models; + + public CompositeBakedModel(List models) { + super(models.get(0)); + this.models = models; + } + + @Override + public List getQuads(@Nullable BlockState blockState, @Nullable Direction face, RandomSource rand) { + @SuppressWarnings({ "unchecked", "rawtypes" }) + List[] quads = new List[models.size()]; + + var i = 0; + for (var model : models) quads[i++] = model.getQuads(blockState, face, rand); + return new ConcatListView(quads); + } + + private static final class ConcatListView extends AbstractList { + private final List[] quads; + + private ConcatListView(List[] quads) { + this.quads = quads; + } + + @Override + public Iterator iterator() { + return stream().iterator(); + } + + @Override + public Stream stream() { + return Arrays.stream(quads).flatMap(Collection::stream); + } + + @Override + public BakedQuad get(int index) { + var i = index; + for (var modelQuads : quads) { + if (i < modelQuads.size()) return modelQuads.get(i); + i -= modelQuads.size(); + } + + throw new IndexOutOfBoundsException(i); + } + + @Override + public int size() { + var size = 0; + for (var modelQuads : quads) size += modelQuads.size(); + return size; + } + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/model/CustomBakedModel.java b/projects/fabric/src/client/java/dan200/computercraft/client/model/CustomBakedModel.java new file mode 100644 index 000000000..a2b86c815 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/model/CustomBakedModel.java @@ -0,0 +1,43 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.model; + +import net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel; +import net.fabricmc.fabric.api.renderer.v1.render.RenderContext; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.block.state.BlockState; + +import javax.annotation.Nullable; +import java.util.List; +import java.util.function.Supplier; + +/** + * A subclass of {@link ForwardingBakedModel} which doesn't forward rendering. + */ +public abstract class CustomBakedModel extends ForwardingBakedModel { + public CustomBakedModel(BakedModel wrapped) { + this.wrapped = wrapped; + } + + @Override + public abstract List getQuads(@Nullable BlockState blockState, @Nullable Direction face, RandomSource rand); + + @Override + public final void emitBlockQuads(BlockAndTintGetter blockView, BlockState state, BlockPos pos, Supplier randomSupplier, RenderContext context) { + context.fallbackConsumer().accept(this); + } + + @Override + public final void emitItemQuads(ItemStack stack, Supplier randomSupplier, RenderContext context) { + context.fallbackConsumer().accept(this); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/model/TransformedBakedModel.java b/projects/fabric/src/client/java/dan200/computercraft/client/model/TransformedBakedModel.java new file mode 100644 index 000000000..f73d45835 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/model/TransformedBakedModel.java @@ -0,0 +1,89 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.model; + +import com.mojang.blaze3d.vertex.DefaultVertexFormat; +import com.mojang.blaze3d.vertex.VertexFormat; +import com.mojang.blaze3d.vertex.VertexFormatElement; +import com.mojang.math.Matrix4f; +import com.mojang.math.Transformation; +import com.mojang.math.Vector4f; +import net.minecraft.client.renderer.block.model.BakedQuad; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.block.state.BlockState; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +/** + * A {@link BakedModel} which applies a transformation matrix to its underlying quads. + */ +public class TransformedBakedModel extends CustomBakedModel { + private static final int STRIDE = DefaultVertexFormat.BLOCK.getIntegerSize(); + private static final int POS_OFFSET = findOffset(DefaultVertexFormat.BLOCK, DefaultVertexFormat.ELEMENT_POSITION); + + private final Matrix4f transformation; + private @Nullable TransformedQuads cache; + + public TransformedBakedModel(BakedModel model, Transformation transformation) { + super(model); + this.transformation = transformation.getMatrix(); + } + + @Override + public List getQuads(@Nullable BlockState blockState, @Nullable Direction face, RandomSource rand) { + var cache = this.cache; + var quads = wrapped.getQuads(blockState, face, rand); + if (quads.isEmpty()) return List.of(); + + // We do some basic caching here to avoid recomputing every frame. Most turtle models don't have culled faces, + // so it's not worth being smarter here. + if (cache != null && quads.equals(cache.original())) return cache.transformed(); + + List transformed = new ArrayList<>(quads.size()); + for (var quad : quads) transformed.add(transformQuad(quad)); + this.cache = new TransformedQuads(quads, transformed); + return transformed; + } + + private BakedQuad transformQuad(BakedQuad quad) { + var vertexData = quad.getVertices().clone(); + for (var i = 0; i < 4; i++) { + // Apply the matrix to our position + var start = STRIDE * i + POS_OFFSET; + + var x = Float.intBitsToFloat(vertexData[start]); + var y = Float.intBitsToFloat(vertexData[start + 1]); + var z = Float.intBitsToFloat(vertexData[start + 2]); + + // Transform the position + var pos = new Vector4f(x, y, z, 1); + pos.transform(transformation); + pos.perspectiveDivide(); + + vertexData[start] = Float.floatToRawIntBits(pos.x()); + vertexData[start + 1] = Float.floatToRawIntBits(pos.y()); + vertexData[start + 2] = Float.floatToRawIntBits(pos.z()); + } + + return new BakedQuad(vertexData, quad.getTintIndex(), quad.getDirection(), quad.getSprite(), quad.isShade()); + } + + private record TransformedQuads(List original, List transformed) { + } + + private static int findOffset(VertexFormat format, VertexFormatElement element) { + var offset = 0; + for (var other : format.getElements()) { + if (other == element) return offset / Integer.BYTES; + offset += element.getByteSize(); + } + throw new IllegalArgumentException("Cannot find " + element + " in " + format); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/model/turtle/TurtleModel.java b/projects/fabric/src/client/java/dan200/computercraft/client/model/turtle/TurtleModel.java new file mode 100644 index 000000000..c851c393d --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/model/turtle/TurtleModel.java @@ -0,0 +1,46 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.model.turtle; + +import dan200.computercraft.client.model.CompositeBakedModel; +import dan200.computercraft.client.model.TransformedBakedModel; +import net.fabricmc.fabric.api.renderer.v1.model.ForwardingBakedModel; +import net.minecraft.client.multiplayer.ClientLevel; +import net.minecraft.client.renderer.block.model.ItemOverrides; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.item.ItemStack; + +import javax.annotation.Nullable; +import java.util.HashMap; +import java.util.Map; + +public class TurtleModel extends ForwardingBakedModel { + private final TurtleModelParts parts; + + private final Map cachedModels = new HashMap<>(); + private final ItemOverrides overrides = new ItemOverrides() { + @Override + public BakedModel resolve(BakedModel model, ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int seed) { + return cachedModels.computeIfAbsent(parts.getCombination(stack), TurtleModel.this::buildModel); + } + }; + + public TurtleModel(BakedModel familyModel, BakedModel colourModel) { + wrapped = familyModel; + parts = new TurtleModelParts(familyModel, colourModel, TransformedBakedModel::new); + } + + @Override + public ItemOverrides getOverrides() { + return overrides; + } + + private BakedModel buildModel(TurtleModelParts.Combination combo) { + var models = parts.buildModel(combo); + return models.size() == 1 ? models.get(0) : new CompositeBakedModel(models); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/model/turtle/TurtleModelLoader.java b/projects/fabric/src/client/java/dan200/computercraft/client/model/turtle/TurtleModelLoader.java new file mode 100644 index 000000000..9ed6c425f --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/model/turtle/TurtleModelLoader.java @@ -0,0 +1,78 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.model.turtle; + +import com.mojang.datafixers.util.Pair; +import dan200.computercraft.api.ComputerCraftAPI; +import net.fabricmc.fabric.api.client.model.ModelProviderException; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.resources.model.*; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.util.GsonHelper; + +import javax.annotation.Nullable; +import java.io.IOException; +import java.util.*; +import java.util.function.Function; + +public final class TurtleModelLoader { + private static final ResourceLocation COLOUR_TURTLE_MODEL = new ResourceLocation(ComputerCraftAPI.MOD_ID, "block/turtle_colour"); + + private TurtleModelLoader() { + } + + public static @Nullable UnbakedModel load(ResourceManager resources, ResourceLocation path) throws ModelProviderException { + if (!path.getNamespace().equals(ComputerCraftAPI.MOD_ID)) return null; + if (!path.getPath().equals("item/turtle_normal") && !path.getPath().equals("item/turtle_advanced")) { + return null; + } + + try (var reader = resources.openAsReader(new ResourceLocation(path.getNamespace(), "models/" + path.getPath() + ".json"))) { + var modelContents = GsonHelper.parse(reader).getAsJsonObject(); + + var loader = GsonHelper.getAsString(modelContents, "loader", null); + if (!Objects.equals(loader, ComputerCraftAPI.MOD_ID + ":turtle")) return null; + + var model = new ResourceLocation(GsonHelper.getAsString(modelContents, "model")); + return new Unbaked(model); + } catch (IOException e) { + throw new ModelProviderException("Failed loading model " + path, e); + } + } + + public static final class Unbaked implements UnbakedModel { + private final ResourceLocation model; + + private Unbaked(ResourceLocation model) { + this.model = model; + } + + @Override + public Collection getDependencies() { + return List.of(model, COLOUR_TURTLE_MODEL); + } + + @Override + public Collection getMaterials(Function modelGetter, Set> missingTextureErrors) { + Set materials = new HashSet<>(); + materials.addAll(modelGetter.apply(model).getMaterials(modelGetter, missingTextureErrors)); + materials.addAll(modelGetter.apply(COLOUR_TURTLE_MODEL).getMaterials(modelGetter, missingTextureErrors)); + return materials; + } + + @Override + public BakedModel bake(ModelBakery bakery, Function spriteGetter, ModelState transform, ResourceLocation location) { + var mainModel = bakery.bake(model, transform); + if (mainModel == null) throw new NullPointerException(model + " failed to bake"); + + var colourModel = bakery.bake(COLOUR_TURTLE_MODEL, transform); + if (colourModel == null) throw new NullPointerException(COLOUR_TURTLE_MODEL + " failed to bake"); + + return new TurtleModel(mainModel, colourModel); + } + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientNetworkHandlerImpl.java b/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientNetworkHandlerImpl.java new file mode 100644 index 000000000..de12deb18 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientNetworkHandlerImpl.java @@ -0,0 +1,25 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.platform; + +import com.google.auto.service.AutoService; +import dan200.computercraft.shared.network.client.ClientNetworkContext; +import net.minecraft.client.Minecraft; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.sounds.SoundEvent; + +import javax.annotation.Nullable; + +@AutoService(ClientNetworkContext.class) +public class ClientNetworkHandlerImpl extends AbstractClientNetworkContext { + @Override + public void handlePlayRecord(BlockPos pos, @Nullable SoundEvent sound, @Nullable String name) { + var mc = Minecraft.getInstance(); + mc.levelRenderer.playStreamingMusic(sound, pos); + if (name != null) mc.gui.setNowPlaying(Component.literal(name)); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java b/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java new file mode 100644 index 000000000..2f980772d --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/client/platform/ClientPlatformHelperImpl.java @@ -0,0 +1,30 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.client.platform; + +import com.google.auto.service.AutoService; +import dan200.computercraft.shared.network.NetworkMessage; +import dan200.computercraft.shared.network.server.ServerNetworkContext; +import dan200.computercraft.shared.platform.NetworkHandler; +import net.fabricmc.fabric.api.client.model.BakedModelManagerHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.client.resources.model.ModelManager; +import net.minecraft.resources.ResourceLocation; + +@AutoService(dan200.computercraft.impl.client.ClientPlatformHelper.class) +public class ClientPlatformHelperImpl implements ClientPlatformHelper { + @Override + public void sendToServer(NetworkMessage message) { + Minecraft.getInstance().player.connection.send(NetworkHandler.encodeServer(message)); + } + + @Override + public BakedModel getModel(ModelManager manager, ResourceLocation location) { + var model = BakedModelManagerHelper.getModel(manager, location); + return model == null ? manager.getMissingModel() : model; + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/BlockRenderDispatcherMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/BlockRenderDispatcherMixin.java new file mode 100644 index 000000000..68e041315 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/BlockRenderDispatcherMixin.java @@ -0,0 +1,67 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import dan200.computercraft.client.ClientHooks; +import net.minecraft.client.renderer.block.BlockModelShaper; +import net.minecraft.client.renderer.block.BlockRenderDispatcher; +import net.minecraft.client.renderer.block.ModelBlockRenderer; +import net.minecraft.client.renderer.texture.OverlayTexture; +import net.minecraft.core.BlockPos; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.BlockAndTintGetter; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +/** + * Provides custom block breaking progress for modems, so it only applies to the current part. + * + * @see BlockRenderDispatcher#renderBreakingTexture(BlockState, BlockPos, BlockAndTintGetter, PoseStack, VertexConsumer) + */ +@Mixin(BlockRenderDispatcher.class) +class BlockRenderDispatcherMixin { + @Shadow + @Final + private RandomSource random; + + @Shadow + @Final + private BlockModelShaper blockModelShaper; + + @Shadow + @Final + private ModelBlockRenderer modelRenderer; + + @Inject( + method = "renderBreakingTexture", + at = @At("HEAD"), + cancellable = true, + require = 0 // This isn't critical functionality, so don't worry if we can't apply it. + ) + @SuppressWarnings("UnusedMethod") + private void renderBlockDamage( + BlockState state, BlockPos pos, BlockAndTintGetter world, PoseStack pose, VertexConsumer buffers, + CallbackInfo info + ) { + var newState = ClientHooks.getBlockBreakingState(state, pos); + if (newState != null) { + info.cancel(); + + var model = blockModelShaper.getBlockModel(newState); + modelRenderer.tesselateBlock( + world, model, newState, pos, pose, buffers, true, random, newState.getSeed(pos), + OverlayTexture.NO_OVERLAY + ); + } + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/DebugScreenOverlayMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/DebugScreenOverlayMixin.java new file mode 100644 index 000000000..e465275ab --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/DebugScreenOverlayMixin.java @@ -0,0 +1,24 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import dan200.computercraft.client.ClientHooks; +import net.minecraft.client.gui.components.DebugScreenOverlay; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.List; + +@Mixin(DebugScreenOverlay.class) +class DebugScreenOverlayMixin { + @Inject(method = "getSystemInformation", at = @At("RETURN")) + @SuppressWarnings("UnusedMethod") + private void appendDebugInfo(CallbackInfoReturnable> cir) { + ClientHooks.addDebugInfo(cir.getReturnValue()::add); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/GameRendererMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/GameRendererMixin.java new file mode 100644 index 000000000..aa31a3070 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/GameRendererMixin.java @@ -0,0 +1,42 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import dan200.computercraft.client.ClientRegistry; +import net.minecraft.client.renderer.GameRenderer; +import net.minecraft.client.renderer.ShaderInstance; +import net.minecraft.server.packs.resources.ResourceManager; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Map; + +@Mixin(GameRenderer.class) +class GameRendererMixin { + @Final + @Shadow + @SuppressWarnings("NullAway") + private Map shaders; + + @Inject(method = "reloadShaders", at = @At(value = "TAIL")) + @SuppressWarnings("UnusedMethod") + private void onReloadShaders(ResourceManager resourceManager, CallbackInfo ci) { + try { + ClientRegistry.registerShaders(resourceManager, (shader, callback) -> { + shaders.put(shader.getName(), shader); + callback.accept(shader); + }); + } catch (IOException e) { + throw new UncheckedIOException("Could not reload shaders", e); + } + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java new file mode 100644 index 000000000..eb4c35d40 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemFrameRendererMixin.java @@ -0,0 +1,30 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import com.mojang.blaze3d.vertex.PoseStack; +import dan200.computercraft.client.ClientHooks; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.ItemFrameRenderer; +import net.minecraft.world.entity.decoration.ItemFrame; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ItemFrameRenderer.class) +@SuppressWarnings("UnusedMethod") +class ItemFrameRendererMixin { + @Inject( + method = "render(Lnet/minecraft/world/entity/decoration/ItemFrame;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", + at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;mulPose(Lcom/mojang/math/Quaternion;)V", ordinal = 2, shift = At.Shift.AFTER), + cancellable = true + ) + @SuppressWarnings("UnusedMethod") + private void render(ItemFrame entity, float yaw, float partialTicks, PoseStack pose, MultiBufferSource buffers, int light, CallbackInfo ci) { + if (ClientHooks.onRenderItemFrame(pose, buffers, entity, entity.getItem(), light)) ci.cancel(); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemInHandRendererMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemInHandRendererMixin.java new file mode 100644 index 000000000..9f28931e4 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/ItemInHandRendererMixin.java @@ -0,0 +1,32 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import com.mojang.blaze3d.vertex.PoseStack; +import dan200.computercraft.client.ClientHooks; +import net.minecraft.client.player.AbstractClientPlayer; +import net.minecraft.client.renderer.ItemInHandRenderer; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ItemInHandRenderer.class) +class ItemInHandRendererMixin { + @Inject(method = "renderArmWithItem", at = @At("HEAD"), cancellable = true) + @SuppressWarnings("UnusedMethod") + private void onRenderItem( + AbstractClientPlayer player, float partialTicks, float pitch, InteractionHand hand, float swingProgress, ItemStack stack, + float equippedProgress, PoseStack transform, MultiBufferSource buffer, int combinedLight, CallbackInfo ci + ) { + if (ClientHooks.onRenderHeldItem(transform, buffer, combinedLight, hand, pitch, equippedProgress, swingProgress, stack)) { + ci.cancel(); + } + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MinecraftMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MinecraftMixin.java new file mode 100644 index 000000000..f1bd2f72b --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MinecraftMixin.java @@ -0,0 +1,30 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import dan200.computercraft.client.ClientHooks; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.screens.Screen; +import net.minecraft.client.multiplayer.ClientLevel; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(Minecraft.class) +class MinecraftMixin { + @Inject(method = "clearLevel(Lnet/minecraft/client/gui/screens/Screen;)V", at = @At("HEAD")) + @SuppressWarnings("UnusedMethod") + private void clearLevel(Screen screen, CallbackInfo ci) { + ClientHooks.onWorldUnload(); + } + + @Inject(method = "setLevel", at = @At("HEAD")) + @SuppressWarnings("UnusedMethod") + private void setLevel(ClientLevel screen, CallbackInfo ci) { + ClientHooks.onWorldUnload(); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MultiPlayerGameModeMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MultiPlayerGameModeMixin.java new file mode 100644 index 000000000..6111b0c82 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/MultiPlayerGameModeMixin.java @@ -0,0 +1,39 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import dan200.computercraft.shared.FabricCommonHooks; +import net.minecraft.client.Minecraft; +import net.minecraft.client.multiplayer.MultiPlayerGameMode; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +@Mixin(MultiPlayerGameMode.class) +class MultiPlayerGameModeMixin { + @Shadow + @Final + private Minecraft minecraft; + + @Inject( + method = "destroyBlock", + at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;setBlock(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;I)Z"), + cancellable = true, + locals = LocalCapture.CAPTURE_FAILHARD + ) + @SuppressWarnings("UnusedMethod") + private void onBlockBreak(BlockPos pos, CallbackInfoReturnable cir, Level level, BlockState state, Block block) { + if (!FabricCommonHooks.onBlockDestroy(level, minecraft.player, pos, state, null)) cir.setReturnValue(true); + } +} diff --git a/projects/fabric/src/client/java/dan200/computercraft/mixin/client/SoundEngineMixin.java b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/SoundEngineMixin.java new file mode 100644 index 000000000..9321e8934 --- /dev/null +++ b/projects/fabric/src/client/java/dan200/computercraft/mixin/client/SoundEngineMixin.java @@ -0,0 +1,40 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.client; + +import com.mojang.blaze3d.audio.Channel; +import dan200.computercraft.client.sound.SpeakerManager; +import net.minecraft.client.resources.sounds.SoundInstance; +import net.minecraft.client.sounds.AudioStream; +import net.minecraft.client.sounds.SoundEngine; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import javax.annotation.Nullable; + +import static dan200.computercraft.core.util.Nullability.assertNonNull; + +@Mixin(SoundEngine.class) +class SoundEngineMixin { + @Nullable + @Unique + private static SoundEngine self; + + @Inject(method = "play", at = @At(value = "HEAD")) + @SuppressWarnings("UnusedMethod") + private void playSound(SoundInstance sound, CallbackInfo ci) { + self = (SoundEngine) (Object) this; + } + + @Inject(at = @At("TAIL"), method = "method_19755") + @SuppressWarnings("UnusedMethod") + private static void onStream(AudioStream stream, Channel channel, CallbackInfo ci) { + SpeakerManager.onPlayStreaming(assertNonNull(self), channel, stream); + } +} diff --git a/projects/fabric/src/client/resources/computercraft-client.fabric.mixins.json b/projects/fabric/src/client/resources/computercraft-client.fabric.mixins.json new file mode 100644 index 000000000..8c5a5543a --- /dev/null +++ b/projects/fabric/src/client/resources/computercraft-client.fabric.mixins.json @@ -0,0 +1,19 @@ +{ + "required": true, + "package": "dan200.computercraft.mixin.client", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_17", + "injectors": { + "defaultRequire": 1 + }, + "client": [ + "BlockRenderDispatcherMixin", + "DebugScreenOverlayMixin", + "GameRendererMixin", + "ItemFrameRendererMixin", + "ItemInHandRendererMixin", + "MinecraftMixin", + "MultiPlayerGameModeMixin", + "SoundEngineMixin" + ] +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/cable.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/cable.json new file mode 100644 index 000000000..a440c3e2c --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/cable.json @@ -0,0 +1,125 @@ +{ + "multipart": [ + { + "apply": {"model": "computercraft:block/cable_core_facing", "x": 90}, + "when": { + "OR": [ + {"cable": "true", "east": "false", "north": "false", "south": "false", "up": "true", "west": "false"}, + {"cable": "true", "down": "true", "east": "false", "north": "false", "south": "false", "west": "false"} + ] + } + }, + { + "apply": {"model": "computercraft:block/cable_core_facing", "y": 0}, + "when": { + "OR": [ + { + "cable": "true", + "down": "false", + "east": "false", + "north": "false", + "south": "false", + "up": "false", + "west": "false" + }, + {"cable": "true", "down": "false", "east": "false", "north": "true", "up": "false", "west": "false"}, + {"cable": "true", "down": "false", "east": "false", "south": "true", "up": "false", "west": "false"} + ] + } + }, + { + "apply": {"model": "computercraft:block/cable_core_facing", "y": 90}, + "when": { + "OR": [ + {"cable": "true", "down": "false", "east": "true", "north": "false", "south": "false", "up": "false"}, + {"cable": "true", "down": "false", "north": "false", "south": "false", "up": "false", "west": "true"} + ] + } + }, + { + "apply": {"model": "computercraft:block/cable_core_any"}, + "when": { + "OR": [ + {"cable": "true", "down": "true", "north": "true"}, + {"cable": "true", "down": "true", "south": "true"}, + {"cable": "true", "down": "true", "west": "true"}, + {"cable": "true", "down": "true", "east": "true"}, + {"cable": "true", "north": "true", "up": "true"}, + {"cable": "true", "south": "true", "up": "true"}, + {"cable": "true", "up": "true", "west": "true"}, + {"cable": "true", "east": "true", "up": "true"}, + {"cable": "true", "north": "true", "west": "true"}, + {"cable": "true", "east": "true", "north": "true"}, + {"cable": "true", "south": "true", "west": "true"}, + {"cable": "true", "east": "true", "south": "true"} + ] + } + }, + {"apply": {"model": "computercraft:block/cable_arm", "x": 270, "y": 0}, "when": {"down": "true"}}, + {"apply": {"model": "computercraft:block/cable_arm", "x": 90, "y": 0}, "when": {"up": "true"}}, + {"apply": {"model": "computercraft:block/cable_arm", "x": 0, "y": 180}, "when": {"north": "true"}}, + {"apply": {"model": "computercraft:block/cable_arm", "x": 0, "y": 0}, "when": {"south": "true"}}, + {"apply": {"model": "computercraft:block/cable_arm", "x": 0, "y": 90}, "when": {"west": "true"}}, + {"apply": {"model": "computercraft:block/cable_arm", "x": 0, "y": 270}, "when": {"east": "true"}}, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 90, "y": 0}, "when": {"modem": "down_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 90, "y": 0}, + "when": {"modem": "down_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 90, "y": 0}, "when": {"modem": "down_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 90, "y": 0}, + "when": {"modem": "down_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 270, "y": 0}, "when": {"modem": "up_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 270, "y": 0}, + "when": {"modem": "up_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 270, "y": 0}, "when": {"modem": "up_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 270, "y": 0}, + "when": {"modem": "up_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 0, "y": 0}, "when": {"modem": "north_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 0, "y": 0}, + "when": {"modem": "north_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 0, "y": 0}, "when": {"modem": "north_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 0, "y": 0}, + "when": {"modem": "north_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 0, "y": 180}, "when": {"modem": "south_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 0, "y": 180}, + "when": {"modem": "south_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 0, "y": 180}, "when": {"modem": "south_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 0, "y": 180}, + "when": {"modem": "south_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 0, "y": 270}, "when": {"modem": "west_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 0, "y": 270}, + "when": {"modem": "west_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 0, "y": 270}, "when": {"modem": "west_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 0, "y": 270}, + "when": {"modem": "west_on_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_off", "x": 0, "y": 90}, "when": {"modem": "east_off"}}, + { + "apply": {"model": "computercraft:block/wired_modem_off_peripheral", "x": 0, "y": 90}, + "when": {"modem": "east_off_peripheral"} + }, + {"apply": {"model": "computercraft:block/wired_modem_on", "x": 0, "y": 90}, "when": {"modem": "east_on"}}, + { + "apply": {"model": "computercraft:block/wired_modem_on_peripheral", "x": 0, "y": 90}, + "when": {"modem": "east_on_peripheral"} + } + ] +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_advanced.json new file mode 100644 index 000000000..5f5960311 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_advanced.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=east,state=blinking": {"model": "computercraft:block/computer_advanced_blinking", "y": 90}, + "facing=east,state=off": {"model": "computercraft:block/computer_advanced_off", "y": 90}, + "facing=east,state=on": {"model": "computercraft:block/computer_advanced_on", "y": 90}, + "facing=north,state=blinking": {"model": "computercraft:block/computer_advanced_blinking", "y": 0}, + "facing=north,state=off": {"model": "computercraft:block/computer_advanced_off", "y": 0}, + "facing=north,state=on": {"model": "computercraft:block/computer_advanced_on", "y": 0}, + "facing=south,state=blinking": {"model": "computercraft:block/computer_advanced_blinking", "y": 180}, + "facing=south,state=off": {"model": "computercraft:block/computer_advanced_off", "y": 180}, + "facing=south,state=on": {"model": "computercraft:block/computer_advanced_on", "y": 180}, + "facing=west,state=blinking": {"model": "computercraft:block/computer_advanced_blinking", "y": 270}, + "facing=west,state=off": {"model": "computercraft:block/computer_advanced_off", "y": 270}, + "facing=west,state=on": {"model": "computercraft:block/computer_advanced_on", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_command.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_command.json new file mode 100644 index 000000000..2077c3fbf --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_command.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=east,state=blinking": {"model": "computercraft:block/computer_command_blinking", "y": 90}, + "facing=east,state=off": {"model": "computercraft:block/computer_command_off", "y": 90}, + "facing=east,state=on": {"model": "computercraft:block/computer_command_on", "y": 90}, + "facing=north,state=blinking": {"model": "computercraft:block/computer_command_blinking", "y": 0}, + "facing=north,state=off": {"model": "computercraft:block/computer_command_off", "y": 0}, + "facing=north,state=on": {"model": "computercraft:block/computer_command_on", "y": 0}, + "facing=south,state=blinking": {"model": "computercraft:block/computer_command_blinking", "y": 180}, + "facing=south,state=off": {"model": "computercraft:block/computer_command_off", "y": 180}, + "facing=south,state=on": {"model": "computercraft:block/computer_command_on", "y": 180}, + "facing=west,state=blinking": {"model": "computercraft:block/computer_command_blinking", "y": 270}, + "facing=west,state=off": {"model": "computercraft:block/computer_command_off", "y": 270}, + "facing=west,state=on": {"model": "computercraft:block/computer_command_on", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_normal.json new file mode 100644 index 000000000..534584f1d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/computer_normal.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=east,state=blinking": {"model": "computercraft:block/computer_normal_blinking", "y": 90}, + "facing=east,state=off": {"model": "computercraft:block/computer_normal_off", "y": 90}, + "facing=east,state=on": {"model": "computercraft:block/computer_normal_on", "y": 90}, + "facing=north,state=blinking": {"model": "computercraft:block/computer_normal_blinking", "y": 0}, + "facing=north,state=off": {"model": "computercraft:block/computer_normal_off", "y": 0}, + "facing=north,state=on": {"model": "computercraft:block/computer_normal_on", "y": 0}, + "facing=south,state=blinking": {"model": "computercraft:block/computer_normal_blinking", "y": 180}, + "facing=south,state=off": {"model": "computercraft:block/computer_normal_off", "y": 180}, + "facing=south,state=on": {"model": "computercraft:block/computer_normal_on", "y": 180}, + "facing=west,state=blinking": {"model": "computercraft:block/computer_normal_blinking", "y": 270}, + "facing=west,state=off": {"model": "computercraft:block/computer_normal_off", "y": 270}, + "facing=west,state=on": {"model": "computercraft:block/computer_normal_on", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/disk_drive.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/disk_drive.json new file mode 100644 index 000000000..ea03105fb --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/disk_drive.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=east,state=empty": {"model": "computercraft:block/disk_drive_empty", "y": 90}, + "facing=east,state=full": {"model": "computercraft:block/disk_drive_full", "y": 90}, + "facing=east,state=invalid": {"model": "computercraft:block/disk_drive_invalid", "y": 90}, + "facing=north,state=empty": {"model": "computercraft:block/disk_drive_empty", "y": 0}, + "facing=north,state=full": {"model": "computercraft:block/disk_drive_full", "y": 0}, + "facing=north,state=invalid": {"model": "computercraft:block/disk_drive_invalid", "y": 0}, + "facing=south,state=empty": {"model": "computercraft:block/disk_drive_empty", "y": 180}, + "facing=south,state=full": {"model": "computercraft:block/disk_drive_full", "y": 180}, + "facing=south,state=invalid": {"model": "computercraft:block/disk_drive_invalid", "y": 180}, + "facing=west,state=empty": {"model": "computercraft:block/disk_drive_empty", "y": 270}, + "facing=west,state=full": {"model": "computercraft:block/disk_drive_full", "y": 270}, + "facing=west,state=invalid": {"model": "computercraft:block/disk_drive_invalid", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/monitor_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/monitor_advanced.json new file mode 100644 index 000000000..7f85fcc59 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/monitor_advanced.json @@ -0,0 +1,268 @@ +{ + "variants": { + "facing=east,orientation=down,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 90, "y": 90}, + "facing=east,orientation=down,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 90, "y": 90}, + "facing=east,orientation=down,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 90, + "y": 90 + }, + "facing=east,orientation=down,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 90, "y": 90}, + "facing=east,orientation=down,state=none": {"model": "computercraft:block/monitor_advanced", "x": 90, "y": 90}, + "facing=east,orientation=down,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 90, "y": 90}, + "facing=east,orientation=down,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 90, "y": 90}, + "facing=east,orientation=down,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 90, "y": 90}, + "facing=east,orientation=down,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 90, "y": 90}, + "facing=east,orientation=down,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 90, "y": 90}, + "facing=east,orientation=down,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 90, "y": 90}, + "facing=east,orientation=north,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 0, "y": 90}, + "facing=east,orientation=north,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 0, "y": 90}, + "facing=east,orientation=north,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 0, + "y": 90 + }, + "facing=east,orientation=north,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 0, "y": 90}, + "facing=east,orientation=north,state=none": {"model": "computercraft:block/monitor_advanced", "x": 0, "y": 90}, + "facing=east,orientation=north,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 0, "y": 90}, + "facing=east,orientation=north,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 0, "y": 90}, + "facing=east,orientation=north,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 0, "y": 90}, + "facing=east,orientation=north,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 0, "y": 90}, + "facing=east,orientation=north,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 0, "y": 90}, + "facing=east,orientation=north,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 0, "y": 90}, + "facing=east,orientation=up,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 270, "y": 90}, + "facing=east,orientation=up,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 270, "y": 90}, + "facing=east,orientation=up,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lrud": {"model": "computercraft:block/monitor_advanced_lrud", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 270, "y": 90}, + "facing=east,orientation=up,state=none": {"model": "computercraft:block/monitor_advanced", "x": 270, "y": 90}, + "facing=east,orientation=up,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 270, "y": 90}, + "facing=east,orientation=up,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 270, "y": 90}, + "facing=east,orientation=up,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 270, "y": 90}, + "facing=east,orientation=up,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 270, "y": 90}, + "facing=east,orientation=up,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 270, "y": 90}, + "facing=east,orientation=up,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 270, "y": 90}, + "facing=north,orientation=down,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 90, "y": 0}, + "facing=north,orientation=down,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 90, "y": 0}, + "facing=north,orientation=down,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 90, + "y": 0 + }, + "facing=north,orientation=down,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 90, "y": 0}, + "facing=north,orientation=down,state=none": {"model": "computercraft:block/monitor_advanced", "x": 90, "y": 0}, + "facing=north,orientation=down,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 90, "y": 0}, + "facing=north,orientation=down,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 90, "y": 0}, + "facing=north,orientation=down,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 90, "y": 0}, + "facing=north,orientation=down,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 90, "y": 0}, + "facing=north,orientation=down,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 90, "y": 0}, + "facing=north,orientation=down,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 90, "y": 0}, + "facing=north,orientation=north,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 0, "y": 0}, + "facing=north,orientation=north,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 0, "y": 0}, + "facing=north,orientation=north,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 0, + "y": 0 + }, + "facing=north,orientation=north,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 0, "y": 0}, + "facing=north,orientation=north,state=none": {"model": "computercraft:block/monitor_advanced", "x": 0, "y": 0}, + "facing=north,orientation=north,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 0, "y": 0}, + "facing=north,orientation=north,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 0, "y": 0}, + "facing=north,orientation=north,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 0, "y": 0}, + "facing=north,orientation=north,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 0, "y": 0}, + "facing=north,orientation=north,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 0, "y": 0}, + "facing=north,orientation=north,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 0, "y": 0}, + "facing=north,orientation=up,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 270, "y": 0}, + "facing=north,orientation=up,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 270, "y": 0}, + "facing=north,orientation=up,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lrud": {"model": "computercraft:block/monitor_advanced_lrud", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 270, "y": 0}, + "facing=north,orientation=up,state=none": {"model": "computercraft:block/monitor_advanced", "x": 270, "y": 0}, + "facing=north,orientation=up,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 270, "y": 0}, + "facing=north,orientation=up,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 270, "y": 0}, + "facing=north,orientation=up,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 270, "y": 0}, + "facing=north,orientation=up,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 270, "y": 0}, + "facing=north,orientation=up,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 270, "y": 0}, + "facing=north,orientation=up,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 270, "y": 0}, + "facing=south,orientation=down,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 90, "y": 180}, + "facing=south,orientation=down,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 90, "y": 180}, + "facing=south,orientation=down,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lrd": { + "model": "computercraft:block/monitor_advanced_lrd", + "x": 90, + "y": 180 + }, + "facing=south,orientation=down,state=lru": { + "model": "computercraft:block/monitor_advanced_lru", + "x": 90, + "y": 180 + }, + "facing=south,orientation=down,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 90, + "y": 180 + }, + "facing=south,orientation=down,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lud": { + "model": "computercraft:block/monitor_advanced_lud", + "x": 90, + "y": 180 + }, + "facing=south,orientation=down,state=none": {"model": "computercraft:block/monitor_advanced", "x": 90, "y": 180}, + "facing=south,orientation=down,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 90, "y": 180}, + "facing=south,orientation=down,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 90, "y": 180}, + "facing=south,orientation=down,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 90, "y": 180}, + "facing=south,orientation=down,state=rud": { + "model": "computercraft:block/monitor_advanced_rud", + "x": 90, + "y": 180 + }, + "facing=south,orientation=down,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 90, "y": 180}, + "facing=south,orientation=down,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 90, "y": 180}, + "facing=south,orientation=north,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 0, "y": 180}, + "facing=south,orientation=north,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 0, "y": 180}, + "facing=south,orientation=north,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lrd": { + "model": "computercraft:block/monitor_advanced_lrd", + "x": 0, + "y": 180 + }, + "facing=south,orientation=north,state=lru": { + "model": "computercraft:block/monitor_advanced_lru", + "x": 0, + "y": 180 + }, + "facing=south,orientation=north,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 0, + "y": 180 + }, + "facing=south,orientation=north,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lud": { + "model": "computercraft:block/monitor_advanced_lud", + "x": 0, + "y": 180 + }, + "facing=south,orientation=north,state=none": {"model": "computercraft:block/monitor_advanced", "x": 0, "y": 180}, + "facing=south,orientation=north,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 0, "y": 180}, + "facing=south,orientation=north,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 0, "y": 180}, + "facing=south,orientation=north,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 0, "y": 180}, + "facing=south,orientation=north,state=rud": { + "model": "computercraft:block/monitor_advanced_rud", + "x": 0, + "y": 180 + }, + "facing=south,orientation=north,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 0, "y": 180}, + "facing=south,orientation=north,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 0, "y": 180}, + "facing=south,orientation=up,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 270, "y": 180}, + "facing=south,orientation=up,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 270, "y": 180}, + "facing=south,orientation=up,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 270, + "y": 180 + }, + "facing=south,orientation=up,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 270, "y": 180}, + "facing=south,orientation=up,state=none": {"model": "computercraft:block/monitor_advanced", "x": 270, "y": 180}, + "facing=south,orientation=up,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 270, "y": 180}, + "facing=south,orientation=up,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 270, "y": 180}, + "facing=south,orientation=up,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 270, "y": 180}, + "facing=south,orientation=up,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 270, "y": 180}, + "facing=south,orientation=up,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 270, "y": 180}, + "facing=south,orientation=up,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 270, "y": 180}, + "facing=west,orientation=down,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 90, "y": 270}, + "facing=west,orientation=down,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 90, "y": 270}, + "facing=west,orientation=down,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 90, + "y": 270 + }, + "facing=west,orientation=down,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 90, "y": 270}, + "facing=west,orientation=down,state=none": {"model": "computercraft:block/monitor_advanced", "x": 90, "y": 270}, + "facing=west,orientation=down,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 90, "y": 270}, + "facing=west,orientation=down,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 90, "y": 270}, + "facing=west,orientation=down,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 90, "y": 270}, + "facing=west,orientation=down,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 90, "y": 270}, + "facing=west,orientation=down,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 90, "y": 270}, + "facing=west,orientation=down,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 90, "y": 270}, + "facing=west,orientation=north,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 0, "y": 270}, + "facing=west,orientation=north,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 0, "y": 270}, + "facing=west,orientation=north,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 0, + "y": 270 + }, + "facing=west,orientation=north,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 0, "y": 270}, + "facing=west,orientation=north,state=none": {"model": "computercraft:block/monitor_advanced", "x": 0, "y": 270}, + "facing=west,orientation=north,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 0, "y": 270}, + "facing=west,orientation=north,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 0, "y": 270}, + "facing=west,orientation=north,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 0, "y": 270}, + "facing=west,orientation=north,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 0, "y": 270}, + "facing=west,orientation=north,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 0, "y": 270}, + "facing=west,orientation=north,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 0, "y": 270}, + "facing=west,orientation=up,state=d": {"model": "computercraft:block/monitor_advanced_d", "x": 270, "y": 270}, + "facing=west,orientation=up,state=l": {"model": "computercraft:block/monitor_advanced_l", "x": 270, "y": 270}, + "facing=west,orientation=up,state=ld": {"model": "computercraft:block/monitor_advanced_ld", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lr": {"model": "computercraft:block/monitor_advanced_lr", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lrd": {"model": "computercraft:block/monitor_advanced_lrd", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lru": {"model": "computercraft:block/monitor_advanced_lru", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lrud": { + "model": "computercraft:block/monitor_advanced_lrud", + "x": 270, + "y": 270 + }, + "facing=west,orientation=up,state=lu": {"model": "computercraft:block/monitor_advanced_lu", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lud": {"model": "computercraft:block/monitor_advanced_lud", "x": 270, "y": 270}, + "facing=west,orientation=up,state=none": {"model": "computercraft:block/monitor_advanced", "x": 270, "y": 270}, + "facing=west,orientation=up,state=r": {"model": "computercraft:block/monitor_advanced_r", "x": 270, "y": 270}, + "facing=west,orientation=up,state=rd": {"model": "computercraft:block/monitor_advanced_rd", "x": 270, "y": 270}, + "facing=west,orientation=up,state=ru": {"model": "computercraft:block/monitor_advanced_ru", "x": 270, "y": 270}, + "facing=west,orientation=up,state=rud": {"model": "computercraft:block/monitor_advanced_rud", "x": 270, "y": 270}, + "facing=west,orientation=up,state=u": {"model": "computercraft:block/monitor_advanced_u", "x": 270, "y": 270}, + "facing=west,orientation=up,state=ud": {"model": "computercraft:block/monitor_advanced_ud", "x": 270, "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/monitor_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/monitor_normal.json new file mode 100644 index 000000000..6c966368b --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/monitor_normal.json @@ -0,0 +1,204 @@ +{ + "variants": { + "facing=east,orientation=down,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 90, "y": 90}, + "facing=east,orientation=down,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 90, "y": 90}, + "facing=east,orientation=down,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 90, "y": 90}, + "facing=east,orientation=down,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 90, "y": 90}, + "facing=east,orientation=down,state=none": {"model": "computercraft:block/monitor_normal", "x": 90, "y": 90}, + "facing=east,orientation=down,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 90, "y": 90}, + "facing=east,orientation=down,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 90, "y": 90}, + "facing=east,orientation=down,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 90, "y": 90}, + "facing=east,orientation=down,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 90, "y": 90}, + "facing=east,orientation=down,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 90, "y": 90}, + "facing=east,orientation=down,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 90, "y": 90}, + "facing=east,orientation=north,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 0, "y": 90}, + "facing=east,orientation=north,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 0, "y": 90}, + "facing=east,orientation=north,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 0, "y": 90}, + "facing=east,orientation=north,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 0, "y": 90}, + "facing=east,orientation=north,state=none": {"model": "computercraft:block/monitor_normal", "x": 0, "y": 90}, + "facing=east,orientation=north,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 0, "y": 90}, + "facing=east,orientation=north,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 0, "y": 90}, + "facing=east,orientation=north,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 0, "y": 90}, + "facing=east,orientation=north,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 0, "y": 90}, + "facing=east,orientation=north,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 0, "y": 90}, + "facing=east,orientation=north,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 0, "y": 90}, + "facing=east,orientation=up,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 270, "y": 90}, + "facing=east,orientation=up,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 270, "y": 90}, + "facing=east,orientation=up,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 270, "y": 90}, + "facing=east,orientation=up,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 270, "y": 90}, + "facing=east,orientation=up,state=none": {"model": "computercraft:block/monitor_normal", "x": 270, "y": 90}, + "facing=east,orientation=up,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 270, "y": 90}, + "facing=east,orientation=up,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 270, "y": 90}, + "facing=east,orientation=up,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 270, "y": 90}, + "facing=east,orientation=up,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 270, "y": 90}, + "facing=east,orientation=up,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 270, "y": 90}, + "facing=east,orientation=up,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 270, "y": 90}, + "facing=north,orientation=down,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 90, "y": 0}, + "facing=north,orientation=down,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 90, "y": 0}, + "facing=north,orientation=down,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 90, "y": 0}, + "facing=north,orientation=down,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 90, "y": 0}, + "facing=north,orientation=down,state=none": {"model": "computercraft:block/monitor_normal", "x": 90, "y": 0}, + "facing=north,orientation=down,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 90, "y": 0}, + "facing=north,orientation=down,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 90, "y": 0}, + "facing=north,orientation=down,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 90, "y": 0}, + "facing=north,orientation=down,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 90, "y": 0}, + "facing=north,orientation=down,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 90, "y": 0}, + "facing=north,orientation=down,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 90, "y": 0}, + "facing=north,orientation=north,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 0, "y": 0}, + "facing=north,orientation=north,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 0, "y": 0}, + "facing=north,orientation=north,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 0, "y": 0}, + "facing=north,orientation=north,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 0, "y": 0}, + "facing=north,orientation=north,state=none": {"model": "computercraft:block/monitor_normal", "x": 0, "y": 0}, + "facing=north,orientation=north,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 0, "y": 0}, + "facing=north,orientation=north,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 0, "y": 0}, + "facing=north,orientation=north,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 0, "y": 0}, + "facing=north,orientation=north,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 0, "y": 0}, + "facing=north,orientation=north,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 0, "y": 0}, + "facing=north,orientation=north,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 0, "y": 0}, + "facing=north,orientation=up,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 270, "y": 0}, + "facing=north,orientation=up,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 270, "y": 0}, + "facing=north,orientation=up,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 270, "y": 0}, + "facing=north,orientation=up,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 270, "y": 0}, + "facing=north,orientation=up,state=none": {"model": "computercraft:block/monitor_normal", "x": 270, "y": 0}, + "facing=north,orientation=up,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 270, "y": 0}, + "facing=north,orientation=up,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 270, "y": 0}, + "facing=north,orientation=up,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 270, "y": 0}, + "facing=north,orientation=up,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 270, "y": 0}, + "facing=north,orientation=up,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 270, "y": 0}, + "facing=north,orientation=up,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 270, "y": 0}, + "facing=south,orientation=down,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 90, "y": 180}, + "facing=south,orientation=down,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 90, "y": 180}, + "facing=south,orientation=down,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lrud": { + "model": "computercraft:block/monitor_normal_lrud", + "x": 90, + "y": 180 + }, + "facing=south,orientation=down,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 90, "y": 180}, + "facing=south,orientation=down,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 90, "y": 180}, + "facing=south,orientation=down,state=none": {"model": "computercraft:block/monitor_normal", "x": 90, "y": 180}, + "facing=south,orientation=down,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 90, "y": 180}, + "facing=south,orientation=down,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 90, "y": 180}, + "facing=south,orientation=down,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 90, "y": 180}, + "facing=south,orientation=down,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 90, "y": 180}, + "facing=south,orientation=down,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 90, "y": 180}, + "facing=south,orientation=down,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 90, "y": 180}, + "facing=south,orientation=north,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 0, "y": 180}, + "facing=south,orientation=north,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 0, "y": 180}, + "facing=south,orientation=north,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lrud": { + "model": "computercraft:block/monitor_normal_lrud", + "x": 0, + "y": 180 + }, + "facing=south,orientation=north,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 0, "y": 180}, + "facing=south,orientation=north,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 0, "y": 180}, + "facing=south,orientation=north,state=none": {"model": "computercraft:block/monitor_normal", "x": 0, "y": 180}, + "facing=south,orientation=north,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 0, "y": 180}, + "facing=south,orientation=north,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 0, "y": 180}, + "facing=south,orientation=north,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 0, "y": 180}, + "facing=south,orientation=north,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 0, "y": 180}, + "facing=south,orientation=north,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 0, "y": 180}, + "facing=south,orientation=north,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 0, "y": 180}, + "facing=south,orientation=up,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 270, "y": 180}, + "facing=south,orientation=up,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 270, "y": 180}, + "facing=south,orientation=up,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 270, "y": 180}, + "facing=south,orientation=up,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 270, "y": 180}, + "facing=south,orientation=up,state=none": {"model": "computercraft:block/monitor_normal", "x": 270, "y": 180}, + "facing=south,orientation=up,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 270, "y": 180}, + "facing=south,orientation=up,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 270, "y": 180}, + "facing=south,orientation=up,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 270, "y": 180}, + "facing=south,orientation=up,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 270, "y": 180}, + "facing=south,orientation=up,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 270, "y": 180}, + "facing=south,orientation=up,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 270, "y": 180}, + "facing=west,orientation=down,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 90, "y": 270}, + "facing=west,orientation=down,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 90, "y": 270}, + "facing=west,orientation=down,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 90, "y": 270}, + "facing=west,orientation=down,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 90, "y": 270}, + "facing=west,orientation=down,state=none": {"model": "computercraft:block/monitor_normal", "x": 90, "y": 270}, + "facing=west,orientation=down,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 90, "y": 270}, + "facing=west,orientation=down,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 90, "y": 270}, + "facing=west,orientation=down,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 90, "y": 270}, + "facing=west,orientation=down,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 90, "y": 270}, + "facing=west,orientation=down,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 90, "y": 270}, + "facing=west,orientation=down,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 90, "y": 270}, + "facing=west,orientation=north,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 0, "y": 270}, + "facing=west,orientation=north,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 0, "y": 270}, + "facing=west,orientation=north,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 0, "y": 270}, + "facing=west,orientation=north,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 0, "y": 270}, + "facing=west,orientation=north,state=none": {"model": "computercraft:block/monitor_normal", "x": 0, "y": 270}, + "facing=west,orientation=north,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 0, "y": 270}, + "facing=west,orientation=north,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 0, "y": 270}, + "facing=west,orientation=north,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 0, "y": 270}, + "facing=west,orientation=north,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 0, "y": 270}, + "facing=west,orientation=north,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 0, "y": 270}, + "facing=west,orientation=north,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 0, "y": 270}, + "facing=west,orientation=up,state=d": {"model": "computercraft:block/monitor_normal_d", "x": 270, "y": 270}, + "facing=west,orientation=up,state=l": {"model": "computercraft:block/monitor_normal_l", "x": 270, "y": 270}, + "facing=west,orientation=up,state=ld": {"model": "computercraft:block/monitor_normal_ld", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lr": {"model": "computercraft:block/monitor_normal_lr", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lrd": {"model": "computercraft:block/monitor_normal_lrd", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lru": {"model": "computercraft:block/monitor_normal_lru", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lrud": {"model": "computercraft:block/monitor_normal_lrud", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lu": {"model": "computercraft:block/monitor_normal_lu", "x": 270, "y": 270}, + "facing=west,orientation=up,state=lud": {"model": "computercraft:block/monitor_normal_lud", "x": 270, "y": 270}, + "facing=west,orientation=up,state=none": {"model": "computercraft:block/monitor_normal", "x": 270, "y": 270}, + "facing=west,orientation=up,state=r": {"model": "computercraft:block/monitor_normal_r", "x": 270, "y": 270}, + "facing=west,orientation=up,state=rd": {"model": "computercraft:block/monitor_normal_rd", "x": 270, "y": 270}, + "facing=west,orientation=up,state=ru": {"model": "computercraft:block/monitor_normal_ru", "x": 270, "y": 270}, + "facing=west,orientation=up,state=rud": {"model": "computercraft:block/monitor_normal_rud", "x": 270, "y": 270}, + "facing=west,orientation=up,state=u": {"model": "computercraft:block/monitor_normal_u", "x": 270, "y": 270}, + "facing=west,orientation=up,state=ud": {"model": "computercraft:block/monitor_normal_ud", "x": 270, "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/printer.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/printer.json new file mode 100644 index 000000000..2166b5f04 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/printer.json @@ -0,0 +1,20 @@ +{ + "variants": { + "bottom=false,facing=east,top=false": {"model": "computercraft:block/printer_empty", "y": 90}, + "bottom=false,facing=east,top=true": {"model": "computercraft:block/printer_top_full", "y": 90}, + "bottom=false,facing=north,top=false": {"model": "computercraft:block/printer_empty", "y": 0}, + "bottom=false,facing=north,top=true": {"model": "computercraft:block/printer_top_full", "y": 0}, + "bottom=false,facing=south,top=false": {"model": "computercraft:block/printer_empty", "y": 180}, + "bottom=false,facing=south,top=true": {"model": "computercraft:block/printer_top_full", "y": 180}, + "bottom=false,facing=west,top=false": {"model": "computercraft:block/printer_empty", "y": 270}, + "bottom=false,facing=west,top=true": {"model": "computercraft:block/printer_top_full", "y": 270}, + "bottom=true,facing=east,top=false": {"model": "computercraft:block/printer_bottom_full", "y": 90}, + "bottom=true,facing=east,top=true": {"model": "computercraft:block/printer_both_full", "y": 90}, + "bottom=true,facing=north,top=false": {"model": "computercraft:block/printer_bottom_full", "y": 0}, + "bottom=true,facing=north,top=true": {"model": "computercraft:block/printer_both_full", "y": 0}, + "bottom=true,facing=south,top=false": {"model": "computercraft:block/printer_bottom_full", "y": 180}, + "bottom=true,facing=south,top=true": {"model": "computercraft:block/printer_both_full", "y": 180}, + "bottom=true,facing=west,top=false": {"model": "computercraft:block/printer_bottom_full", "y": 270}, + "bottom=true,facing=west,top=true": {"model": "computercraft:block/printer_both_full", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/speaker.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/speaker.json new file mode 100644 index 000000000..10220f79b --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/speaker.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=east": {"model": "computercraft:block/speaker", "y": 90}, + "facing=north": {"model": "computercraft:block/speaker"}, + "facing=south": {"model": "computercraft:block/speaker", "y": 180}, + "facing=west": {"model": "computercraft:block/speaker", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/turtle_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/turtle_advanced.json new file mode 100644 index 000000000..8cbf6f159 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/turtle_advanced.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=east": {"model": "computercraft:block/turtle_advanced", "y": 90}, + "facing=north": {"model": "computercraft:block/turtle_advanced", "y": 0}, + "facing=south": {"model": "computercraft:block/turtle_advanced", "y": 180}, + "facing=west": {"model": "computercraft:block/turtle_advanced", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/turtle_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/turtle_normal.json new file mode 100644 index 000000000..86962020f --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/turtle_normal.json @@ -0,0 +1,8 @@ +{ + "variants": { + "facing=east": {"model": "computercraft:block/turtle_normal", "y": 90}, + "facing=north": {"model": "computercraft:block/turtle_normal", "y": 0}, + "facing=south": {"model": "computercraft:block/turtle_normal", "y": 180}, + "facing=west": {"model": "computercraft:block/turtle_normal", "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wired_modem_full.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wired_modem_full.json new file mode 100644 index 000000000..9e0fa205a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wired_modem_full.json @@ -0,0 +1,8 @@ +{ + "variants": { + "modem=false,peripheral=false": {"model": "computercraft:block/wired_modem_full_off"}, + "modem=false,peripheral=true": {"model": "computercraft:block/wired_modem_full_off_peripheral"}, + "modem=true,peripheral=false": {"model": "computercraft:block/wired_modem_full_on"}, + "modem=true,peripheral=true": {"model": "computercraft:block/wired_modem_full_on_peripheral"} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wireless_modem_advanced.json new file mode 100644 index 000000000..9f029e6da --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wireless_modem_advanced.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=down,on=false": {"model": "computercraft:block/wireless_modem_advanced_off", "x": 90, "y": 0}, + "facing=down,on=true": {"model": "computercraft:block/wireless_modem_advanced_on", "x": 90, "y": 0}, + "facing=east,on=false": {"model": "computercraft:block/wireless_modem_advanced_off", "x": 0, "y": 90}, + "facing=east,on=true": {"model": "computercraft:block/wireless_modem_advanced_on", "x": 0, "y": 90}, + "facing=north,on=false": {"model": "computercraft:block/wireless_modem_advanced_off", "x": 0, "y": 0}, + "facing=north,on=true": {"model": "computercraft:block/wireless_modem_advanced_on", "x": 0, "y": 0}, + "facing=south,on=false": {"model": "computercraft:block/wireless_modem_advanced_off", "x": 0, "y": 180}, + "facing=south,on=true": {"model": "computercraft:block/wireless_modem_advanced_on", "x": 0, "y": 180}, + "facing=up,on=false": {"model": "computercraft:block/wireless_modem_advanced_off", "x": 270, "y": 0}, + "facing=up,on=true": {"model": "computercraft:block/wireless_modem_advanced_on", "x": 270, "y": 0}, + "facing=west,on=false": {"model": "computercraft:block/wireless_modem_advanced_off", "x": 0, "y": 270}, + "facing=west,on=true": {"model": "computercraft:block/wireless_modem_advanced_on", "x": 0, "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wireless_modem_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wireless_modem_normal.json new file mode 100644 index 000000000..09623ddbf --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/blockstates/wireless_modem_normal.json @@ -0,0 +1,16 @@ +{ + "variants": { + "facing=down,on=false": {"model": "computercraft:block/wireless_modem_normal_off", "x": 90, "y": 0}, + "facing=down,on=true": {"model": "computercraft:block/wireless_modem_normal_on", "x": 90, "y": 0}, + "facing=east,on=false": {"model": "computercraft:block/wireless_modem_normal_off", "x": 0, "y": 90}, + "facing=east,on=true": {"model": "computercraft:block/wireless_modem_normal_on", "x": 0, "y": 90}, + "facing=north,on=false": {"model": "computercraft:block/wireless_modem_normal_off", "x": 0, "y": 0}, + "facing=north,on=true": {"model": "computercraft:block/wireless_modem_normal_on", "x": 0, "y": 0}, + "facing=south,on=false": {"model": "computercraft:block/wireless_modem_normal_off", "x": 0, "y": 180}, + "facing=south,on=true": {"model": "computercraft:block/wireless_modem_normal_on", "x": 0, "y": 180}, + "facing=up,on=false": {"model": "computercraft:block/wireless_modem_normal_off", "x": 270, "y": 0}, + "facing=up,on=true": {"model": "computercraft:block/wireless_modem_normal_on", "x": 270, "y": 0}, + "facing=west,on=false": {"model": "computercraft:block/wireless_modem_normal_off", "x": 0, "y": 270}, + "facing=west,on=true": {"model": "computercraft:block/wireless_modem_normal_on", "x": 0, "y": 270} + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_blinking.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_blinking.json new file mode 100644 index 000000000..e9fccca86 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_blinking.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_advanced_front_blink", + "side": "computercraft:block/computer_advanced_side", + "top": "computercraft:block/computer_advanced_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_off.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_off.json new file mode 100644 index 000000000..f83e08db4 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_off.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_advanced_front", + "side": "computercraft:block/computer_advanced_side", + "top": "computercraft:block/computer_advanced_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_on.json new file mode 100644 index 000000000..497c1337d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_advanced_on.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_advanced_front_on", + "side": "computercraft:block/computer_advanced_side", + "top": "computercraft:block/computer_advanced_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_blinking.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_blinking.json new file mode 100644 index 000000000..62d746878 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_blinking.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_command_front_blink", + "side": "computercraft:block/computer_command_side", + "top": "computercraft:block/computer_command_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_off.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_off.json new file mode 100644 index 000000000..d23eeb90b --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_off.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_command_front", + "side": "computercraft:block/computer_command_side", + "top": "computercraft:block/computer_command_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_on.json new file mode 100644 index 000000000..36c6f0fa6 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_command_on.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_command_front_on", + "side": "computercraft:block/computer_command_side", + "top": "computercraft:block/computer_command_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_blinking.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_blinking.json new file mode 100644 index 000000000..7250268d7 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_blinking.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_normal_front_blink", + "side": "computercraft:block/computer_normal_side", + "top": "computercraft:block/computer_normal_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_off.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_off.json new file mode 100644 index 000000000..658fcc187 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_off.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_normal_front", + "side": "computercraft:block/computer_normal_side", + "top": "computercraft:block/computer_normal_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_on.json new file mode 100644 index 000000000..da2e671fe --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/computer_normal_on.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/computer_normal_front_on", + "side": "computercraft:block/computer_normal_side", + "top": "computercraft:block/computer_normal_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_empty.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_empty.json new file mode 100644 index 000000000..161051750 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_empty.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/disk_drive_front", + "side": "computercraft:block/disk_drive_side", + "top": "computercraft:block/disk_drive_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_full.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_full.json new file mode 100644 index 000000000..940c8fc1a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_full.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/disk_drive_front_accepted", + "side": "computercraft:block/disk_drive_side", + "top": "computercraft:block/disk_drive_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_invalid.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_invalid.json new file mode 100644 index 000000000..f8e91b267 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/disk_drive_invalid.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/disk_drive_front_rejected", + "side": "computercraft:block/disk_drive_side", + "top": "computercraft:block/disk_drive_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced.json new file mode 100644 index 000000000..dd6a8cbb6 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_32", + "front": "computercraft:block/monitor_advanced_16", + "side": "computercraft:block/monitor_advanced_4", + "top": "computercraft:block/monitor_advanced_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_d.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_d.json new file mode 100644 index 000000000..d21a5f0f2 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_d.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_36", + "front": "computercraft:block/monitor_advanced_20", + "side": "computercraft:block/monitor_advanced_7", + "top": "computercraft:block/monitor_advanced_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_item.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_item.json new file mode 100644 index 000000000..50b557339 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_item.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_32", + "front": "computercraft:block/monitor_advanced_15", + "side": "computercraft:block/monitor_advanced_4", + "top": "computercraft:block/monitor_advanced_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_l.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_l.json new file mode 100644 index 000000000..58695f253 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_l.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_33", + "front": "computercraft:block/monitor_advanced_19", + "side": "computercraft:block/monitor_advanced_4", + "top": "computercraft:block/monitor_advanced_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ld.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ld.json new file mode 100644 index 000000000..8915909d3 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ld.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_45", + "front": "computercraft:block/monitor_advanced_31", + "side": "computercraft:block/monitor_advanced_7", + "top": "computercraft:block/monitor_advanced_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lr.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lr.json new file mode 100644 index 000000000..3300d5ba2 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lr.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_34", + "front": "computercraft:block/monitor_advanced_18", + "side": "computercraft:block/monitor_advanced_4", + "top": "computercraft:block/monitor_advanced_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lrd.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lrd.json new file mode 100644 index 000000000..6a419c181 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lrd.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_46", + "front": "computercraft:block/monitor_advanced_30", + "side": "computercraft:block/monitor_advanced_7", + "top": "computercraft:block/monitor_advanced_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lru.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lru.json new file mode 100644 index 000000000..29d00af1a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lru.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_40", + "front": "computercraft:block/monitor_advanced_24", + "side": "computercraft:block/monitor_advanced_5", + "top": "computercraft:block/monitor_advanced_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lrud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lrud.json new file mode 100644 index 000000000..57f44fa6c --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lrud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_43", + "front": "computercraft:block/monitor_advanced_27", + "side": "computercraft:block/monitor_advanced_6", + "top": "computercraft:block/monitor_advanced_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lu.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lu.json new file mode 100644 index 000000000..157af4dbd --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lu.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_39", + "front": "computercraft:block/monitor_advanced_25", + "side": "computercraft:block/monitor_advanced_5", + "top": "computercraft:block/monitor_advanced_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lud.json new file mode 100644 index 000000000..056c55965 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_lud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_42", + "front": "computercraft:block/monitor_advanced_28", + "side": "computercraft:block/monitor_advanced_6", + "top": "computercraft:block/monitor_advanced_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_r.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_r.json new file mode 100644 index 000000000..8b152928a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_r.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_35", + "front": "computercraft:block/monitor_advanced_17", + "side": "computercraft:block/monitor_advanced_4", + "top": "computercraft:block/monitor_advanced_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_rd.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_rd.json new file mode 100644 index 000000000..f56d3d1be --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_rd.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_47", + "front": "computercraft:block/monitor_advanced_29", + "side": "computercraft:block/monitor_advanced_7", + "top": "computercraft:block/monitor_advanced_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ru.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ru.json new file mode 100644 index 000000000..fbf2107b2 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ru.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_41", + "front": "computercraft:block/monitor_advanced_23", + "side": "computercraft:block/monitor_advanced_5", + "top": "computercraft:block/monitor_advanced_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_rud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_rud.json new file mode 100644 index 000000000..179d84971 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_rud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_44", + "front": "computercraft:block/monitor_advanced_26", + "side": "computercraft:block/monitor_advanced_6", + "top": "computercraft:block/monitor_advanced_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_u.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_u.json new file mode 100644 index 000000000..c4d91bba1 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_u.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_38", + "front": "computercraft:block/monitor_advanced_22", + "side": "computercraft:block/monitor_advanced_5", + "top": "computercraft:block/monitor_advanced_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ud.json new file mode 100644 index 000000000..88279af77 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_advanced_ud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_advanced_37", + "front": "computercraft:block/monitor_advanced_21", + "side": "computercraft:block/monitor_advanced_6", + "top": "computercraft:block/monitor_advanced_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal.json new file mode 100644 index 000000000..a1c7e9685 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_32", + "front": "computercraft:block/monitor_normal_16", + "side": "computercraft:block/monitor_normal_4", + "top": "computercraft:block/monitor_normal_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_d.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_d.json new file mode 100644 index 000000000..43db90bed --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_d.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_36", + "front": "computercraft:block/monitor_normal_20", + "side": "computercraft:block/monitor_normal_7", + "top": "computercraft:block/monitor_normal_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_item.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_item.json new file mode 100644 index 000000000..d40cc2732 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_item.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_32", + "front": "computercraft:block/monitor_normal_15", + "side": "computercraft:block/monitor_normal_4", + "top": "computercraft:block/monitor_normal_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_l.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_l.json new file mode 100644 index 000000000..de9639620 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_l.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_33", + "front": "computercraft:block/monitor_normal_19", + "side": "computercraft:block/monitor_normal_4", + "top": "computercraft:block/monitor_normal_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ld.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ld.json new file mode 100644 index 000000000..c99dc337a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ld.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_45", + "front": "computercraft:block/monitor_normal_31", + "side": "computercraft:block/monitor_normal_7", + "top": "computercraft:block/monitor_normal_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lr.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lr.json new file mode 100644 index 000000000..e43d2f210 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lr.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_34", + "front": "computercraft:block/monitor_normal_18", + "side": "computercraft:block/monitor_normal_4", + "top": "computercraft:block/monitor_normal_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lrd.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lrd.json new file mode 100644 index 000000000..147a107ad --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lrd.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_46", + "front": "computercraft:block/monitor_normal_30", + "side": "computercraft:block/monitor_normal_7", + "top": "computercraft:block/monitor_normal_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lru.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lru.json new file mode 100644 index 000000000..504c4f26d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lru.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_40", + "front": "computercraft:block/monitor_normal_24", + "side": "computercraft:block/monitor_normal_5", + "top": "computercraft:block/monitor_normal_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lrud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lrud.json new file mode 100644 index 000000000..d01afdd18 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lrud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_43", + "front": "computercraft:block/monitor_normal_27", + "side": "computercraft:block/monitor_normal_6", + "top": "computercraft:block/monitor_normal_2" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lu.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lu.json new file mode 100644 index 000000000..feac7281d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lu.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_39", + "front": "computercraft:block/monitor_normal_25", + "side": "computercraft:block/monitor_normal_5", + "top": "computercraft:block/monitor_normal_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lud.json new file mode 100644 index 000000000..aa330ffa7 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_lud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_42", + "front": "computercraft:block/monitor_normal_28", + "side": "computercraft:block/monitor_normal_6", + "top": "computercraft:block/monitor_normal_1" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_r.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_r.json new file mode 100644 index 000000000..d0059b4bb --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_r.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_35", + "front": "computercraft:block/monitor_normal_17", + "side": "computercraft:block/monitor_normal_4", + "top": "computercraft:block/monitor_normal_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_rd.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_rd.json new file mode 100644 index 000000000..374387ae1 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_rd.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_47", + "front": "computercraft:block/monitor_normal_29", + "side": "computercraft:block/monitor_normal_7", + "top": "computercraft:block/monitor_normal_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ru.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ru.json new file mode 100644 index 000000000..b1b1cc8a5 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ru.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_41", + "front": "computercraft:block/monitor_normal_23", + "side": "computercraft:block/monitor_normal_5", + "top": "computercraft:block/monitor_normal_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_rud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_rud.json new file mode 100644 index 000000000..9fc4af9b4 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_rud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_44", + "front": "computercraft:block/monitor_normal_26", + "side": "computercraft:block/monitor_normal_6", + "top": "computercraft:block/monitor_normal_3" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_u.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_u.json new file mode 100644 index 000000000..c729a0a27 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_u.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_38", + "front": "computercraft:block/monitor_normal_22", + "side": "computercraft:block/monitor_normal_5", + "top": "computercraft:block/monitor_normal_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ud.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ud.json new file mode 100644 index 000000000..ce23c66c2 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/monitor_normal_ud.json @@ -0,0 +1,9 @@ +{ + "parent": "computercraft:block/monitor_base", + "textures": { + "back": "computercraft:block/monitor_normal_37", + "front": "computercraft:block/monitor_normal_21", + "side": "computercraft:block/monitor_normal_6", + "top": "computercraft:block/monitor_normal_0" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_both_full.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_both_full.json new file mode 100644 index 000000000..a6b2659f6 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_both_full.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/printer_front_both_trays", + "side": "computercraft:block/printer_side", + "top": "computercraft:block/printer_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_bottom_full.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_bottom_full.json new file mode 100644 index 000000000..e45d7850b --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_bottom_full.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/printer_front_bottom_tray", + "side": "computercraft:block/printer_side", + "top": "computercraft:block/printer_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_empty.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_empty.json new file mode 100644 index 000000000..fe489fe22 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_empty.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/printer_front_empty", + "side": "computercraft:block/printer_side", + "top": "computercraft:block/printer_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_top_full.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_top_full.json new file mode 100644 index 000000000..1d33e804f --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/printer_top_full.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/printer_front_top_tray", + "side": "computercraft:block/printer_side", + "top": "computercraft:block/printer_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/speaker.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/speaker.json new file mode 100644 index 000000000..f0116b421 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/speaker.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/orientable", + "textures": { + "front": "computercraft:block/speaker_front", + "side": "computercraft:block/speaker_side", + "top": "computercraft:block/speaker_top" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_advanced.json new file mode 100644 index 000000000..99ba96d2c --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_advanced.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/turtle_base", "textures": {"texture": "computercraft:block/turtle_advanced"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_crafting_table_left.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_crafting_table_left.json new file mode 100644 index 000000000..89b5a6972 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_crafting_table_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "computercraft:block/turtle_crafty_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_crafting_table_right.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_crafting_table_right.json new file mode 100644 index 000000000..a180f3411 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_crafting_table_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "computercraft:block/turtle_crafty_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_off_left.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_off_left.json new file mode 100644 index 000000000..0e7d2d00d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_off_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "computercraft:block/wireless_modem_advanced_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_off_right.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_off_right.json new file mode 100644 index 000000000..08393a37c --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_off_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "computercraft:block/wireless_modem_advanced_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_on_left.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_on_left.json new file mode 100644 index 000000000..2a615f20f --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_on_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "computercraft:block/wireless_modem_advanced_face_on"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_on_right.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_on_right.json new file mode 100644 index 000000000..657668a74 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_advanced_on_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "computercraft:block/wireless_modem_advanced_face_on"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_off_left.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_off_left.json new file mode 100644 index 000000000..34dbe1630 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_off_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "computercraft:block/wireless_modem_normal_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_off_right.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_off_right.json new file mode 100644 index 000000000..49869b795 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_off_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "computercraft:block/wireless_modem_normal_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_on_left.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_on_left.json new file mode 100644 index 000000000..9ac52442c --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_on_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "computercraft:block/wireless_modem_normal_face_on"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_on_right.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_on_right.json new file mode 100644 index 000000000..a82ef9362 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_modem_normal_on_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "computercraft:block/wireless_modem_normal_face_on"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_normal.json new file mode 100644 index 000000000..a3ea9a7f4 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_normal.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/turtle_base", "textures": {"texture": "computercraft:block/turtle_normal"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_speaker_left.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_speaker_left.json new file mode 100644 index 000000000..0db150830 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_speaker_left.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_left", + "textures": {"texture": "computercraft:block/turtle_speaker_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_speaker_right.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_speaker_right.json new file mode 100644 index 000000000..e0ba3df5f --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/turtle_speaker_right.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/turtle_upgrade_base_right", + "textures": {"texture": "computercraft:block/turtle_speaker_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_off.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_off.json new file mode 100644 index 000000000..1f1d6fff5 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_off.json @@ -0,0 +1 @@ +{"parent": "minecraft:block/cube_all", "textures": {"all": "computercraft:block/wired_modem_face"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_off_peripheral.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_off_peripheral.json new file mode 100644 index 000000000..5ee712104 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_off_peripheral.json @@ -0,0 +1 @@ +{"parent": "minecraft:block/cube_all", "textures": {"all": "computercraft:block/wired_modem_face_peripheral"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_on.json new file mode 100644 index 000000000..92dfa3104 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_on.json @@ -0,0 +1 @@ +{"parent": "minecraft:block/cube_all", "textures": {"all": "computercraft:block/wired_modem_face_on"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_on_peripheral.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_on_peripheral.json new file mode 100644 index 000000000..da484b389 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_full_on_peripheral.json @@ -0,0 +1 @@ +{"parent": "minecraft:block/cube_all", "textures": {"all": "computercraft:block/wired_modem_face_peripheral_on"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_off.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_off.json new file mode 100644 index 000000000..fda71616f --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_off.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/modem", + "textures": {"back": "computercraft:block/modem_back", "front": "computercraft:block/wired_modem_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_off_peripheral.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_off_peripheral.json new file mode 100644 index 000000000..d1e1c9dce --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_off_peripheral.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/modem", + "textures": {"back": "computercraft:block/modem_back", "front": "computercraft:block/wired_modem_face_peripheral"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_on.json new file mode 100644 index 000000000..abd9e04f4 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_on.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/modem", + "textures": {"back": "computercraft:block/modem_back", "front": "computercraft:block/wired_modem_face_on"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_on_peripheral.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_on_peripheral.json new file mode 100644 index 000000000..58be99ef4 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wired_modem_on_peripheral.json @@ -0,0 +1,7 @@ +{ + "parent": "computercraft:block/modem", + "textures": { + "back": "computercraft:block/modem_back", + "front": "computercraft:block/wired_modem_face_peripheral_on" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_advanced_off.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_advanced_off.json new file mode 100644 index 000000000..54980c936 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_advanced_off.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/modem", + "textures": {"back": "computercraft:block/modem_back", "front": "computercraft:block/wireless_modem_advanced_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_advanced_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_advanced_on.json new file mode 100644 index 000000000..f99a7e66a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_advanced_on.json @@ -0,0 +1,7 @@ +{ + "parent": "computercraft:block/modem", + "textures": { + "back": "computercraft:block/modem_back", + "front": "computercraft:block/wireless_modem_advanced_face_on" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_normal_off.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_normal_off.json new file mode 100644 index 000000000..e1422447b --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_normal_off.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/modem", + "textures": {"back": "computercraft:block/modem_back", "front": "computercraft:block/wireless_modem_normal_face"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_normal_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_normal_on.json new file mode 100644 index 000000000..77feccc24 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/block/wireless_modem_normal_on.json @@ -0,0 +1,4 @@ +{ + "parent": "computercraft:block/modem", + "textures": {"back": "computercraft:block/modem_back", "front": "computercraft:block/wireless_modem_normal_face_on"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_advanced.json new file mode 100644 index 000000000..57ff7311d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_advanced.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/computer_advanced_blinking"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_command.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_command.json new file mode 100644 index 000000000..fac0decda --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_command.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/computer_command_blinking"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_normal.json new file mode 100644 index 000000000..e69fc6cb4 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/computer_normal.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/computer_normal_blinking"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/disk.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/disk.json new file mode 100644 index 000000000..d4d1f96f1 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/disk.json @@ -0,0 +1,4 @@ +{ + "parent": "minecraft:item/generated", + "textures": {"layer0": "computercraft:item/disk_frame", "layer1": "computercraft:item/disk_colour"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/disk_drive.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/disk_drive.json new file mode 100644 index 000000000..3d648a9b3 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/disk_drive.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/disk_drive_empty"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/monitor_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/monitor_advanced.json new file mode 100644 index 000000000..f60c0313f --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/monitor_advanced.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/monitor_advanced_item"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/monitor_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/monitor_normal.json new file mode 100644 index 000000000..fed49936d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/monitor_normal.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/monitor_normal_item"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_advanced_blinking.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_advanced_blinking.json new file mode 100644 index 000000000..b9504d340 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_advanced_blinking.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "computercraft:item/pocket_computer_blink", + "layer1": "computercraft:item/pocket_computer_advanced", + "layer2": "computercraft:item/pocket_computer_light" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_advanced_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_advanced_on.json new file mode 100644 index 000000000..3a24c8822 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_advanced_on.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "computercraft:item/pocket_computer_on", + "layer1": "computercraft:item/pocket_computer_advanced", + "layer2": "computercraft:item/pocket_computer_light" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour.json new file mode 100644 index 000000000..57d323094 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour.json @@ -0,0 +1,7 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "computercraft:item/pocket_computer_frame", + "layer1": "computercraft:item/pocket_computer_colour" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour_blinking.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour_blinking.json new file mode 100644 index 000000000..a3cd99df6 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour_blinking.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "computercraft:item/pocket_computer_blink", + "layer1": "computercraft:item/pocket_computer_colour", + "layer2": "computercraft:item/pocket_computer_light" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour_on.json new file mode 100644 index 000000000..af3b82e8e --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_colour_on.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "computercraft:item/pocket_computer_on", + "layer1": "computercraft:item/pocket_computer_colour", + "layer2": "computercraft:item/pocket_computer_light" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_normal_blinking.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_normal_blinking.json new file mode 100644 index 000000000..0685ea28a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_normal_blinking.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "computercraft:item/pocket_computer_blink", + "layer1": "computercraft:item/pocket_computer_normal", + "layer2": "computercraft:item/pocket_computer_light" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_normal_on.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_normal_on.json new file mode 100644 index 000000000..2cf505505 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/pocket_computer_normal_on.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "computercraft:item/pocket_computer_on", + "layer1": "computercraft:item/pocket_computer_normal", + "layer2": "computercraft:item/pocket_computer_light" + } +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_book.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_book.json new file mode 100644 index 000000000..5ef52a307 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_book.json @@ -0,0 +1 @@ +{"parent": "minecraft:item/generated", "textures": {"layer0": "computercraft:item/printed_book"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_page.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_page.json new file mode 100644 index 000000000..60eb97790 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_page.json @@ -0,0 +1 @@ +{"parent": "minecraft:item/generated", "textures": {"layer0": "computercraft:item/printed_page"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_pages.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_pages.json new file mode 100644 index 000000000..c427068e6 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printed_pages.json @@ -0,0 +1 @@ +{"parent": "minecraft:item/generated", "textures": {"layer0": "computercraft:item/printed_pages"}} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/printer.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printer.json new file mode 100644 index 000000000..24dfc6509 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/printer.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/printer_empty"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/speaker.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/speaker.json new file mode 100644 index 000000000..44743735a --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/speaker.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/speaker"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/treasure_disk.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/treasure_disk.json new file mode 100644 index 000000000..d4d1f96f1 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/treasure_disk.json @@ -0,0 +1,4 @@ +{ + "parent": "minecraft:item/generated", + "textures": {"layer0": "computercraft:item/disk_frame", "layer1": "computercraft:item/disk_colour"} +} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/turtle_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/turtle_advanced.json new file mode 100644 index 000000000..9ad8aedec --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/turtle_advanced.json @@ -0,0 +1 @@ +{"loader": "computercraft:turtle", "model": "computercraft:block/turtle_advanced"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/turtle_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/turtle_normal.json new file mode 100644 index 000000000..b7af990fd --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/turtle_normal.json @@ -0,0 +1 @@ +{"loader": "computercraft:turtle", "model": "computercraft:block/turtle_normal"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/wired_modem.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wired_modem.json new file mode 100644 index 000000000..c03843813 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wired_modem.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/wired_modem_off"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/wired_modem_full.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wired_modem_full.json new file mode 100644 index 000000000..8f120c233 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wired_modem_full.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/wired_modem_full_off"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wireless_modem_advanced.json new file mode 100644 index 000000000..8c1e90e9d --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wireless_modem_advanced.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/wireless_modem_advanced_off"} diff --git a/projects/fabric/src/generated/resources/assets/computercraft/models/item/wireless_modem_normal.json b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wireless_modem_normal.json new file mode 100644 index 000000000..6c3d1dff5 --- /dev/null +++ b/projects/fabric/src/generated/resources/assets/computercraft/models/item/wireless_modem_normal.json @@ -0,0 +1 @@ +{"parent": "computercraft:block/wireless_modem_normal_off"} diff --git a/projects/fabric/src/generated/resources/data/c/tags/items/skulls.json b/projects/fabric/src/generated/resources/data/c/tags/items/skulls.json new file mode 100644 index 000000000..0ce68d9e5 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/c/tags/items/skulls.json @@ -0,0 +1,11 @@ +{ + "replace": false, + "values": [ + "minecraft:creeper_head", + "minecraft:dragon_head", + "minecraft:player_head", + "minecraft:skeleton_skull", + "minecraft:wither_skeleton_skull", + "minecraft:zombie_head" + ] +} diff --git a/projects/fabric/src/generated/resources/data/c/tags/items/wooden_chests.json b/projects/fabric/src/generated/resources/data/c/tags/items/wooden_chests.json new file mode 100644 index 000000000..afebd2be5 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/c/tags/items/wooden_chests.json @@ -0,0 +1 @@ +{"replace": false, "values": ["minecraft:chest", "minecraft:trapped_chest"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/cable.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/cable.json new file mode 100644 index 000000000..c0ca963cc --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/cable.json @@ -0,0 +1,16 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_modem": { + "conditions": {"items": [{"tag": "computercraft:wired_modem"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:cable"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_computer", "has_modem", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:cable"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_advanced.json new file mode 100644 index 000000000..d06b27bad --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_advanced.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_components": { + "conditions": {"items": [{"tag": "c:redstone_dusts"}, {"tag": "c:gold_ingots"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:computer_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_components", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:computer_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_advanced_upgrade.json new file mode 100644 index 000000000..32aa88341 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_advanced_upgrade.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_components": { + "conditions": {"items": [{"items": ["computercraft:computer_normal"]}, {"tag": "c:gold_ingots"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:computer_advanced_upgrade"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_components", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:computer_advanced_upgrade"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_command.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_command.json new file mode 100644 index 000000000..39bb35ac5 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_command.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_components": { + "conditions": {"items": [{"items": ["minecraft:command_block"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:computer_command"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_components", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:computer_command"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_normal.json new file mode 100644 index 000000000..b0f09ab45 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/computer_normal.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_redstone": { + "conditions": {"items": [{"tag": "c:redstone_dusts"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:computer_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_redstone", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:computer_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_1.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_1.json new file mode 100644 index 000000000..6efbaf513 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_1.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_1"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_1"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_10.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_10.json new file mode 100644 index 000000000..59eb9ab39 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_10.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_10"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_10"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_11.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_11.json new file mode 100644 index 000000000..4b85efc3e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_11.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_11"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_11"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_12.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_12.json new file mode 100644 index 000000000..9c497cee1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_12.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_12"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_12"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_13.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_13.json new file mode 100644 index 000000000..2a469f0b1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_13.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_13"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_13"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_14.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_14.json new file mode 100644 index 000000000..623a68038 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_14.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_14"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_14"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_15.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_15.json new file mode 100644 index 000000000..6f237ae70 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_15.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_15"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_15"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_16.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_16.json new file mode 100644 index 000000000..7b8081291 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_16.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_16"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_16"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_2.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_2.json new file mode 100644 index 000000000..c3fc5d11c --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_2.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_2"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_2"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_3.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_3.json new file mode 100644 index 000000000..ee780b872 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_3.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_3"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_3"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_4.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_4.json new file mode 100644 index 000000000..442b0fc67 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_4.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_4"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_4"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_5.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_5.json new file mode 100644 index 000000000..d09c33282 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_5.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_5"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_5"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_6.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_6.json new file mode 100644 index 000000000..f697bf18c --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_6.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_6"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_6"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_7.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_7.json new file mode 100644 index 000000000..5ebd52ec7 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_7.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_7"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_7"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_8.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_8.json new file mode 100644 index 000000000..05fcbde12 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_8.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_8"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_8"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_9.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_9.json new file mode 100644 index 000000000..309e0d497 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_9.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_drive": { + "conditions": {"items": [{"items": ["computercraft:disk_drive"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_9"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_drive", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_9"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_drive.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_drive.json new file mode 100644 index 000000000..31ce50828 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/disk_drive.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:disk_drive"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:disk_drive"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/monitor_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/monitor_advanced.json new file mode 100644 index 000000000..7fc8c04f4 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/monitor_advanced.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:monitor_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:monitor_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/monitor_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/monitor_normal.json new file mode 100644 index 000000000..54c4ca3e6 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/monitor_normal.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:monitor_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:monitor_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/speaker.json new file mode 100644 index 000000000..a140b16db --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/speaker.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:pocket_computer_advanced"]}, {"items": ["computercraft:speaker"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_advanced/computercraft/speaker"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/speaker"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..a7b7f80f0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/wireless_modem_advanced.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:pocket_computer_advanced"]}, + {"items": ["computercraft:wireless_modem_advanced"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_advanced/computercraft/wireless_modem_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..1e256df89 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_advanced/computercraft/wireless_modem_normal.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:pocket_computer_advanced"]}, + {"items": ["computercraft:wireless_modem_normal"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_advanced/computercraft/wireless_modem_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_advanced/computercraft/wireless_modem_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_advanced.json new file mode 100644 index 000000000..43ddc1ffe --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_advanced.json @@ -0,0 +1,19 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_apple": { + "conditions": {"items": [{"items": ["minecraft:golden_apple"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_computer_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_apple", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_computer_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_advanced_upgrade.json new file mode 100644 index 000000000..7277c0833 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_advanced_upgrade.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_components": { + "conditions": {"items": [{"items": ["computercraft:pocket_computer_normal"]}, {"tag": "c:gold_ingots"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_computer_advanced_upgrade"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_components", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_computer_advanced_upgrade"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_normal.json new file mode 100644 index 000000000..d471e5d8c --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_computer_normal.json @@ -0,0 +1,19 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_apple": { + "conditions": {"items": [{"items": ["minecraft:golden_apple"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_computer_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_apple", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_computer_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/speaker.json new file mode 100644 index 000000000..336423ac1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/speaker.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:pocket_computer_normal"]}, {"items": ["computercraft:speaker"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_normal/computercraft/speaker"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/speaker"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..4f05e22e5 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/wireless_modem_advanced.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:pocket_computer_normal"]}, + {"items": ["computercraft:wireless_modem_advanced"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_normal/computercraft/wireless_modem_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..488075e42 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/pocket_normal/computercraft/wireless_modem_normal.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:pocket_computer_normal"]}, + {"items": ["computercraft:wireless_modem_normal"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:pocket_normal/computercraft/wireless_modem_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:pocket_normal/computercraft/wireless_modem_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printed_book.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printed_book.json new file mode 100644 index 000000000..ab5743fa3 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printed_book.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_printer": { + "conditions": {"items": [{"items": ["computercraft:printer"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:printed_book"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_printer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:printed_book"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printed_pages.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printed_pages.json new file mode 100644 index 000000000..7ee19a946 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printed_pages.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_printer": { + "conditions": {"items": [{"items": ["computercraft:printer"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:printed_pages"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_printer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:printed_pages"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printer.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printer.json new file mode 100644 index 000000000..7760559b5 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/printer.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:printer"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:printer"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/speaker.json new file mode 100644 index 000000000..a4cfa68a3 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/speaker.json @@ -0,0 +1,12 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": {"conditions": {"recipe": "computercraft:speaker"}, "trigger": "minecraft:recipe_unlocked"} + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:speaker"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced.json new file mode 100644 index 000000000..25ddb95fd --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"items": ["computercraft:computer_normal"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/speaker.json new file mode 100644 index 000000000..fe5ecf99f --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/speaker.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_advanced"]}, {"items": ["computercraft:speaker"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/computercraft/speaker"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/speaker"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..c987dd29d --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/wireless_modem_advanced.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:turtle_advanced"]}, + {"items": ["computercraft:wireless_modem_advanced"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/computercraft/wireless_modem_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..0b7325811 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/computercraft/wireless_modem_normal.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:turtle_advanced"]}, + {"items": ["computercraft:wireless_modem_normal"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/computercraft/wireless_modem_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/computercraft/wireless_modem_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/crafting_table.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/crafting_table.json new file mode 100644 index 000000000..4ec2f683b --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/crafting_table.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_advanced"]}, {"items": ["minecraft:crafting_table"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/minecraft/crafting_table"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/crafting_table"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_axe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_axe.json new file mode 100644 index 000000000..e59726271 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_axe.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_advanced"]}, {"items": ["minecraft:diamond_axe"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/minecraft/diamond_axe"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_axe"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_hoe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_hoe.json new file mode 100644 index 000000000..458c5e577 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_hoe.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_advanced"]}, {"items": ["minecraft:diamond_hoe"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/minecraft/diamond_hoe"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_hoe"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_pickaxe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_pickaxe.json new file mode 100644 index 000000000..ed390b830 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_pickaxe.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_advanced"]}, {"items": ["minecraft:diamond_pickaxe"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/minecraft/diamond_pickaxe"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_pickaxe"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_shovel.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_shovel.json new file mode 100644 index 000000000..d9d643ce4 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_shovel.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_advanced"]}, {"items": ["minecraft:diamond_shovel"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/minecraft/diamond_shovel"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_shovel"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_sword.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_sword.json new file mode 100644 index 000000000..095ab5657 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced/minecraft/diamond_sword.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_advanced"]}, {"items": ["minecraft:diamond_sword"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced/minecraft/diamond_sword"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced/minecraft/diamond_sword"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced_upgrade.json new file mode 100644 index 000000000..f3799e126 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_advanced_upgrade.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_components": { + "conditions": {"items": [{"items": ["computercraft:turtle_normal"]}, {"tag": "c:gold_ingots"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_advanced_upgrade"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_components", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_advanced_upgrade"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal.json new file mode 100644 index 000000000..61e6213cc --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"items": ["computercraft:computer_normal"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/speaker.json new file mode 100644 index 000000000..3559d8032 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/speaker.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_normal"]}, {"items": ["computercraft:speaker"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/computercraft/speaker"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/speaker"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..1c8fdf045 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/wireless_modem_advanced.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:turtle_normal"]}, + {"items": ["computercraft:wireless_modem_advanced"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/computercraft/wireless_modem_advanced"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..dd96c072f --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/computercraft/wireless_modem_normal.json @@ -0,0 +1,20 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [ + {"items": ["computercraft:turtle_normal"]}, + {"items": ["computercraft:wireless_modem_normal"]} + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/computercraft/wireless_modem_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/computercraft/wireless_modem_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/crafting_table.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/crafting_table.json new file mode 100644 index 000000000..ad5023dab --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/crafting_table.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_normal"]}, {"items": ["minecraft:crafting_table"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/minecraft/crafting_table"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/crafting_table"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_axe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_axe.json new file mode 100644 index 000000000..af5bc1f06 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_axe.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_normal"]}, {"items": ["minecraft:diamond_axe"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/minecraft/diamond_axe"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_axe"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_hoe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_hoe.json new file mode 100644 index 000000000..72733b768 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_hoe.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_normal"]}, {"items": ["minecraft:diamond_hoe"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/minecraft/diamond_hoe"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_hoe"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_pickaxe.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_pickaxe.json new file mode 100644 index 000000000..2b64875f6 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_pickaxe.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_normal"]}, {"items": ["minecraft:diamond_pickaxe"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/minecraft/diamond_pickaxe"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_pickaxe"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_shovel.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_shovel.json new file mode 100644 index 000000000..2df36f6ec --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_shovel.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_normal"]}, {"items": ["minecraft:diamond_shovel"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/minecraft/diamond_shovel"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_shovel"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_sword.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_sword.json new file mode 100644 index 000000000..38ca7d929 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/turtle_normal/minecraft/diamond_sword.json @@ -0,0 +1,17 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_items": { + "conditions": { + "items": [{"items": ["computercraft:turtle_normal"]}, {"items": ["minecraft:diamond_sword"]}] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:turtle_normal/minecraft/diamond_sword"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_items", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:turtle_normal/minecraft/diamond_sword"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem.json new file mode 100644 index 000000000..84150e066 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem.json @@ -0,0 +1,19 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_cable": { + "conditions": {"items": [{"items": ["computercraft:cable"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:wired_modem"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_cable", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:wired_modem"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem_full_from.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem_full_from.json new file mode 100644 index 000000000..c01263d50 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem_full_from.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_modem": { + "conditions": {"items": [{"tag": "computercraft:wired_modem"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:wired_modem_full_from"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_modem", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:wired_modem_full_from"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem_full_to.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem_full_to.json new file mode 100644 index 000000000..bbf3d594d --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wired_modem_full_to.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_modem": { + "conditions": {"items": [{"tag": "computercraft:wired_modem"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:wired_modem_full_to"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_modem", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:wired_modem_full_to"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..bde8f9ab0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wireless_modem_advanced.json @@ -0,0 +1,19 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:wireless_modem_advanced"}, + "trigger": "minecraft:recipe_unlocked" + }, + "has_wireless": { + "conditions": {"items": [{"items": ["computercraft:wireless_modem_normal"]}]}, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [["has_computer", "has_wireless", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:wireless_modem_advanced"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..69165dfde --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/computercraft/wireless_modem_normal.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"tag": "computercraft:computer"}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:wireless_modem_normal"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:wireless_modem_normal"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json new file mode 100644 index 000000000..7a91a3f2b --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_cloudy.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_monitor": { + "conditions": {"items": [{"items": ["computercraft:monitor_normal"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:skull_cloudy"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_monitor", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:skull_cloudy"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json new file mode 100644 index 000000000..1e3705a92 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/advancements/recipes/decorations/skull_dan200.json @@ -0,0 +1,15 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_computer": { + "conditions": {"items": [{"items": ["computercraft:computer_advanced"]}]}, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": {"recipe": "computercraft:skull_dan200"}, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [["has_computer", "has_the_recipe"]], + "rewards": {"recipes": ["computercraft:skull_dan200"]} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/speaker.json new file mode 100644 index 000000000..a0bf2c67a --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/speaker.json @@ -0,0 +1 @@ +{"type": "computercraft:speaker", "item": "computercraft:speaker"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/wireless_modem_advanced.json new file mode 100644 index 000000000..8d9466900 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/wireless_modem_advanced.json @@ -0,0 +1 @@ +{"type": "computercraft:wireless_modem_advanced", "item": "computercraft:wireless_modem_advanced"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/wireless_modem_normal.json new file mode 100644 index 000000000..2c1a9cbd1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/computercraft/pocket_upgrades/wireless_modem_normal.json @@ -0,0 +1 @@ +{"type": "computercraft:wireless_modem_normal", "item": "computercraft:wireless_modem_normal"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/speaker.json new file mode 100644 index 000000000..a0bf2c67a --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/speaker.json @@ -0,0 +1 @@ +{"type": "computercraft:speaker", "item": "computercraft:speaker"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/wireless_modem_advanced.json new file mode 100644 index 000000000..8d9466900 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/wireless_modem_advanced.json @@ -0,0 +1 @@ +{"type": "computercraft:wireless_modem_advanced", "item": "computercraft:wireless_modem_advanced"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/wireless_modem_normal.json new file mode 100644 index 000000000..2c1a9cbd1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/computercraft/turtle_upgrades/wireless_modem_normal.json @@ -0,0 +1 @@ +{"type": "computercraft:wireless_modem_normal", "item": "computercraft:wireless_modem_normal"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/cable.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/cable.json new file mode 100644 index 000000000..3095afc7c --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/cable.json @@ -0,0 +1,34 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + {"condition": "minecraft:survives_explosion"}, + { + "block": "computercraft:cable", + "condition": "minecraft:block_state_property", + "properties": {"cable": "true"} + } + ], + "entries": [{"type": "minecraft:item", "name": "computercraft:cable"}], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + {"condition": "minecraft:survives_explosion"}, + { + "condition": "minecraft:inverted", + "term": { + "block": "computercraft:cable", + "condition": "minecraft:block_state_property", + "properties": {"modem": "none"} + } + } + ], + "entries": [{"type": "minecraft:item", "name": "computercraft:wired_modem"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json new file mode 100644 index 000000000..cfeeb00d0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_advanced.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + {"condition": "computercraft:block_named"}, + {"condition": "computercraft:has_id"}, + {"condition": "minecraft:inverted", "term": {"condition": "computercraft:player_creative"}} + ] + } + ], + "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json new file mode 100644 index 000000000..cfeeb00d0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_command.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + {"condition": "computercraft:block_named"}, + {"condition": "computercraft:has_id"}, + {"condition": "minecraft:inverted", "term": {"condition": "computercraft:player_creative"}} + ] + } + ], + "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json new file mode 100644 index 000000000..cfeeb00d0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/computer_normal.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + {"condition": "computercraft:block_named"}, + {"condition": "computercraft:has_id"}, + {"condition": "minecraft:inverted", "term": {"condition": "computercraft:player_creative"}} + ] + } + ], + "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/disk_drive.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/disk_drive.json new file mode 100644 index 000000000..463610e17 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/disk_drive.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [ + { + "type": "minecraft:item", + "functions": [{"function": "minecraft:copy_name", "source": "block_entity"}], + "name": "computercraft:disk_drive" + } + ], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_advanced.json new file mode 100644 index 000000000..dc41695fc --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_advanced.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [{"type": "minecraft:item", "name": "computercraft:monitor_advanced"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_normal.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_normal.json new file mode 100644 index 000000000..a82a28db3 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/monitor_normal.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [{"type": "minecraft:item", "name": "computercraft:monitor_normal"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/printer.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/printer.json new file mode 100644 index 000000000..4ca01144d --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/printer.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [ + { + "type": "minecraft:item", + "functions": [{"function": "minecraft:copy_name", "source": "block_entity"}], + "name": "computercraft:printer" + } + ], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/speaker.json new file mode 100644 index 000000000..cd383f39c --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/speaker.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [{"type": "minecraft:item", "name": "computercraft:speaker"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json new file mode 100644 index 000000000..cfeeb00d0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_advanced.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + {"condition": "computercraft:block_named"}, + {"condition": "computercraft:has_id"}, + {"condition": "minecraft:inverted", "term": {"condition": "computercraft:player_creative"}} + ] + } + ], + "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json new file mode 100644 index 000000000..cfeeb00d0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/turtle_normal.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:alternative", + "terms": [ + {"condition": "computercraft:block_named"}, + {"condition": "computercraft:has_id"}, + {"condition": "minecraft:inverted", "term": {"condition": "computercraft:player_creative"}} + ] + } + ], + "entries": [{"type": "minecraft:dynamic", "name": "computercraft:computer"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wired_modem_full.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wired_modem_full.json new file mode 100644 index 000000000..1858357d0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wired_modem_full.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [{"type": "minecraft:item", "name": "computercraft:wired_modem_full"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_advanced.json new file mode 100644 index 000000000..3b125e5a7 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_advanced.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [{"type": "minecraft:item", "name": "computercraft:wireless_modem_advanced"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_normal.json new file mode 100644 index 000000000..071f48592 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/blocks/wireless_modem_normal.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [{"condition": "minecraft:survives_explosion"}], + "entries": [{"type": "minecraft:item", "name": "computercraft:wireless_modem_normal"}], + "rolls": 1.0 + } + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/loot_tables/treasure_disk.json b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/treasure_disk.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/loot_tables/treasure_disk.json @@ -0,0 +1 @@ +{} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/cable.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/cable.json new file mode 100644 index 000000000..293f722c4 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/cable.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"item": "minecraft:stone"}, "R": {"tag": "c:redstone_dusts"}}, + "pattern": [" # ", "#R#", " # "], + "result": {"count": 6, "item": "computercraft:cable"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/colour.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/colour.json new file mode 100644 index 000000000..d1952921d --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/colour.json @@ -0,0 +1 @@ +{"type": "computercraft:colour"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_advanced.json new file mode 100644 index 000000000..917c864d7 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_advanced.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"tag": "c:gold_ingots"}, "G": {"tag": "c:glass_panes"}, "R": {"tag": "c:redstone_dusts"}}, + "pattern": ["###", "#R#", "#G#"], + "result": {"item": "computercraft:computer_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_advanced_upgrade.json new file mode 100644 index 000000000..3d18919a3 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_advanced_upgrade.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:computer_upgrade", + "family": "ADVANCED", + "key": {"#": {"tag": "c:gold_ingots"}, "C": {"item": "computercraft:computer_advanced"}}, + "pattern": ["###", "#C#", "# #"], + "result": {"item": "computercraft:computer_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_command.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_command.json new file mode 100644 index 000000000..a5d87567c --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_command.json @@ -0,0 +1,10 @@ +{ + "type": "minecraft:crafting_shaped", + "key": { + "#": {"tag": "c:gold_ingots"}, + "G": {"tag": "c:glass_panes"}, + "R": {"item": "minecraft:command_block"} + }, + "pattern": ["###", "#R#", "#G#"], + "result": {"item": "computercraft:computer_command"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_normal.json new file mode 100644 index 000000000..952788bcb --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/computer_normal.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"item": "minecraft:stone"}, "G": {"tag": "c:glass_panes"}, "R": {"tag": "c:redstone_dusts"}}, + "pattern": ["###", "#R#", "#G#"], + "result": {"item": "computercraft:computer_normal"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk.json new file mode 100644 index 000000000..6b973d871 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk.json @@ -0,0 +1 @@ +{"type": "computercraft:disk"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_1.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_1.json new file mode 100644 index 000000000..7af01d88e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_1.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:black_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:1118481}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_10.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_10.json new file mode 100644 index 000000000..8be5d647a --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_10.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:pink_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:15905484}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_11.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_11.json new file mode 100644 index 000000000..3a3107700 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_11.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:lime_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:8375321}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_12.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_12.json new file mode 100644 index 000000000..f9880fe0e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_12.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:yellow_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:14605932}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_13.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_13.json new file mode 100644 index 000000000..6c7b31b37 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_13.json @@ -0,0 +1,10 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [ + {"tag": "c:redstone_dusts"}, + {"item": "minecraft:paper"}, + {"item": "minecraft:light_blue_dye"} + ], + "result": {"item": "computercraft:disk", "nbt": "{Color:10072818}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_14.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_14.json new file mode 100644 index 000000000..085053050 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_14.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:magenta_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:15040472}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_15.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_15.json new file mode 100644 index 000000000..be5a4ecbb --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_15.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:orange_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:15905331}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_16.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_16.json new file mode 100644 index 000000000..2e9a19a2b --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_16.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:white_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:15790320}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_2.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_2.json new file mode 100644 index 000000000..666c72951 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_2.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:red_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:13388876}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_3.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_3.json new file mode 100644 index 000000000..a261a4b73 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_3.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:green_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:5744206}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_4.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_4.json new file mode 100644 index 000000000..0f9519208 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_4.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:brown_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:8349260}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_5.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_5.json new file mode 100644 index 000000000..279a27970 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_5.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:blue_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:3368652}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_6.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_6.json new file mode 100644 index 000000000..24a02fd17 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_6.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:purple_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:11691749}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_7.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_7.json new file mode 100644 index 000000000..ed0d23cea --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_7.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:cyan_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:5020082}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_8.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_8.json new file mode 100644 index 000000000..6a1171ccc --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_8.json @@ -0,0 +1,10 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [ + {"tag": "c:redstone_dusts"}, + {"item": "minecraft:paper"}, + {"item": "minecraft:light_gray_dye"} + ], + "result": {"item": "computercraft:disk", "nbt": "{Color:10066329}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_9.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_9.json new file mode 100644 index 000000000..d36626333 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_9.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:impostor_shapeless", + "group": "computercraft:disk", + "ingredients": [{"tag": "c:redstone_dusts"}, {"item": "minecraft:paper"}, {"item": "minecraft:gray_dye"}], + "result": {"item": "computercraft:disk", "nbt": "{Color:5000268}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_drive.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_drive.json new file mode 100644 index 000000000..9a8a09876 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/disk_drive.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"item": "minecraft:stone"}, "R": {"tag": "c:redstone_dusts"}}, + "pattern": ["###", "#R#", "#R#"], + "result": {"item": "computercraft:disk_drive"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/monitor_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/monitor_advanced.json new file mode 100644 index 000000000..5db16836b --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/monitor_advanced.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"tag": "c:gold_ingots"}, "G": {"tag": "c:glass_panes"}}, + "pattern": ["###", "#G#", "###"], + "result": {"count": 4, "item": "computercraft:monitor_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/monitor_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/monitor_normal.json new file mode 100644 index 000000000..038e4db69 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/monitor_normal.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"item": "minecraft:stone"}, "G": {"tag": "c:glass_panes"}}, + "pattern": ["###", "#G#", "###"], + "result": {"item": "computercraft:monitor_normal"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/speaker.json new file mode 100644 index 000000000..3e9ffc667 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/speaker.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:pocket_advanced", + "key": {"#": {"item": "computercraft:speaker"}, "P": {"item": "computercraft:pocket_computer_advanced"}}, + "pattern": ["#", "P"], + "result": {"item": "computercraft:pocket_computer_advanced", "nbt": "{Upgrade:\"computercraft:speaker\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..c421eb36a --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/wireless_modem_advanced.json @@ -0,0 +1,13 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:pocket_advanced", + "key": { + "#": {"item": "computercraft:wireless_modem_advanced"}, + "P": {"item": "computercraft:pocket_computer_advanced"} + }, + "pattern": ["#", "P"], + "result": { + "item": "computercraft:pocket_computer_advanced", + "nbt": "{Upgrade:\"computercraft:wireless_modem_advanced\"}" + } +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..a649307b0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_advanced/computercraft/wireless_modem_normal.json @@ -0,0 +1,13 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:pocket_advanced", + "key": { + "#": {"item": "computercraft:wireless_modem_normal"}, + "P": {"item": "computercraft:pocket_computer_advanced"} + }, + "pattern": ["#", "P"], + "result": { + "item": "computercraft:pocket_computer_advanced", + "nbt": "{Upgrade:\"computercraft:wireless_modem_normal\"}" + } +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_advanced.json new file mode 100644 index 000000000..cc02ee60a --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_advanced.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"tag": "c:gold_ingots"}, "A": {"item": "minecraft:golden_apple"}, "G": {"tag": "c:glass_panes"}}, + "pattern": ["###", "#A#", "#G#"], + "result": {"item": "computercraft:pocket_computer_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_advanced_upgrade.json new file mode 100644 index 000000000..b7be5cc56 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_advanced_upgrade.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:computer_upgrade", + "family": "ADVANCED", + "key": {"#": {"tag": "c:gold_ingots"}, "C": {"item": "computercraft:pocket_computer_normal"}}, + "pattern": ["###", "#C#", "# #"], + "result": {"item": "computercraft:pocket_computer_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_normal.json new file mode 100644 index 000000000..ca863e79e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_normal.json @@ -0,0 +1,10 @@ +{ + "type": "minecraft:crafting_shaped", + "key": { + "#": {"item": "minecraft:stone"}, + "A": {"item": "minecraft:golden_apple"}, + "G": {"tag": "c:glass_panes"} + }, + "pattern": ["###", "#A#", "#G#"], + "result": {"item": "computercraft:pocket_computer_normal"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_upgrade.json new file mode 100644 index 000000000..5c4c023dc --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_computer_upgrade.json @@ -0,0 +1 @@ +{"type": "computercraft:pocket_computer_upgrade"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/speaker.json new file mode 100644 index 000000000..b3bb6806f --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/speaker.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:pocket_normal", + "key": {"#": {"item": "computercraft:speaker"}, "P": {"item": "computercraft:pocket_computer_normal"}}, + "pattern": ["#", "P"], + "result": {"item": "computercraft:pocket_computer_normal", "nbt": "{Upgrade:\"computercraft:speaker\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..96c9fb7ab --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/wireless_modem_advanced.json @@ -0,0 +1,13 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:pocket_normal", + "key": { + "#": {"item": "computercraft:wireless_modem_advanced"}, + "P": {"item": "computercraft:pocket_computer_normal"} + }, + "pattern": ["#", "P"], + "result": { + "item": "computercraft:pocket_computer_normal", + "nbt": "{Upgrade:\"computercraft:wireless_modem_advanced\"}" + } +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..fdb82cf1e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/pocket_normal/computercraft/wireless_modem_normal.json @@ -0,0 +1,13 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:pocket_normal", + "key": { + "#": {"item": "computercraft:wireless_modem_normal"}, + "P": {"item": "computercraft:pocket_computer_normal"} + }, + "pattern": ["#", "P"], + "result": { + "item": "computercraft:pocket_computer_normal", + "nbt": "{Upgrade:\"computercraft:wireless_modem_normal\"}" + } +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/printed_book.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/printed_book.json new file mode 100644 index 000000000..791d190f8 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/printed_book.json @@ -0,0 +1,9 @@ +{ + "type": "computercraft:impostor_shapeless", + "ingredients": [ + {"item": "minecraft:leather"}, + {"item": "computercraft:printed_page"}, + {"item": "minecraft:string"} + ], + "result": {"item": "computercraft:printed_book"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/printed_pages.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/printed_pages.json new file mode 100644 index 000000000..8413b8584 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/printed_pages.json @@ -0,0 +1,9 @@ +{ + "type": "computercraft:impostor_shapeless", + "ingredients": [ + {"item": "computercraft:printed_page"}, + {"item": "computercraft:printed_page"}, + {"item": "minecraft:string"} + ], + "result": {"item": "computercraft:printed_pages"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/printer.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/printer.json new file mode 100644 index 000000000..e762075db --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/printer.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"item": "minecraft:stone"}, "D": {"tag": "c:dyes"}, "R": {"tag": "c:redstone_dusts"}}, + "pattern": ["###", "#R#", "#D#"], + "result": {"item": "computercraft:printer"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/printout.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/printout.json new file mode 100644 index 000000000..21e85df52 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/printout.json @@ -0,0 +1 @@ +{"type": "computercraft:printout"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/skull_cloudy.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/skull_cloudy.json new file mode 100644 index 000000000..1f0c24401 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/skull_cloudy.json @@ -0,0 +1,8 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [{"tag": "c:skulls"}, {"item": "computercraft:monitor_normal"}], + "result": { + "item": "minecraft:player_head", + "nbt": "{SkullOwner:{Id:\"6d074736-b1e9-4378-a99b-bd8777821c9c\",Name:\"Cloudhunter\"}}" + } +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/skull_dan200.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/skull_dan200.json new file mode 100644 index 000000000..e92254d21 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/skull_dan200.json @@ -0,0 +1,8 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [{"tag": "c:skulls"}, {"item": "computercraft:computer_advanced"}], + "result": { + "item": "minecraft:player_head", + "nbt": "{SkullOwner:{Id:\"f3c8d69b-0776-4512-8434-d1b2165909eb\",Name:\"dan200\"}}" + } +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/speaker.json new file mode 100644 index 000000000..e2fcd278e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/speaker.json @@ -0,0 +1,10 @@ +{ + "type": "minecraft:crafting_shaped", + "key": { + "#": {"item": "minecraft:stone"}, + "N": {"item": "minecraft:note_block"}, + "R": {"tag": "c:redstone_dusts"} + }, + "pattern": ["###", "#N#", "#R#"], + "result": {"item": "computercraft:speaker"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced.json new file mode 100644 index 000000000..d54bd452e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced.json @@ -0,0 +1,11 @@ +{ + "type": "computercraft:turtle", + "family": "ADVANCED", + "key": { + "#": {"tag": "c:gold_ingots"}, + "C": {"item": "computercraft:computer_advanced"}, + "I": {"tag": "c:wooden_chests"} + }, + "pattern": ["###", "#C#", "#I#"], + "result": {"item": "computercraft:turtle_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/speaker.json new file mode 100644 index 000000000..b03916f8e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/speaker.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "computercraft:speaker"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"computercraft:speaker\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..30fa0de1f --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/wireless_modem_advanced.json @@ -0,0 +1,10 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "computercraft:wireless_modem_advanced"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": { + "item": "computercraft:turtle_advanced", + "nbt": "{RightUpgrade:\"computercraft:wireless_modem_advanced\"}" + } +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..59bee9b44 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/computercraft/wireless_modem_normal.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "computercraft:wireless_modem_normal"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"computercraft:wireless_modem_normal\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/crafting_table.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/crafting_table.json new file mode 100644 index 000000000..f4b6fd0bd --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/crafting_table.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "minecraft:crafting_table"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"minecraft:crafting_table\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_axe.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_axe.json new file mode 100644 index 000000000..988e54d16 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_axe.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "minecraft:diamond_axe"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"minecraft:diamond_axe\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_hoe.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_hoe.json new file mode 100644 index 000000000..04ba561d6 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_hoe.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "minecraft:diamond_hoe"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"minecraft:diamond_hoe\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_pickaxe.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_pickaxe.json new file mode 100644 index 000000000..ac9c03067 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_pickaxe.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "minecraft:diamond_pickaxe"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"minecraft:diamond_pickaxe\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_shovel.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_shovel.json new file mode 100644 index 000000000..839eea44e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_shovel.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "minecraft:diamond_shovel"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"minecraft:diamond_shovel\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_sword.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_sword.json new file mode 100644 index 000000000..6b67bc7f6 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced/minecraft/diamond_sword.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_advanced", + "key": {"#": {"item": "minecraft:diamond_sword"}, "T": {"item": "computercraft:turtle_advanced"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_advanced", "nbt": "{RightUpgrade:\"minecraft:diamond_sword\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced_upgrade.json new file mode 100644 index 000000000..b27e368c5 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_advanced_upgrade.json @@ -0,0 +1,11 @@ +{ + "type": "computercraft:computer_upgrade", + "family": "ADVANCED", + "key": { + "#": {"tag": "c:gold_ingots"}, + "B": {"item": "minecraft:gold_block"}, + "C": {"item": "computercraft:computer_advanced"} + }, + "pattern": ["###", "#C#", " B "], + "result": {"item": "computercraft:turtle_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal.json new file mode 100644 index 000000000..9aeed26a1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal.json @@ -0,0 +1,11 @@ +{ + "type": "computercraft:turtle", + "family": "NORMAL", + "key": { + "#": {"tag": "c:iron_ingots"}, + "C": {"item": "computercraft:computer_normal"}, + "I": {"tag": "c:wooden_chests"} + }, + "pattern": ["###", "#C#", "#I#"], + "result": {"item": "computercraft:turtle_normal"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/speaker.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/speaker.json new file mode 100644 index 000000000..255a0c433 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/speaker.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "computercraft:speaker"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"computercraft:speaker\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/wireless_modem_advanced.json new file mode 100644 index 000000000..d031e4afa --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/wireless_modem_advanced.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "computercraft:wireless_modem_advanced"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"computercraft:wireless_modem_advanced\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/wireless_modem_normal.json new file mode 100644 index 000000000..07a32a048 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/computercraft/wireless_modem_normal.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "computercraft:wireless_modem_normal"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"computercraft:wireless_modem_normal\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/crafting_table.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/crafting_table.json new file mode 100644 index 000000000..05365d33e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/crafting_table.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "minecraft:crafting_table"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"minecraft:crafting_table\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_axe.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_axe.json new file mode 100644 index 000000000..59362e0c5 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_axe.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "minecraft:diamond_axe"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"minecraft:diamond_axe\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_hoe.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_hoe.json new file mode 100644 index 000000000..7b3d28761 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_hoe.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "minecraft:diamond_hoe"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"minecraft:diamond_hoe\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_pickaxe.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_pickaxe.json new file mode 100644 index 000000000..36f660f53 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_pickaxe.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "minecraft:diamond_pickaxe"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"minecraft:diamond_pickaxe\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_shovel.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_shovel.json new file mode 100644 index 000000000..e9e9bf05f --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_shovel.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "minecraft:diamond_shovel"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"minecraft:diamond_shovel\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_sword.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_sword.json new file mode 100644 index 000000000..483b16b7d --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_normal/minecraft/diamond_sword.json @@ -0,0 +1,7 @@ +{ + "type": "computercraft:impostor_shaped", + "group": "computercraft:turtle_normal", + "key": {"#": {"item": "minecraft:diamond_sword"}, "T": {"item": "computercraft:turtle_normal"}}, + "pattern": ["#T"], + "result": {"item": "computercraft:turtle_normal", "nbt": "{RightUpgrade:\"minecraft:diamond_sword\"}"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_upgrade.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_upgrade.json new file mode 100644 index 000000000..1aa114c8b --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/turtle_upgrade.json @@ -0,0 +1 @@ +{"type": "computercraft:turtle_upgrade"} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem.json new file mode 100644 index 000000000..44a2a366f --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"item": "minecraft:stone"}, "R": {"tag": "c:redstone_dusts"}}, + "pattern": ["###", "#R#", "###"], + "result": {"item": "computercraft:wired_modem"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem_full_from.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem_full_from.json new file mode 100644 index 000000000..843f6c344 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem_full_from.json @@ -0,0 +1,5 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [{"item": "computercraft:wired_modem"}], + "result": {"item": "computercraft:wired_modem_full"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem_full_to.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem_full_to.json new file mode 100644 index 000000000..aca1cc1f1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/wired_modem_full_to.json @@ -0,0 +1,5 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [{"item": "computercraft:wired_modem_full"}], + "result": {"item": "computercraft:wired_modem"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/wireless_modem_advanced.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/wireless_modem_advanced.json new file mode 100644 index 000000000..b922cdf86 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/wireless_modem_advanced.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"tag": "c:gold_ingots"}, "E": {"item": "minecraft:ender_eye"}}, + "pattern": ["###", "#E#", "###"], + "result": {"item": "computercraft:wireless_modem_advanced"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/recipes/wireless_modem_normal.json b/projects/fabric/src/generated/resources/data/computercraft/recipes/wireless_modem_normal.json new file mode 100644 index 000000000..af1116f79 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/recipes/wireless_modem_normal.json @@ -0,0 +1,6 @@ +{ + "type": "minecraft:crafting_shaped", + "key": {"#": {"item": "minecraft:stone"}, "E": {"item": "minecraft:ender_pearl"}}, + "pattern": ["###", "#E#", "###"], + "result": {"item": "computercraft:wireless_modem_normal"} +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/computer.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/computer.json new file mode 100644 index 000000000..729a9ae47 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/computer.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["computercraft:computer_normal", "computercraft:computer_advanced", "computercraft:computer_command"] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/monitor.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/monitor.json new file mode 100644 index 000000000..6e4da8ff4 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/monitor.json @@ -0,0 +1 @@ +{"replace": false, "values": ["computercraft:monitor_normal", "computercraft:monitor_advanced"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle.json new file mode 100644 index 000000000..2db823bf0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle.json @@ -0,0 +1 @@ +{"replace": false, "values": ["computercraft:turtle_normal", "computercraft:turtle_advanced"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_always_breakable.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_always_breakable.json new file mode 100644 index 000000000..21f9e4f15 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_always_breakable.json @@ -0,0 +1 @@ +{"replace": false, "values": ["#minecraft:leaves", "minecraft:bamboo", "minecraft:bamboo_sapling"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_hoe_harvestable.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_hoe_harvestable.json new file mode 100644 index 000000000..6f687aeb6 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_hoe_harvestable.json @@ -0,0 +1,12 @@ +{ + "replace": false, + "values": [ + "#minecraft:crops", + "#minecraft:mineable/hoe", + "minecraft:cactus", + "minecraft:melon", + "minecraft:pumpkin", + "minecraft:carved_pumpkin", + "minecraft:jack_o_lantern" + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_shovel_harvestable.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_shovel_harvestable.json new file mode 100644 index 000000000..06ba799d8 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_shovel_harvestable.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "#minecraft:mineable/shovel", + "minecraft:melon", + "minecraft:pumpkin", + "minecraft:carved_pumpkin", + "minecraft:jack_o_lantern" + ] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_sword_harvestable.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_sword_harvestable.json new file mode 100644 index 000000000..a17d3f42f --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/turtle_sword_harvestable.json @@ -0,0 +1 @@ +{"replace": false, "values": ["#minecraft:wool", "minecraft:cobweb"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/wired_modem.json b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/wired_modem.json new file mode 100644 index 000000000..bd775eb4d --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/blocks/wired_modem.json @@ -0,0 +1 @@ +{"replace": false, "values": ["computercraft:cable", "computercraft:wired_modem_full"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/items/computer.json b/projects/fabric/src/generated/resources/data/computercraft/tags/items/computer.json new file mode 100644 index 000000000..729a9ae47 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/items/computer.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": ["computercraft:computer_normal", "computercraft:computer_advanced", "computercraft:computer_command"] +} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/items/monitor.json b/projects/fabric/src/generated/resources/data/computercraft/tags/items/monitor.json new file mode 100644 index 000000000..6e4da8ff4 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/items/monitor.json @@ -0,0 +1 @@ +{"replace": false, "values": ["computercraft:monitor_normal", "computercraft:monitor_advanced"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/items/turtle.json b/projects/fabric/src/generated/resources/data/computercraft/tags/items/turtle.json new file mode 100644 index 000000000..2db823bf0 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/items/turtle.json @@ -0,0 +1 @@ +{"replace": false, "values": ["computercraft:turtle_normal", "computercraft:turtle_advanced"]} diff --git a/projects/fabric/src/generated/resources/data/computercraft/tags/items/wired_modem.json b/projects/fabric/src/generated/resources/data/computercraft/tags/items/wired_modem.json new file mode 100644 index 000000000..7f724b9d1 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/computercraft/tags/items/wired_modem.json @@ -0,0 +1 @@ +{"replace": false, "values": ["computercraft:wired_modem", "computercraft:wired_modem_full"]} diff --git a/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/crafting_table.json b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/crafting_table.json new file mode 100644 index 000000000..2e981355e --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/crafting_table.json @@ -0,0 +1 @@ +{"type": "computercraft:workbench", "item": "minecraft:crafting_table"} diff --git a/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_axe.json b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_axe.json new file mode 100644 index 000000000..5ecefb5e6 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_axe.json @@ -0,0 +1 @@ +{"type": "computercraft:tool", "damageMultiplier": 6.0, "item": "minecraft:diamond_axe"} diff --git a/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_hoe.json b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_hoe.json new file mode 100644 index 000000000..66a5cf9fa --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_hoe.json @@ -0,0 +1 @@ +{"type": "computercraft:tool", "breakable": "computercraft:turtle_hoe_harvestable", "item": "minecraft:diamond_hoe"} diff --git a/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_pickaxe.json b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_pickaxe.json new file mode 100644 index 000000000..1bced4e59 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_pickaxe.json @@ -0,0 +1 @@ +{"type": "computercraft:tool", "item": "minecraft:diamond_pickaxe"} diff --git a/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_shovel.json b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_shovel.json new file mode 100644 index 000000000..c3d57f601 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_shovel.json @@ -0,0 +1,5 @@ +{ + "type": "computercraft:tool", + "breakable": "computercraft:turtle_shovel_harvestable", + "item": "minecraft:diamond_shovel" +} diff --git a/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_sword.json b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_sword.json new file mode 100644 index 000000000..2899cfd19 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/computercraft/turtle_upgrades/diamond_sword.json @@ -0,0 +1,6 @@ +{ + "type": "computercraft:tool", + "breakable": "computercraft:turtle_sword_harvestable", + "damageMultiplier": 9.0, + "item": "minecraft:diamond_sword" +} diff --git a/projects/fabric/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/projects/fabric/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json new file mode 100644 index 000000000..832d21271 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -0,0 +1,18 @@ +{ + "replace": false, + "values": [ + "computercraft:computer_normal", + "computercraft:computer_advanced", + "computercraft:turtle_normal", + "computercraft:turtle_advanced", + "computercraft:speaker", + "computercraft:disk_drive", + "computercraft:printer", + "computercraft:monitor_normal", + "computercraft:monitor_advanced", + "computercraft:wireless_modem_normal", + "computercraft:wireless_modem_advanced", + "computercraft:wired_modem_full", + "computercraft:cable" + ] +} diff --git a/projects/fabric/src/generated/resources/data/minecraft/tags/items/piglin_loved.json b/projects/fabric/src/generated/resources/data/minecraft/tags/items/piglin_loved.json new file mode 100644 index 000000000..534e2a988 --- /dev/null +++ b/projects/fabric/src/generated/resources/data/minecraft/tags/items/piglin_loved.json @@ -0,0 +1,10 @@ +{ + "replace": false, + "values": [ + "computercraft:computer_advanced", + "computercraft:turtle_advanced", + "computercraft:wireless_modem_advanced", + "computercraft:pocket_computer_advanced", + "computercraft:monitor_advanced" + ] +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/data/FabricDataGenerators.java b/projects/fabric/src/main/java/dan200/computercraft/data/FabricDataGenerators.java new file mode 100644 index 000000000..5697305f8 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/data/FabricDataGenerators.java @@ -0,0 +1,108 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.data; + +import com.mojang.datafixers.util.Pair; +import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.fabricmc.fabric.api.datagen.v1.provider.SimpleFabricLootTableProvider; +import net.minecraft.data.DataProvider; +import net.minecraft.data.models.BlockModelGenerators; +import net.minecraft.data.models.ItemModelGenerators; +import net.minecraft.data.recipes.FinishedRecipe; +import net.minecraft.data.tags.TagsProvider; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.storage.loot.LootTable; +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSet; + +import java.util.List; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Supplier; + +public class FabricDataGenerators implements DataGeneratorEntrypoint { + @Override + public void onInitializeDataGenerator(FabricDataGenerator generator) { + DataProviders.add(generator, new PlatformGeneratorsImpl(generator), true, true); + + generator.addProvider(new MoreConventionalTagsProvider(generator)); + } + + private record PlatformGeneratorsImpl(FabricDataGenerator generator) implements DataProviders.GeneratorFactory { + @Override + public DataProvider recipes(Consumer> recipes) { + return new FabricRecipeProvider(generator) { + @Override + protected void generateRecipes(Consumer exporter) { + recipes.accept(exporter); + } + }; + } + + @Override + public List lootTable(List>>, LootContextParamSet>> tables) { + return tables.stream().map(table -> new SimpleFabricLootTableProvider(generator, table.getSecond()) { + @Override + public void accept(BiConsumer exporter) { + table.getFirst().get().accept(exporter); + } + }).toList(); + } + + + @Override + public TagsProvider blockTags(Consumer> tags) { + return new FabricTagProvider.BlockTagProvider(generator) { + @Override + protected void generateTags() { + tags.accept(this::tag); + } + }; + } + + @Override + public TagsProvider itemTags(Consumer tags, TagsProvider blocks) { + return new FabricTagProvider.ItemTagProvider(generator, (FabricTagProvider.BlockTagProvider) blocks) { + @Override + protected void generateTags() { + var self = this; + tags.accept(new TagProvider.ItemTagConsumer() { + @Override + public TagAppender tag(TagKey tag) { + return self.tag(tag); + } + + @Override + public void copy(TagKey block, TagKey item) { + self.copy(block, item); + } + }); + } + }; + } + + @Override + public DataProvider models(Consumer blocks, Consumer items) { + return new FabricModelProvider(generator) { + @Override + public void generateBlockStateModels(BlockModelGenerators generator) { + blocks.accept(generator); + } + + @Override + public void generateItemModels(ItemModelGenerators generator) { + items.accept(generator); + } + }; + } + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/data/MoreConventionalTagsProvider.java b/projects/fabric/src/main/java/dan200/computercraft/data/MoreConventionalTagsProvider.java new file mode 100644 index 000000000..e4c3810c6 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/data/MoreConventionalTagsProvider.java @@ -0,0 +1,26 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.data; + +import dan200.computercraft.shared.platform.MoreConventionalTags; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.world.item.Items; + +public class MoreConventionalTagsProvider extends FabricTagProvider.ItemTagProvider { + public MoreConventionalTagsProvider(FabricDataGenerator dataGenerator) { + super(dataGenerator); + } + + @Override + protected void generateTags() { + tag(MoreConventionalTags.SKULLS).add( + Items.CREEPER_HEAD, Items.DRAGON_HEAD, Items.PLAYER_HEAD, Items.SKELETON_SKULL, Items.WITHER_SKELETON_SKULL, + Items.ZOMBIE_HEAD + ); + tag(MoreConventionalTags.WOODEN_CHESTS).add(Items.CHEST, Items.TRAPPED_CHEST); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/impl/ComputerCraftAPIImpl.java b/projects/fabric/src/main/java/dan200/computercraft/impl/ComputerCraftAPIImpl.java new file mode 100644 index 000000000..cc5fdc8e4 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/impl/ComputerCraftAPIImpl.java @@ -0,0 +1,48 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.impl; + +import com.google.auto.service.AutoService; +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.detail.DetailRegistry; +import dan200.computercraft.api.filesystem.IMount; +import dan200.computercraft.impl.detail.DetailRegistryImpl; +import dan200.computercraft.shared.ComputerCraft; +import dan200.computercraft.shared.computer.core.ResourceMount; +import dan200.computercraft.shared.details.FluidDetails; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; +import net.fabricmc.loader.api.FabricLoader; + +import javax.annotation.Nullable; + +@AutoService(ComputerCraftAPIService.class) +public final class ComputerCraftAPIImpl extends AbstractComputerCraftAPI implements ComputerCraftAPIFabricService { + private final DetailRegistry> fluidDetails = new DetailRegistryImpl<>(FluidDetails::fillBasic); + + private @Nullable String version; + + @Override + public String getInstalledVersion() { + if (version != null) return version; + return version = FabricLoader.getInstance().getModContainer(ComputerCraftAPI.MOD_ID) + .map(x -> x.getMetadata().getVersion().toString()) + .orElse("unknown"); + } + + @Nullable + @Override + public IMount createResourceMount(String domain, String subPath) { + if (ComputerCraft.server == null) return null; + var mount = ResourceMount.get(domain, subPath, ComputerCraft.server.getResourceManager()); + return mount.exists("") ? mount : null; + } + + @Override + public DetailRegistry> getFluidDetailRegistry() { + return fluidDetails; + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ArgumentTypeInfosAccessor.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ArgumentTypeInfosAccessor.java new file mode 100644 index 000000000..d2eacac2e --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ArgumentTypeInfosAccessor.java @@ -0,0 +1,22 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import net.minecraft.commands.synchronization.ArgumentTypeInfo; +import net.minecraft.commands.synchronization.ArgumentTypeInfos; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import java.util.Map; + +@Mixin(ArgumentTypeInfos.class) +public interface ArgumentTypeInfosAccessor { + @Accessor("BY_CLASS") + @SuppressWarnings("DoNotCallSuggester") + static Map, ArgumentTypeInfo> classMap() { + throw new UnsupportedOperationException(); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ChunkMapMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ChunkMapMixin.java new file mode 100644 index 000000000..64fb3189c --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ChunkMapMixin.java @@ -0,0 +1,26 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import dan200.computercraft.shared.CommonHooks; +import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket; +import net.minecraft.server.level.ChunkMap; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.world.level.chunk.LevelChunk; +import org.apache.commons.lang3.mutable.MutableObject; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ChunkMap.class) +class ChunkMapMixin { + @Inject(method = "playerLoadedChunk", at = @At("TAIL")) + @SuppressWarnings("UnusedMethod") + private void onPlayerLoadedChunk(ServerPlayer player, MutableObject packetCache, LevelChunk chunk, CallbackInfo callback) { + CommonHooks.onChunkWatch(chunk, player); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/EntityMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/EntityMixin.java new file mode 100644 index 000000000..433f2939f --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/EntityMixin.java @@ -0,0 +1,28 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import dan200.computercraft.shared.CommonHooks; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(Entity.class) +class EntityMixin { + @Inject( + method = "spawnAtLocation(Lnet/minecraft/world/item/ItemStack;F)Lnet/minecraft/world/entity/item/ItemEntity;", + at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;addFreshEntity(Lnet/minecraft/world/entity/Entity;)Z"), + cancellable = true + ) + @SuppressWarnings("UnusedMethod") + private void spawnAtLocation(ItemStack stack, float yOffset, CallbackInfoReturnable cb) { + if (CommonHooks.onLivingDrop((Entity) (Object) this, stack)) cb.setReturnValue(null); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ExplosionDamageCalculatorMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ExplosionDamageCalculatorMixin.java new file mode 100644 index 000000000..942602e25 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ExplosionDamageCalculatorMixin.java @@ -0,0 +1,33 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import dan200.computercraft.shared.turtle.blocks.TurtleBlock; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Explosion; +import net.minecraft.world.level.ExplosionDamageCalculator; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.FluidState; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.Optional; + +@Mixin(ExplosionDamageCalculator.class) +class ExplosionDamageCalculatorMixin { + @Inject(method = "getBlockExplosionResistance", at = @At("HEAD"), cancellable = true) + @SuppressWarnings({ "UnusedMethod", "deprecation" }) + private void getBlockExplosionResistance(Explosion explosion, BlockGetter level, BlockPos pos, BlockState block, FluidState fluid, CallbackInfoReturnable> cir) { + if (block.getBlock() instanceof TurtleBlock turtle) { + cir.setReturnValue(Optional.of( + Math.max(turtle.getExplosionResistance(block, level, pos, explosion), fluid.getExplosionResistance()) + )); + } + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ItemEntityMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ItemEntityMixin.java new file mode 100644 index 000000000..c5f932911 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ItemEntityMixin.java @@ -0,0 +1,30 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import dan200.computercraft.shared.pocket.items.PocketComputerItem; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.item.ItemStack; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(ItemEntity.class) +abstract class ItemEntityMixin { + @Inject(method = "tick", at = @At("HEAD")) + @SuppressWarnings("UnusedMethod") + private void onTick(CallbackInfo ci) { + var stack = getItem(); + if (stack.getItem() instanceof PocketComputerItem pocket) { + pocket.onEntityItemUpdate(stack, (ItemEntity) (Object) this); + } + } + + @Shadow + public abstract ItemStack getItem(); +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ServerLevelMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ServerLevelMixin.java new file mode 100644 index 000000000..06064ce57 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ServerLevelMixin.java @@ -0,0 +1,23 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import dan200.computercraft.shared.CommonHooks; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.entity.Entity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(ServerLevel.class) +class ServerLevelMixin { + @Inject(method = "addEntity", at = @At("HEAD"), cancellable = true) + @SuppressWarnings("UnusedMethod") + private void addEntity(Entity entity, CallbackInfoReturnable cb) { + if (CommonHooks.onEntitySpawn(entity)) cb.setReturnValue(true); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/ShapedRecipeMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/ShapedRecipeMixin.java new file mode 100644 index 000000000..2bd5ef265 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/ShapedRecipeMixin.java @@ -0,0 +1,26 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import com.google.gson.JsonObject; +import dan200.computercraft.shared.FabricCommonHooks; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.ShapedRecipe; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(ShapedRecipe.class) +class ShapedRecipeMixin { + @Inject(method = "itemStackFromJson", at = @At("RETURN")) + @SuppressWarnings("UnusedMethod") + private static void itemStackFromJson(JsonObject json, CallbackInfoReturnable cir) { + // This is a fairly invasive mixin in the sense that every mod goes through this code path. We might want to + // remove this and use custom recipes types in the future. + FabricCommonHooks.addRecipeResultTag(cir.getReturnValue(), json); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/TagEntryAccessor.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/TagEntryAccessor.java new file mode 100644 index 000000000..1cf2cc1ef --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/TagEntryAccessor.java @@ -0,0 +1,17 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import net.minecraft.tags.TagEntry; +import net.minecraft.util.ExtraCodecs; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(TagEntry.class) +public interface TagEntryAccessor { + @Invoker("elementOrTag") + ExtraCodecs.TagOrElementLocation computercraft$elementOrTag(); +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/mixin/TagsProviderMixin.java b/projects/fabric/src/main/java/dan200/computercraft/mixin/TagsProviderMixin.java new file mode 100644 index 000000000..a10b818b9 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/mixin/TagsProviderMixin.java @@ -0,0 +1,27 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin; + +import net.minecraft.data.tags.TagsProvider; +import net.minecraft.tags.TagEntry; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +/** + * Don't throw when using a Minecraft tag inside {@link TagsProvider}. + *

+ * There's cleaner ways of doing this, like Forge's {@code ExistingFileHelper}, but I'm too lazy for that. + */ +@Mixin(TagsProvider.class) +class TagsProviderMixin { + @Inject(at = @At("HEAD"), method = "method_33130", cancellable = true) + public void onVerifyPresent(TagEntry tag, CallbackInfoReturnable cir) { + var element = ((TagEntryAccessor) tag).computercraft$elementOrTag(); + if (element.tag() && element.id().getNamespace().equals("minecraft")) cir.setReturnValue(false); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/ComputerCraft.java b/projects/fabric/src/main/java/dan200/computercraft/shared/ComputerCraft.java new file mode 100644 index 000000000..b8dcb9d26 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/ComputerCraft.java @@ -0,0 +1,132 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared; + +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.detail.FabricDetailRegistries; +import dan200.computercraft.api.node.wired.WiredElementLookup; +import dan200.computercraft.api.peripheral.PeripheralLookup; +import dan200.computercraft.api.pocket.PocketUpgradeSerialiser; +import dan200.computercraft.api.turtle.TurtleUpgradeSerialiser; +import dan200.computercraft.shared.command.CommandComputerCraft; +import dan200.computercraft.shared.config.Config; +import dan200.computercraft.shared.config.ConfigSpec; +import dan200.computercraft.shared.details.FluidDetails; +import dan200.computercraft.shared.network.client.UpgradesLoadedMessage; +import dan200.computercraft.shared.peripheral.commandblock.CommandBlockPeripheral; +import dan200.computercraft.shared.peripheral.generic.methods.InventoryMethods; +import dan200.computercraft.shared.peripheral.modem.wired.CableBlockEntity; +import dan200.computercraft.shared.peripheral.modem.wired.WiredModemFullBlockEntity; +import dan200.computercraft.shared.peripheral.modem.wireless.WirelessModemBlockEntity; +import dan200.computercraft.shared.platform.NetworkHandler; +import dan200.computercraft.shared.platform.PlatformHelper; +import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents; +import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.fabricmc.fabric.api.event.registry.FabricRegistryBuilder; +import net.fabricmc.fabric.api.loot.v2.LootTableEvents; +import net.fabricmc.fabric.api.resource.IdentifiableResourceReloadListener; +import net.fabricmc.fabric.api.resource.ResourceManagerHelper; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.packs.PackType; +import net.minecraft.server.packs.resources.PreparableReloadListener; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.util.profiling.ProfilerFiller; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraftforge.api.ModLoadingContext; +import net.minecraftforge.api.fml.event.config.ModConfigEvents; +import net.minecraftforge.fml.config.ModConfig; + +import javax.annotation.Nullable; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; + +public class ComputerCraft { + public static @Nullable MinecraftServer server; + + public static void init() { + NetworkHandler.init(); + FabricRegistryBuilder.createSimple(TurtleUpgradeSerialiser.class, TurtleUpgradeSerialiser.REGISTRY_ID.location()).buildAndRegister(); + FabricRegistryBuilder.createSimple(PocketUpgradeSerialiser.class, PocketUpgradeSerialiser.REGISTRY_ID.location()).buildAndRegister(); + ModRegistry.register(); + + // Register peripherals + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.COMPUTER_NORMAL.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.COMPUTER_ADVANCED.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.TURTLE_NORMAL.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.TURTLE_ADVANCED.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.SPEAKER.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.PRINTER.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.DISK_DRIVE.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.MONITOR_NORMAL.get()); + PeripheralLookup.get().registerForBlockEntity((b, d) -> b.peripheral(), ModRegistry.BlockEntities.MONITOR_ADVANCED.get()); + PeripheralLookup.get().registerForBlockEntity( + (b, d) -> Config.enableCommandBlock ? new CommandBlockPeripheral(b) : null, + BlockEntityType.COMMAND_BLOCK + ); + PeripheralLookup.get().registerForBlockEntity(WirelessModemBlockEntity::getPeripheral, ModRegistry.BlockEntities.WIRELESS_MODEM_NORMAL.get()); + PeripheralLookup.get().registerForBlockEntity(WirelessModemBlockEntity::getPeripheral, ModRegistry.BlockEntities.WIRELESS_MODEM_ADVANCED.get()); + PeripheralLookup.get().registerForBlockEntity(WiredModemFullBlockEntity::getPeripheral, ModRegistry.BlockEntities.WIRED_MODEM_FULL.get()); + PeripheralLookup.get().registerForBlockEntity(CableBlockEntity::getPeripheral, ModRegistry.BlockEntities.CABLE.get()); + + WiredElementLookup.get().registerForBlockEntity((b, d) -> b.getElement(), ModRegistry.BlockEntities.WIRED_MODEM_FULL.get()); + WiredElementLookup.get().registerForBlockEntity(CableBlockEntity::getWiredElement, ModRegistry.BlockEntities.CABLE.get()); + + // Register commands + CommandRegistrationCallback.EVENT.register((dispatcher, context, environment) -> CommandComputerCraft.register(dispatcher)); + + // Register hooks + ServerLifecycleEvents.SERVER_STARTING.register(s -> { + server = s; + CommonHooks.onServerStarting(s); + }); + ServerLifecycleEvents.SERVER_STOPPED.register(s -> { + server = s; + CommonHooks.onServerStopped(); + }); + ServerLifecycleEvents.SYNC_DATA_PACK_CONTENTS.register((player, joined) -> PlatformHelper.get().sendToPlayer(new UpgradesLoadedMessage(), player)); + + ServerTickEvents.START_SERVER_TICK.register(CommonHooks::onServerTickStart); + ServerTickEvents.START_SERVER_TICK.register(s -> CommonHooks.onServerTickEnd()); + + PlayerBlockBreakEvents.BEFORE.register(FabricCommonHooks::onBlockDestroy); + UseBlockCallback.EVENT.register(FabricCommonHooks::useOnBlock); + + LootTableEvents.MODIFY.register((resourceManager, lootManager, id, tableBuilder, source) -> { + var pool = CommonHooks.getExtraLootPool(id); + if (pool != null) tableBuilder.withPool(pool); + }); + + CommonHooks.onDatapackReload((name, listener) -> ResourceManagerHelper.get(PackType.SERVER_DATA).registerReloadListener(new ReloadListener(name, listener))); + + // Config loading + ModLoadingContext.registerConfig(ComputerCraftAPI.MOD_ID, ModConfig.Type.SERVER, ConfigSpec.serverSpec); + ModLoadingContext.registerConfig(ComputerCraftAPI.MOD_ID, ModConfig.Type.CLIENT, ConfigSpec.clientSpec); + ModConfigEvents.loading(ComputerCraftAPI.MOD_ID).register(ConfigSpec::sync); + ModConfigEvents.reloading(ComputerCraftAPI.MOD_ID).register(ConfigSpec::sync); + + FabricDetailRegistries.FLUID_VARIANT.addProvider(FluidDetails::fill); + + ComputerCraftAPI.registerGenericSource(new InventoryMethods()); + } + + private record ReloadListener(String name, PreparableReloadListener listener) + implements IdentifiableResourceReloadListener { + + @Override + public ResourceLocation getFabricId() { + return new ResourceLocation(ComputerCraftAPI.MOD_ID, name); + } + + @Override + public CompletableFuture reload(PreparationBarrier preparationBarrier, ResourceManager resourceManager, ProfilerFiller preparationsProfiler, ProfilerFiller reloadProfiler, Executor backgroundExecutor, Executor gameExecutor) { + return listener.reload(preparationBarrier, resourceManager, preparationsProfiler, reloadProfiler, backgroundExecutor, gameExecutor); + } + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/FabricCommonHooks.java b/projects/fabric/src/main/java/dan200/computercraft/shared/FabricCommonHooks.java new file mode 100644 index 000000000..56ef21225 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/FabricCommonHooks.java @@ -0,0 +1,92 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import dan200.computercraft.shared.media.items.DiskItem; +import dan200.computercraft.shared.media.items.TreasureDiskItem; +import dan200.computercraft.shared.peripheral.modem.wired.CableBlock; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.TagParser; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.level.ServerPlayerGameMode; +import net.minecraft.util.GsonHelper; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.BlockHitResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.annotation.Nullable; + +public class FabricCommonHooks { + private static final Gson GSON = new GsonBuilder().create(); + private static final Logger LOGGER = LoggerFactory.getLogger(FabricCommonHooks.class); + + public static boolean onBlockDestroy(Level world, Player player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity) { + if (!(state.getBlock() instanceof CableBlock cable)) return true; + if (cable.onDestroyedByPlayer(state, world, pos, player, state.getFluidState())) { + state.getBlock().destroy(world, pos, state); + } + + return false; + } + + /** + * Allow placing disks/treasure disks into disk drives by clicking on them. + * + * @param player The player placing the block. + * @param level The current level. + * @param hand The player's hand. + * @param hitResult The hit collision. + * @return Whether this interaction succeeded. + * @see ServerPlayerGameMode#useItemOn(ServerPlayer, Level, ItemStack, InteractionHand, BlockHitResult) The original source of this logic. + */ + public static InteractionResult useOnBlock(Player player, Level level, InteractionHand hand, BlockHitResult hitResult) { + if (player.isSpectator()) return InteractionResult.PASS; + + var block = level.getBlockState(hitResult.getBlockPos()); + if (block.getBlock() != ModRegistry.Blocks.DISK_DRIVE.get()) return InteractionResult.PASS; + + if (player.isSecondaryUseActive() && doesSneakBypassUse(player.getMainHandItem()) && doesSneakBypassUse(player.getOffhandItem())) { + var result = block.use(level, player, hand, hitResult); + if (result.consumesAction()) return result; + } + + return InteractionResult.PASS; + } + + private static boolean doesSneakBypassUse(ItemStack stack) { + return stack.isEmpty() || stack.getItem() instanceof DiskItem || stack.getItem() instanceof TreasureDiskItem; + } + + /** + * Add the {@code "nbt"} field to the resulting item stack. + * + * @param stack The stack to add the tag to. + * @param json The result JSON object to parse. + */ + public static void addRecipeResultTag(ItemStack stack, JsonObject json) { + var nbt = json.get("nbt"); + if (nbt == null || stack.hasTag()) return; + + try { + stack.setTag(nbt.isJsonObject() + ? TagParser.parseTag(GSON.toJson(nbt)) + : TagParser.parseTag(GsonHelper.convertToString(nbt, "nbt"))); + } catch (CommandSyntaxException e) { + LOGGER.error("Invalid NBT entry {}, skipping.", nbt); + } + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/details/FluidDetails.java b/projects/fabric/src/main/java/dan200/computercraft/shared/details/FluidDetails.java new file mode 100644 index 000000000..054cb2dd4 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/details/FluidDetails.java @@ -0,0 +1,32 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.details; + +import dan200.computercraft.api.detail.FabricDetailRegistries; +import dan200.computercraft.api.detail.IDetailProvider; +import dan200.computercraft.shared.platform.Registries; +import net.fabricmc.fabric.api.transfer.v1.fluid.FluidVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; + +import java.util.Map; + +/** + * {@link IDetailProvider} support for fluids. + * + * @see FabricDetailRegistries#FLUID_VARIANT + */ +public class FluidDetails { + public static void fillBasic(Map data, StorageView fluid) { + data.put("name", DetailHelpers.getId(Registries.FLUIDS, fluid.getResource().getFluid())); + data.put("amount", fluid.getAmount()); + } + + public static void fill(Map data, StorageView fluid) { + @SuppressWarnings("deprecation") + var holder = fluid.getResource().getFluid().builtInRegistryHolder(); + data.put("tags", DetailHelpers.getTags(holder)); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/GenericPeripheralProvider.java b/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/GenericPeripheralProvider.java new file mode 100644 index 000000000..4d76c5286 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/GenericPeripheralProvider.java @@ -0,0 +1,90 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.peripheral.generic; + +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.core.asm.NamedMethod; +import dan200.computercraft.core.asm.PeripheralMethod; +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.Container; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.state.BlockState; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class GenericPeripheralProvider { + interface Lookup { + @Nullable + T find(Level world, BlockPos pos, @Nullable BlockState state, @Nullable BlockEntity blockEntity, Direction context); + } + + private static final List> lookups = List.of( + (world, pos, state, blockEntity, context) -> { + // Try to avoid using the sided version of InventoryStorage where possible. + if (blockEntity instanceof Container container) return InventoryStorage.of(container, null); + return ItemStorage.SIDED.find(world, pos, state, blockEntity, context); + } + ); + + @Nullable + public static IPeripheral getPeripheral(Level world, BlockPos pos, Direction side, @Nullable BlockEntity blockEntity) { + if (blockEntity == null) return null; + + var saturated = new GenericPeripheralBuilder(); + + var tileMethods = PeripheralMethod.GENERATOR.getMethods(blockEntity.getClass()); + if (!tileMethods.isEmpty()) saturated.addMethods(blockEntity, tileMethods); + + for (var lookup : lookups) { + var contents = lookup.find(world, pos, blockEntity.getBlockState(), blockEntity, side); + if (contents == null) continue; + + var methods = PeripheralMethod.GENERATOR.getMethods(contents.getClass()); + if (!methods.isEmpty()) saturated.addMethods(contents, methods); + } + + return saturated.toPeripheral(blockEntity); + } + + private static class GenericPeripheralBuilder { + private @Nullable String name; + private final Set additionalTypes = new HashSet<>(0); + private final ArrayList methods = new ArrayList<>(0); + + @Nullable + IPeripheral toPeripheral(BlockEntity tile) { + if (methods.isEmpty()) return null; + + methods.trimToSize(); + return new GenericPeripheral(tile, name, additionalTypes, methods); + } + + void addMethods(Object target, List> methods) { + var saturatedMethods = this.methods; + saturatedMethods.ensureCapacity(saturatedMethods.size() + methods.size()); + for (var method : methods) { + saturatedMethods.add(new SaturatedMethod(target, method)); + + // If we have a peripheral type, use it. Always pick the smallest one, so it's consistent (assuming mods + // don't change). + var type = method.getGenericType(); + if (type != null && type.getPrimaryType() != null) { + var name = type.getPrimaryType(); + if (this.name == null || this.name.compareTo(name) > 0) this.name = name; + } + if (type != null) additionalTypes.addAll(type.getAdditionalTypes()); + } + } + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/SidedGenericPeripheral.java b/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/SidedGenericPeripheral.java new file mode 100644 index 000000000..46bd5dc1b --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/SidedGenericPeripheral.java @@ -0,0 +1,26 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.peripheral.generic; + +import net.minecraft.core.Direction; +import net.minecraft.world.level.block.entity.BlockEntity; + +import javax.annotation.Nullable; +import java.util.List; +import java.util.Set; + +public class SidedGenericPeripheral extends GenericPeripheral { + private final Direction direction; + + SidedGenericPeripheral(BlockEntity tile, Direction direction, @Nullable String name, Set additionalTypes, List methods) { + super(tile, name, additionalTypes, methods); + this.direction = direction; + } + + public Direction direction() { + return direction; + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/methods/InventoryMethods.java b/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/methods/InventoryMethods.java new file mode 100644 index 000000000..2c315a06c --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/peripheral/generic/methods/InventoryMethods.java @@ -0,0 +1,168 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.peripheral.generic.methods; + +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.detail.VanillaDetailRegistries; +import dan200.computercraft.api.lua.LuaException; +import dan200.computercraft.api.lua.LuaFunction; +import dan200.computercraft.api.peripheral.GenericPeripheral; +import dan200.computercraft.api.peripheral.IComputerAccess; +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.peripheral.PeripheralType; +import dan200.computercraft.shared.peripheral.generic.SidedGenericPeripheral; +import dan200.computercraft.shared.platform.FabricContainerTransfer; +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.base.SingleSlotStorage; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.Container; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.block.entity.BlockEntity; + +import javax.annotation.Nullable; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +import static dan200.computercraft.shared.util.ArgumentHelpers.assertBetween; + +/** + * Methods for interacting with inventories. This mirrors the Forge version. + */ +@SuppressWarnings("UnstableApiUsage") +public class InventoryMethods implements GenericPeripheral { + @Override + public PeripheralType getType() { + return PeripheralType.ofAdditional("inventory"); + } + + @Override + public ResourceLocation id() { + return new ResourceLocation(ComputerCraftAPI.MOD_ID, "inventory"); + } + + @LuaFunction(mainThread = true) + public static int size(InventoryStorage inventory) { + return inventory.getSlots().size(); + } + + @LuaFunction(mainThread = true) + public static Map> list(InventoryStorage inventory) { + Map> result = new HashMap<>(); + var slots = inventory.getSlots(); + var size = slots.size(); + for (var i = 0; i < size; i++) { + var stack = toStack(slots.get(i)); + if (!stack.isEmpty()) result.put(i + 1, VanillaDetailRegistries.ITEM_STACK.getBasicDetails(stack)); + } + + return result; + } + + @Nullable + @LuaFunction(mainThread = true) + public static Map getItemDetail(InventoryStorage inventory, int slot) throws LuaException { + assertBetween(slot, 1, inventory.getSlots().size(), "Slot out of range (%s)"); + + var stack = toStack(inventory.getSlot(slot - 1)); + return stack.isEmpty() ? null : VanillaDetailRegistries.ITEM_STACK.getDetails(stack); + } + + @LuaFunction(mainThread = true) + public static long getItemLimit(InventoryStorage inventory, int slot) throws LuaException { + assertBetween(slot, 1, inventory.getSlots().size(), "Slot out of range (%s)"); + return inventory.getSlot(slot - 1).getCapacity(); + } + + @LuaFunction(mainThread = true) + public static int pushItems( + InventoryStorage from, IComputerAccess computer, + String toName, int fromSlot, Optional limit, Optional toSlot + ) throws LuaException { + // Find location to transfer to + var location = computer.getAvailablePeripheral(toName); + if (location == null) throw new LuaException("Target '" + toName + "' does not exist"); + + var to = extractHandler(location); + if (to == null) throw new LuaException("Target '" + toName + "' is not an inventory"); + + // Validate slots + int actualLimit = limit.orElse(Integer.MAX_VALUE); + assertBetween(fromSlot, 1, from.getSlots().size(), "From slot out of range (%s)"); + if (toSlot.isPresent()) assertBetween(toSlot.get(), 1, to.getSlots().size(), "To slot out of range (%s)"); + + if (actualLimit <= 0) return 0; + return moveItem(from, fromSlot - 1, to, toSlot.orElse(0) - 1, actualLimit); + } + + @LuaFunction(mainThread = true) + public static int pullItems( + InventoryStorage to, IComputerAccess computer, + String fromName, int fromSlot, Optional limit, Optional toSlot + ) throws LuaException { + // Find location to transfer to + var location = computer.getAvailablePeripheral(fromName); + if (location == null) throw new LuaException("Source '" + fromName + "' does not exist"); + + var from = extractHandler(location); + if (from == null) throw new LuaException("Source '" + fromName + "' is not an inventory"); + + // Validate slots + int actualLimit = limit.orElse(Integer.MAX_VALUE); + assertBetween(fromSlot, 1, from.getSlots().size(), "From slot out of range (%s)"); + if (toSlot.isPresent()) assertBetween(toSlot.get(), 1, to.getSlots().size(), "To slot out of range (%s)"); + + if (actualLimit <= 0) return 0; + return moveItem(from, fromSlot - 1, to, toSlot.orElse(0) - 1, actualLimit); + } + + @Nullable + private static InventoryStorage extractHandler(IPeripheral peripheral) { + var object = peripheral.getTarget(); + var direction = peripheral instanceof SidedGenericPeripheral sided ? sided.direction() : null; + + if (object instanceof BlockEntity blockEntity && blockEntity.isRemoved()) return null; + + if (object instanceof InventoryStorage storage) return storage; + if (object instanceof Container container) return InventoryStorage.of(container, null); + + if (object instanceof BlockEntity blockEntity && direction != null) { + var found = ItemStorage.SIDED.find(blockEntity.getLevel(), blockEntity.getBlockPos(), blockEntity.getBlockState(), blockEntity, direction); + if (found instanceof InventoryStorage storage) return storage; + } + + return null; + } + + /** + * Move an item from one handler to another. + * + * @param from The handler to move from. + * @param fromSlot The slot to move from. + * @param to The handler to move to. + * @param toSlot The slot to move to. Use any number < 0 to represent any slot. + * @param limit The max number to move. {@link Integer#MAX_VALUE} for no limit. + * @return The number of items moved. + */ + private static int moveItem(InventoryStorage from, int fromSlot, InventoryStorage to, int toSlot, final int limit) { + var fromWrapper = FabricContainerTransfer.of(from).singleSlot(fromSlot); + var toWrapper = FabricContainerTransfer.of(to); + + return Math.max(0, fromWrapper.moveTo(toSlot >= 0 ? toWrapper.singleSlot(toSlot) : toWrapper, limit)); + } + + private static ItemStack toStack(SingleSlotStorage variant) { + if (variant.isResourceBlank() || variant.getAmount() <= 0) return ItemStack.EMPTY; + return toStack(variant.getResource(), variant.getAmount()); + } + + private static ItemStack toStack(ItemVariant variant, long amount) { + // I don't care about supporting this much power creep :D + return variant.toStack(amount >= Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) amount); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FabricContainerTransfer.java b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FabricContainerTransfer.java new file mode 100644 index 000000000..37432a0de --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FabricContainerTransfer.java @@ -0,0 +1,161 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.platform; + +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; +import net.fabricmc.fabric.api.transfer.v1.storage.Storage; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil; +import net.fabricmc.fabric.api.transfer.v1.storage.StorageView; +import net.fabricmc.fabric.api.transfer.v1.transaction.TransactionContext; + +import javax.annotation.Nullable; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.function.Predicate; + +@SuppressWarnings("UnstableApiUsage") +public class FabricContainerTransfer implements ContainerTransfer { + private final Storage storage; + + private FabricContainerTransfer(Storage storage) { + this.storage = storage; + } + + public static ContainerTransfer of(Storage storage) { + return storage instanceof InventoryStorage inv ? new SlottedImpl(inv) : new FabricContainerTransfer(storage); + } + + public static ContainerTransfer.Slotted of(InventoryStorage storage) { + return new SlottedImpl(storage); + } + + @Override + public int moveTo(ContainerTransfer destination, int maxAmount) { + var predicate = new GatePredicate(); + + var moved = StorageUtil.move(storage, ((FabricContainerTransfer) destination).storage, predicate, maxAmount, null); + if (moved > 0) return moved > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) moved; + + // Nasty hack here to check if move() actually found an item in the original inventory. Saves having to + // iterate over the source twice. + return predicate.hasItem() ? NO_SPACE : NO_ITEMS; + } + + /** + * A predicate which accepts the first value it sees, and then only those matching that value. + * + * @param The type of the object to accept. + */ + private static class GatePredicate implements Predicate { + private @Nullable T instance = null; + + @Override + public boolean test(T o) { + if (instance == null) { + instance = o; + return true; + } + + return instance.equals(o); + } + + boolean hasItem() { + return instance != null; + } + } + + private static class SlottedImpl extends FabricContainerTransfer implements ContainerTransfer.Slotted { + private final InventoryStorage storage; + + SlottedImpl(InventoryStorage storage) { + super(storage); + this.storage = storage; + } + + @Override + public ContainerTransfer rotate(int offset) { + return offset == 0 ? this : of(new OffsetStorage(storage, offset)); + } + + @Override + public ContainerTransfer singleSlot(int slot) { + return of(storage.getSlot(slot)); + } + } + + private record OffsetStorage(InventoryStorage storage, int offset) implements Storage { + @Override + public boolean supportsInsertion() { + for (var slot : storage.getSlots()) { + if (slot.supportsInsertion()) return true; + } + return false; + } + + @Override + public boolean supportsExtraction() { + for (var slot : storage.getSlots()) { + if (slot.supportsExtraction()) return true; + } + return false; + } + + @Override + public long insert(ItemVariant resource, long maxAmount, TransactionContext transaction) { + var slots = storage.getSlots(); + var size = slots.size(); + + long transferred = 0; + for (var i = 0; i < size; i++) { + transferred += slots.get(wrap(i, size)).insert(resource, maxAmount, transaction); + if (transferred >= maxAmount) break; + } + + return transferred; + } + + @Override + public long extract(ItemVariant resource, long maxAmount, TransactionContext transaction) { + var slots = storage.getSlots(); + var size = slots.size(); + + long transferred = 0; + for (var i = 0; i < size; i++) { + transferred += slots.get(wrap(i, size)).extract(resource, maxAmount, transaction); + if (transferred >= maxAmount) break; + } + + return transferred; + } + + @Override + public Iterator> iterator() { + var slots = storage.getSlots(); + var size = slots.size(); + return new Iterator<>() { + int i = 0; + + @Override + public boolean hasNext() { + return i < size; + } + + @Override + public StorageView next() { + var slot = i++; + if (slot >= size) throw new NoSuchElementException(); + return slots.get(wrap(slot, size)); + } + }; + } + + int wrap(int slot, int size) { + var actualSlot = slot + offset; + return actualSlot >= size ? actualSlot - size : actualSlot; + } + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FakeNetHandler.java b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FakeNetHandler.java new file mode 100644 index 000000000..bfa8b9f78 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FakeNetHandler.java @@ -0,0 +1,247 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.platform; + +import net.minecraft.network.Connection; +import net.minecraft.network.PacketSendListener; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.PlayerChatMessage; +import net.minecraft.network.protocol.Packet; +import net.minecraft.network.protocol.PacketFlow; +import net.minecraft.network.protocol.game.*; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.network.ServerGamePacketListenerImpl; + +import javax.annotation.Nullable; + +class FakeNetHandler extends ServerGamePacketListenerImpl { + protected static final Connection CONNECTION = new Connection(PacketFlow.CLIENTBOUND); + + FakeNetHandler(ServerPlayer player) { + super(player.getLevel().getServer(), CONNECTION, player); + } + + @Override + public void tick() { + } + + @Override + public void resetPosition() { + } + + @Override + public void disconnect(Component textComponent) { + } + + @Override + public void handlePlayerInput(ServerboundPlayerInputPacket packet) { + } + + @Override + public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) { + } + + @Override + public void handleAcceptTeleportPacket(ServerboundAcceptTeleportationPacket packet) { + } + + @Override + public void handleRecipeBookSeenRecipePacket(ServerboundRecipeBookSeenRecipePacket packet) { + } + + @Override + public void handleRecipeBookChangeSettingsPacket(ServerboundRecipeBookChangeSettingsPacket packet) { + } + + @Override + public void handleSeenAdvancements(ServerboundSeenAdvancementsPacket packet) { + } + + @Override + public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { + } + + @Override + public void handleSetCommandBlock(ServerboundSetCommandBlockPacket packet) { + } + + @Override + public void handleSetCommandMinecart(ServerboundSetCommandMinecartPacket packet) { + } + + @Override + public void handlePickItem(ServerboundPickItemPacket packet) { + } + + @Override + public void handleRenameItem(ServerboundRenameItemPacket packet) { + } + + @Override + public void handleSetBeaconPacket(ServerboundSetBeaconPacket packet) { + } + + @Override + public void handleSetStructureBlock(ServerboundSetStructureBlockPacket packet) { + } + + @Override + public void handleSetJigsawBlock(ServerboundSetJigsawBlockPacket packet) { + } + + @Override + public void handleJigsawGenerate(ServerboundJigsawGeneratePacket packet) { + } + + @Override + public void handleSelectTrade(ServerboundSelectTradePacket packet) { + } + + @Override + public void handleEditBook(ServerboundEditBookPacket packet) { + } + + @Override + public void handleEntityTagQuery(ServerboundEntityTagQuery packet) { + } + + @Override + public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) { + } + + @Override + public void handleMovePlayer(ServerboundMovePlayerPacket packet) { + } + + @Override + public void handlePlayerAction(ServerboundPlayerActionPacket packet) { + } + + @Override + public void handleUseItemOn(ServerboundUseItemOnPacket packet) { + } + + @Override + public void handleUseItem(ServerboundUseItemPacket packet) { + } + + @Override + public void handleTeleportToEntityPacket(ServerboundTeleportToEntityPacket packet) { + } + + @Override + public void handleResourcePackResponse(ServerboundResourcePackPacket packet) { + } + + @Override + public void handlePaddleBoat(ServerboundPaddleBoatPacket packet) { + } + + @Override + public void handlePong(ServerboundPongPacket packet) { + } + + @Override + public void onDisconnect(Component reason) { + } + + @Override + public void ackBlockChangesUpTo(int i) { + } + + @Override + public void send(Packet packet, @Nullable PacketSendListener packetSendListener) { + super.send(packet, packetSendListener); + } + + @Override + public void handleSetCarriedItem(ServerboundSetCarriedItemPacket packet) { + } + + @Override + public void handleChat(ServerboundChatPacket packet) { + } + + @Override + public void handleChatCommand(ServerboundChatCommandPacket serverboundChatCommandPacket) { + } + + @Override + public void handleChatPreview(ServerboundChatPreviewPacket serverboundChatPreviewPacket) { + } + + @Override + public void handleChatAck(ServerboundChatAckPacket serverboundChatAckPacket) { + } + + @Override + public void handleAnimate(ServerboundSwingPacket packet) { + } + + @Override + public void handlePlayerCommand(ServerboundPlayerCommandPacket packet) { + } + + @Override + public void addPendingMessage(PlayerChatMessage playerChatMessage) { + } + + @Override + public void handleInteract(ServerboundInteractPacket packet) { + } + + @Override + public void handleClientCommand(ServerboundClientCommandPacket packet) { + } + + @Override + public void handleContainerClose(ServerboundContainerClosePacket packet) { + } + + @Override + public void handleContainerClick(ServerboundContainerClickPacket packet) { + } + + @Override + public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { + } + + @Override + public void handleContainerButtonClick(ServerboundContainerButtonClickPacket packet) { + } + + @Override + public void handleSetCreativeModeSlot(ServerboundSetCreativeModeSlotPacket packet) { + } + + @Override + public void handleSignUpdate(ServerboundSignUpdatePacket packet) { + } + + @Override + public void handleKeepAlive(ServerboundKeepAlivePacket packet) { + } + + @Override + public void handlePlayerAbilities(ServerboundPlayerAbilitiesPacket packet) { + } + + @Override + public void handleClientInformation(ServerboundClientInformationPacket packet) { + } + + @Override + public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { + } + + @Override + public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { + } + + @Override + public void handleLockDifficulty(ServerboundLockDifficultyPacket packet) { + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FakePlayer.java b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FakePlayer.java new file mode 100644 index 000000000..7a4dd120f --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/FakePlayer.java @@ -0,0 +1,80 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.platform; + +import com.mojang.authlib.GameProfile; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.stats.Stat; +import net.minecraft.world.MenuProvider; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.EntityDimensions; +import net.minecraft.world.entity.Pose; +import net.minecraft.world.entity.player.Player; + +import javax.annotation.Nullable; +import java.util.OptionalInt; + +final class FakePlayer extends ServerPlayer { + private FakePlayer(ServerLevel serverLevel, GameProfile gameProfile) { + super(serverLevel.getServer(), serverLevel, gameProfile, null); + connection = new FakeNetHandler(this); + } + + static FakePlayer create(ServerLevel serverLevel, GameProfile profile) { + // Restore the previous player's advancements. See #564. + var playerList = serverLevel.getServer().getPlayerList(); + var currentPlayer = playerList.getPlayer(profile.getId()); + + var fakePlayer = new FakePlayer(serverLevel, profile); + if (currentPlayer != null) fakePlayer.getAdvancements().setPlayer(currentPlayer); + + return fakePlayer; + } + + @Override + public void tick() { + } + + @Override + public void doTick() { + super.doTick(); + } + + @Override + public void awardStat(Stat stat, int increment) { + } + + @Override + public boolean isInvulnerableTo(DamageSource source) { + return true; + } + + @Override + public boolean canHarmPlayer(Player other) { + return true; + } + + @Override + public void die(DamageSource damageSource) { + } + + @Override + public OptionalInt openMenu(@Nullable MenuProvider menu) { + return OptionalInt.empty(); + } + + @Override + public boolean startRiding(Entity vehicle, boolean force) { + return false; + } + + @Override + public float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) { + return 0; + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/MoreConventionalTags.java b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/MoreConventionalTags.java new file mode 100644 index 000000000..e71a978b0 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/MoreConventionalTags.java @@ -0,0 +1,26 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.platform; + +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; +import net.minecraft.core.Registry; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; + +/** + * Extension to {@link ConventionalItemTags}. + *

+ * Try to keep these consistent with the wiki page. + */ +public class MoreConventionalTags { + public static final TagKey SKULLS = item("skulls"); + public static final TagKey WOODEN_CHESTS = item("wooden_chests"); + + private static TagKey item(String name) { + return TagKey.create(Registry.ITEM_REGISTRY, new ResourceLocation("c", name)); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/NetworkHandler.java b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/NetworkHandler.java new file mode 100644 index 000000000..99bee8694 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/NetworkHandler.java @@ -0,0 +1,95 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.platform; + +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.shared.network.NetworkMessage; +import dan200.computercraft.shared.network.NetworkMessages; +import dan200.computercraft.shared.network.client.ClientNetworkContext; +import dan200.computercraft.shared.network.server.ServerNetworkContext; +import io.netty.buffer.Unpooled; +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; +import it.unimi.dsi.fastutil.objects.Object2IntMap; +import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.protocol.game.ClientboundCustomPayloadPacket; +import net.minecraft.network.protocol.game.ServerboundCustomPayloadPacket; +import net.minecraft.resources.ResourceLocation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.annotation.Nullable; +import java.util.function.Function; + +public final class NetworkHandler { + private static final Logger LOGGER = LoggerFactory.getLogger(NetworkHandler.class); + + public static final ResourceLocation ID = new ResourceLocation(ComputerCraftAPI.MOD_ID, "main"); + + private static final Int2ObjectMap>> clientPackets = new Int2ObjectOpenHashMap<>(); + private static final Int2ObjectMap>> serverPackets = new Int2ObjectOpenHashMap<>(); + private static final Object2IntMap>> packetIds = new Object2IntOpenHashMap<>(); + + public static void init() { + ServerPlayNetworking.registerGlobalReceiver(ID, (server, player, handler, buf, responseSender) -> { + var packet = decodeServer(buf); + if (packet != null) server.execute(() -> packet.handle(handler::getPlayer)); + }); + + NetworkMessages.register(new NetworkMessages.PacketRegistry() { + @Override + public > void registerClientbound(int id, Class type, Function decoder) { + clientPackets.put(id, decoder); + packetIds.put(type, id); + } + + @Override + public > void registerServerbound(int id, Class type, Function decoder) { + serverPackets.put(id, decoder); + packetIds.put(type, id); + } + }); + } + + private static FriendlyByteBuf encode(NetworkMessage message) { + var buf = new FriendlyByteBuf(Unpooled.buffer()); + buf.writeByte(packetIds.getInt(message.getClass())); + message.toBytes(buf); + return buf; + } + + public static ClientboundCustomPayloadPacket encodeClient(NetworkMessage message) { + return new ClientboundCustomPayloadPacket(ID, encode(message)); + } + + public static ServerboundCustomPayloadPacket encodeServer(NetworkMessage message) { + return new ServerboundCustomPayloadPacket(ID, encode(message)); + } + + @Nullable + private static NetworkMessage decode(Int2ObjectMap>> packets, FriendlyByteBuf buffer) { + int type = buffer.readByte(); + var reader = packets.get(type); + if (reader == null) { + LOGGER.debug("Unknown packet {}", type); + return null; + } + + return reader.apply(buffer); + } + + @Nullable + public static NetworkMessage decodeServer(FriendlyByteBuf buffer) { + return decode(serverPackets, buffer); + } + + @Nullable + public static NetworkMessage decodeClient(FriendlyByteBuf buffer) { + return decode(clientPackets, buffer); + } +} diff --git a/projects/fabric/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java new file mode 100644 index 000000000..a7f2fdeb4 --- /dev/null +++ b/projects/fabric/src/main/java/dan200/computercraft/shared/platform/PlatformHelperImpl.java @@ -0,0 +1,473 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.platform; + +import com.google.auto.service.AutoService; +import com.mojang.authlib.GameProfile; +import com.mojang.brigadier.arguments.ArgumentType; +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.api.network.wired.IWiredElement; +import dan200.computercraft.api.node.wired.WiredElementLookup; +import dan200.computercraft.api.peripheral.IPeripheral; +import dan200.computercraft.api.peripheral.PeripheralLookup; +import dan200.computercraft.mixin.ArgumentTypeInfosAccessor; +import dan200.computercraft.mixin.CreativeModeTabAccessor; +import dan200.computercraft.shared.ModRegistry; +import dan200.computercraft.shared.network.NetworkMessage; +import dan200.computercraft.shared.network.client.ClientNetworkContext; +import dan200.computercraft.shared.network.container.ContainerData; +import dan200.computercraft.shared.peripheral.generic.GenericPeripheralProvider; +import dan200.computercraft.shared.util.InventoryUtil; +import net.fabricmc.fabric.api.event.player.AttackEntityCallback; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.fabricmc.fabric.api.event.player.UseEntityCallback; +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiCache; +import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup; +import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; +import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; +import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType; +import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.fabricmc.fabric.api.transfer.v1.item.ItemStorage; +import net.minecraft.commands.synchronization.ArgumentTypeInfo; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.core.Registry; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerChunkCache; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.tags.TagKey; +import net.minecraft.world.Container; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.MenuProvider; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.*; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.chunk.LevelChunk; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.EntityHitResult; +import net.minecraft.world.phys.Vec3; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.*; +import java.util.function.BiFunction; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; + +@AutoService(dan200.computercraft.impl.PlatformHelper.class) +public class PlatformHelperImpl implements PlatformHelper { + private static final CreativeModeTab creativeTab; + + static { + // Fabric's API for this forces us to use "computercraft.xyz", so roll our own. + CreativeModeTabAccessor.computercraft$setTabs(Arrays.copyOf(CreativeModeTab.TABS, CreativeModeTab.TABS.length + 1)); + creativeTab = new CreativeModeTab(CreativeModeTab.TABS.length - 1, ComputerCraftAPI.MOD_ID) { + @Override + public ItemStack makeIcon() { + return new ItemStack(ModRegistry.Items.COMPUTER_NORMAL.get()); + } + }; + } + + @Override + public CreativeModeTab getCreativeTab() { + return creativeTab; + } + + @SuppressWarnings("unchecked") + private static Registry getRegistry(ResourceKey> id) { + var registry = (Registry) Registry.REGISTRY.get(id.location()); + if (registry == null) throw new IllegalArgumentException("Unknown registry " + id); + return registry; + } + + @Override + public ResourceLocation getRegistryKey(ResourceKey> registry, T object) { + var key = getRegistry(registry).getKey(object); + if (key == null) throw new IllegalArgumentException(object + " was not registered in " + registry); + return key; + } + + @Override + public T getRegistryObject(ResourceKey> registry, ResourceLocation id) { + var value = getRegistry(registry).get(id); + if (value == null) throw new IllegalArgumentException(id + " was not registered in " + registry); + return value; + } + + @Override + public Registries.RegistryWrapper wrap(ResourceKey> registry) { + return new RegistryWrapperImpl<>(registry.location(), getRegistry(registry)); + } + + @Override + public RegistrationHelper createRegistrationHelper(ResourceKey> registry) { + return new RegistrationHelperImpl<>(getRegistry(registry)); + } + + @Nullable + @Override + public T tryGetRegistryObject(ResourceKey> registry, ResourceLocation id) { + return getRegistry(registry).get(id); + } + + @Override + public BlockEntityType createBlockEntityType(BiFunction factory, Block block) { + return FabricBlockEntityTypeBuilder.create(factory::apply).addBlock(block).build(); + } + + @Override + public , T extends ArgumentTypeInfo.Template, I extends ArgumentTypeInfo> I registerArgumentTypeInfo(Class klass, I info) { + ArgumentTypeInfosAccessor.classMap().put(klass, info); + return info; + } + + @Override + public MenuType createMenuType(Function reader, ContainerData.Factory factory) { + return new ExtendedScreenHandlerType<>((id, player, data) -> factory.create(id, player, reader.apply(data))); + } + + @Override + public void openMenu(Player player, MenuProvider owner, ContainerData menu) { + player.openMenu(new WrappedMenuProvider(owner, menu)); + } + + @Override + public void sendToPlayer(NetworkMessage message, ServerPlayer player) { + player.connection.send(NetworkHandler.encodeClient(message)); + } + + @Override + public void sendToPlayers(NetworkMessage message, Collection players) { + if (players.isEmpty()) return; + var packet = NetworkHandler.encodeClient(message); + for (var player : players) player.connection.send(packet); + } + + @Override + public void sendToAllPlayers(NetworkMessage message, MinecraftServer server) { + server.getPlayerList().broadcastAll(NetworkHandler.encodeClient(message)); + } + + @Override + public void sendToAllAround(NetworkMessage message, ServerLevel level, Vec3 pos, float distance) { + level.getServer().getPlayerList().broadcast(null, pos.x, pos.y, pos.z, distance, level.dimension(), NetworkHandler.encodeClient(message)); + } + + @Override + public void sendToAllTracking(NetworkMessage message, LevelChunk chunk) { + var packet = NetworkHandler.encodeClient(message); + for (var player : ((ServerChunkCache) chunk.getLevel().getChunkSource()).chunkMap.getPlayers(chunk.getPos(), false)) { + player.connection.send(packet); + } + } + + @Override + public ComponentAccess createPeripheralAccess(Consumer invalidate) { + return new PeripheralAccessImpl(); + } + + @Override + public ComponentAccess createWiredElementAccess(Consumer invalidate) { + return new ComponentAccessImpl<>(WiredElementLookup.get()); + } + + @Override + public boolean hasWiredElementIn(Level level, BlockPos pos, Direction direction) { + return WiredElementLookup.get().find(level, pos.relative(direction), direction.getOpposite()) != null; + } + + @Override + public ContainerTransfer.Slotted wrapContainer(Container container) { + return FabricContainerTransfer.of(InventoryStorage.of(container, null)); + } + + @Override + @SuppressWarnings("UnstableApiUsage") + public @Nullable ContainerTransfer getContainer(ServerLevel level, BlockPos pos, Direction side) { + var storage = ItemStorage.SIDED.find(level, pos, side); + if (storage != null) return FabricContainerTransfer.of(storage); + + var entity = InventoryUtil.getEntityContainer(level, pos, side); + return entity == null ? null : FabricContainerTransfer.of(InventoryStorage.of(entity, side)); + } + + @Override + public RecipeIngredients getRecipeIngredients() { + return new RecipeIngredients( + Ingredient.of(ConventionalItemTags.REDSTONE_DUSTS), + Ingredient.of(Items.STRING), + Ingredient.of(Items.LEATHER), + Ingredient.of(Items.STONE), + Ingredient.of(ConventionalItemTags.GLASS_PANES), + Ingredient.of(ConventionalItemTags.GOLD_INGOTS), + Ingredient.of(Items.GOLD_BLOCK), + Ingredient.of(ConventionalItemTags.IRON_INGOTS), + Ingredient.of(MoreConventionalTags.SKULLS), + Ingredient.of(ConventionalItemTags.DYES), + Ingredient.of(Items.ENDER_PEARL), + Ingredient.of(MoreConventionalTags.WOODEN_CHESTS) + ); + } + + @Override + public List> getDyeTags() { + return List.of( + ConventionalItemTags.WHITE_DYES, + ConventionalItemTags.ORANGE_DYES, + ConventionalItemTags.MAGENTA_DYES, + ConventionalItemTags.LIGHT_BLUE_DYES, + ConventionalItemTags.YELLOW_DYES, + ConventionalItemTags.LIME_DYES, + ConventionalItemTags.PINK_DYES, + ConventionalItemTags.GRAY_DYES, + ConventionalItemTags.LIGHT_GRAY_DYES, + ConventionalItemTags.CYAN_DYES, + ConventionalItemTags.PURPLE_DYES, + ConventionalItemTags.BLUE_DYES, + ConventionalItemTags.BROWN_DYES, + ConventionalItemTags.GREEN_DYES, + ConventionalItemTags.RED_DYES, + ConventionalItemTags.BLACK_DYES + ); + } + + @Override + public int getBurnTime(ItemStack stack) { + return AbstractFurnaceBlockEntity.getFuel().getOrDefault(stack.getItem(), 0); + } + + @Override + public List getCreativeTabs(ItemStack stack) { + var category = stack.getItem().getItemCategory(); + return category == null ? List.of() : List.of(category); + } + + @Override + public ItemStack getCraftingRemainingItem(ItemStack stack) { + return new ItemStack(stack.getItem().getCraftingRemainingItem()); + } + + @Override + public List getRecipeRemainingItems(ServerPlayer player, Recipe recipe, CraftingContainer container) { + return recipe.getRemainingItems(container); + } + + @Override + public void onItemCrafted(ServerPlayer player, CraftingContainer container, ItemStack stack) { + } + + @Override + public boolean onNotifyNeighbour(Level level, BlockPos pos, BlockState block, Direction direction) { + return true; + } + + @Override + public ServerPlayer createFakePlayer(ServerLevel world, GameProfile name) { + return FakePlayer.create(world, name); + } + + @Override + public boolean hasToolUsage(ItemStack stack) { + var item = stack.getItem(); + return item instanceof ShovelItem || stack.is(ConventionalItemTags.SHOVELS) || + item instanceof HoeItem || stack.is(ConventionalItemTags.HOES); + } + + @Override + public InteractionResult canAttackEntity(ServerPlayer player, Entity entity) { + return AttackEntityCallback.EVENT.invoker().interact(player, player.level, InteractionHand.MAIN_HAND, entity, null); + } + + @Override + public boolean interactWithEntity(ServerPlayer player, Entity entity, Vec3 hitPos) { + return UseEntityCallback.EVENT.invoker().interact(player, entity.level, InteractionHand.MAIN_HAND, entity, new EntityHitResult(entity, hitPos)).consumesAction() || + entity.interactAt(player, hitPos.subtract(entity.position()), InteractionHand.MAIN_HAND).consumesAction() || + player.interactOn(entity, InteractionHand.MAIN_HAND).consumesAction(); + } + + @Override + public InteractionResult useOn(ServerPlayer player, ItemStack stack, BlockHitResult hit) { + var result = UseBlockCallback.EVENT.invoker().interact(player, player.level, InteractionHand.MAIN_HAND, hit); + if (result != InteractionResult.PASS) return result; + + return stack.useOn(new UseOnContext(player, InteractionHand.MAIN_HAND, hit)); + } + + private record RegistryWrapperImpl( + ResourceLocation name, Registry registry + ) implements Registries.RegistryWrapper { + @Override + public int getId(T object) { + var id = registry.getId(object); + if (id == -1) throw new IllegalArgumentException(object + " was not registered in " + name); + return id; + } + + @Override + public ResourceLocation getKey(T object) { + var key = registry.getKey(object); + if (key == null) throw new IllegalArgumentException(object + " was not registered in " + name); + return key; + } + + @Override + public T get(ResourceLocation location) { + var object = registry.get(location); + if (object == null) throw new IllegalArgumentException(location + " was not registered in " + name); + return object; + } + + @Nullable + @Override + public T tryGet(ResourceLocation location) { + return registry.get(location); + } + + @Override + public T get(int id) { + var object = registry.byId(id); + if (object == null) throw new IllegalArgumentException(id + " was not registered in " + name); + return object; + } + + @Nonnull + @Override + public Iterator iterator() { + return registry.iterator(); + } + } + + private static final class RegistrationHelperImpl implements RegistrationHelper { + private final Registry registry; + private final List> entries = new ArrayList<>(); + + private RegistrationHelperImpl(Registry registry) { + this.registry = registry; + } + + @Override + public RegistryEntry register(String name, Supplier create) { + var entry = new RegistryEntryImpl<>(new ResourceLocation(ComputerCraftAPI.MOD_ID, name), create); + entries.add(entry); + return entry; + } + + @Override + public void register() { + for (var entry : entries) entry.register(registry); + } + } + + private static final class RegistryEntryImpl implements RegistryEntry { + private final ResourceLocation id; + private final Supplier supplier; + private @Nullable T instance; + + RegistryEntryImpl(ResourceLocation id, Supplier supplier) { + this.id = id; + this.supplier = supplier; + } + + void register(Registry registry) { + Registry.register(registry, id, instance = supplier.get()); + } + + @Override + public ResourceLocation id() { + return id; + } + + @Override + public T get() { + if (instance == null) throw new IllegalStateException(id + " has not been constructed yet"); + return instance; + } + } + + private record WrappedMenuProvider(MenuProvider owner, ContainerData menu) implements ExtendedScreenHandlerFactory { + @Nullable + @Override + public AbstractContainerMenu createMenu(int id, Inventory inventory, Player player) { + return owner.createMenu(id, inventory, player); + } + + @Override + public Component getDisplayName() { + return owner.getDisplayName(); + } + + @Override + public void writeScreenOpeningData(ServerPlayer player, FriendlyByteBuf buf) { + menu.toBytes(buf); + } + } + + private static class ComponentAccessImpl implements ComponentAccess { + private final BlockApiLookup lookup; + @SuppressWarnings({ "unchecked", "rawtypes" }) + final BlockApiCache[] caches = new BlockApiCache[6]; + private @Nullable Level level; + private @Nullable BlockPos pos; + + private ComponentAccessImpl(BlockApiLookup lookup) { + this.lookup = lookup; + } + + @Nullable + @Override + public T get(ServerLevel level, BlockPos pos, Direction direction) { + if (this.level != null && this.level != level) throw new IllegalStateException("Level has changed"); + if (this.pos != null && this.pos != pos) throw new IllegalStateException("Position has changed"); + + this.level = level; + this.pos = pos; + var cache = caches[direction.ordinal()]; + if (cache == null) { + cache = caches[direction.ordinal()] = BlockApiCache.create(lookup, level, pos.relative(direction)); + } + + return cache.find(direction.getOpposite()); + } + } + + private static final class PeripheralAccessImpl extends ComponentAccessImpl { + private PeripheralAccessImpl() { + super(PeripheralLookup.get()); + } + + @Nullable + @Override + public IPeripheral get(ServerLevel level, BlockPos pos, Direction direction) { + var result = super.get(level, pos, direction); + if (result != null) return result; + + var cache = caches[direction.ordinal()]; + return GenericPeripheralProvider.getPeripheral(level, cache.getPos(), direction.getOpposite(), cache.getBlockEntity()); + } + } +} diff --git a/projects/fabric/src/main/resources/computercraft.fabric.mixins.json b/projects/fabric/src/main/resources/computercraft.fabric.mixins.json new file mode 100644 index 000000000..186ada5fe --- /dev/null +++ b/projects/fabric/src/main/resources/computercraft.fabric.mixins.json @@ -0,0 +1,20 @@ +{ + "required": true, + "package": "dan200.computercraft.mixin", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_17", + "injectors": { + "defaultRequire": 1 + }, + "mixins": [ + "ArgumentTypeInfosAccessor", + "ChunkMapMixin", + "EntityMixin", + "ExplosionDamageCalculatorMixin", + "ItemEntityMixin", + "ServerLevelMixin", + "ShapedRecipeMixin", + "TagEntryAccessor", + "TagsProviderMixin" + ] +} diff --git a/projects/fabric/src/main/resources/fabric.mod.json b/projects/fabric/src/main/resources/fabric.mod.json new file mode 100644 index 000000000..5c6aef0cb --- /dev/null +++ b/projects/fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,54 @@ +{ + "schemaVersion": 1, + "id": "computercraft", + "name": "CC: Tweaked", + "version": "${version}", + "description": "CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles and more to Minecraft.", + "license": "ComputerCraft Public License (https://raw.githubusercontent.com/dan200/ComputerCraft/master/LICENSE)", + "icon": "assets/computercraft/pack.png", + "contact": { + "homepage": "https://tweaked.cc/", + "issues": "https://github.com/cc-tweaked/cc-tweaked/issues" + }, + "authors": [ + "Daniel Ratcliffe", + "Aaron Mills", + "SquidDev" + ], + "environment": "*", + "entrypoints": { + "main": [ + "dan200.computercraft.shared.ComputerCraft::init" + ], + "client": [ + "dan200.computercraft.client.ComputerCraftClient::init" + ], + "fabric-datagen": [ + "dan200.computercraft.data.FabricDataGenerators" + ], + "jei_mod_plugin": [ + "dan200.computercraft.shared.integration.jei.JEIComputerCraft" + ], + "rei_client": [ + "dan200.computercraft.client.integration.rei.REIComputerCraft" + ] + }, + "mixins": [ + "computercraft.mixins.json", + "computercraft.fabric.mixins.json", + { + "config": "computercraft-client.mixins.json", + "environment": "client" + }, + { + "config": "computercraft-client.fabric.mixins.json", + "environment": "client" + } + ], + "depends": { + "fabricloader": ">=0.14.10", + "fabric-api": ">=0.66.0", + "minecraft": ">=1.19.2 <1.20" + }, + "accessWidener": "computercraft.accesswidener" +} diff --git a/projects/fabric/src/test/java/dan200/computercraft/shared/FabricBootstrap.java b/projects/fabric/src/test/java/dan200/computercraft/shared/FabricBootstrap.java new file mode 100644 index 000000000..ee2f5b605 --- /dev/null +++ b/projects/fabric/src/test/java/dan200/computercraft/shared/FabricBootstrap.java @@ -0,0 +1,204 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared; + +import com.google.auto.service.AutoService; +import com.google.common.base.Splitter; +import com.google.common.io.ByteStreams; +import net.bytebuddy.agent.ByteBuddyAgent; +import net.fabricmc.api.EnvType; +import net.fabricmc.loader.impl.FabricLoaderImpl; +import net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider; +import net.fabricmc.loader.impl.game.minecraft.Slf4jLogHandler; +import net.fabricmc.loader.impl.launch.FabricLauncherBase; +import net.fabricmc.loader.impl.launch.FabricMixinBootstrap; +import net.fabricmc.loader.impl.launch.knot.MixinServiceKnot; +import net.fabricmc.loader.impl.transformer.FabricTransformer; +import net.fabricmc.loader.impl.util.LoaderUtil; +import net.fabricmc.loader.impl.util.log.Log; +import org.junit.jupiter.api.extension.Extension; +import org.spongepowered.asm.mixin.transformer.IMixinTransformer; + +import javax.annotation.Nullable; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.IllegalClassFormatException; +import java.lang.instrument.Instrumentation; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.security.ProtectionDomain; +import java.util.*; +import java.util.jar.Manifest; + +/** + * Loads Fabric mods as part of this test run. + *

+ * This sets up a minimalistic {@link FabricLauncherBase}, uses that to load mods, and then acquires an + * {@link Instrumentation} instance, registering a {@link ClassFileTransformer} to apply mixins and access wideners. + * + * @see net.fabricmc.loader.impl.launch.knot.Knot + */ +@AutoService(Extension.class) +public class FabricBootstrap implements Extension { + public FabricBootstrap() throws ReflectiveOperationException, IOException { + Log.init(new Slf4jLogHandler()); + + readProperties(); + { + var method = FabricLauncherBase.class.getDeclaredMethod("setProperties", Map.class); + method.setAccessible(true); + method.invoke(null, new HashMap<>()); + } + + var provider = new MinecraftGameProvider(); + if (!provider.locateGame(new BasicLauncher(), new String[0])) { + throw new IllegalStateException("Cannot setup game"); + } + + var loader = FabricLoaderImpl.INSTANCE; + loader.setGameProvider(provider); + loader.load(); + loader.freeze(); + loader.loadAccessWideners(); + + FabricMixinBootstrap.init(EnvType.CLIENT, loader); + { + var method = FabricLauncherBase.class.getDeclaredMethod("finishMixinBootstrapping"); + method.setAccessible(true); + method.invoke(null); + } + + IMixinTransformer transformer; + { + var method = MixinServiceKnot.class.getDeclaredMethod("getTransformer"); + method.setAccessible(true); + transformer = (IMixinTransformer) method.invoke(null); + } + + ByteBuddyAgent.install().addTransformer(new ClassTransformer(transformer)); + } + + private static void readProperties() throws IOException { + try (var reader = Files.newBufferedReader(Path.of(".gradle/loom-cache/launch.cfg"))) { + var interesting = false; + + String line; + while ((line = reader.readLine()) != null) { + if (line.startsWith(" ") || line.startsWith("\t")) { + if (!interesting) continue; + + line = line.strip(); + var index = line.indexOf('='); + + if (index >= 0) { + System.setProperty(line.substring(0, index), line.substring(index + 1)); + } else { + System.setProperty(line, ""); + } + } else { + interesting = line.equals("commonProperties") || line.equals("clientProperties"); + } + } + } + } + + private static final class BasicLauncher extends FabricLauncherBase { + private final List classpath = new ArrayList<>(); + + BasicLauncher() { + for (var entry : Splitter.on(File.pathSeparatorChar).split(System.getProperty("java.class.path"))) { + var path = Paths.get(entry); + if (Files.exists(path)) classpath.add(LoaderUtil.normalizeExistingPath(path)); + } + } + + @Override + public void addToClassPath(Path path, String... allowedPrefixes) { + classpath.add(path); + } + + @Override + public void setAllowedPrefixes(Path path, String... prefixes) { + } + + @Override + public void setValidParentClassPath(Collection paths) { + throw new UnsupportedOperationException("setValidParentClassPath"); + } + + @Override + public EnvType getEnvironmentType() { + return EnvType.CLIENT; + } + + @Override + public boolean isClassLoaded(String name) { + return false; + } + + @Override + public Class loadIntoTarget(String name) { + throw new UnsupportedOperationException("loadIntoTarget"); + } + + @Override + public ClassLoader getTargetClassLoader() { + return Thread.currentThread().getContextClassLoader(); + } + + @Override + public @Nullable InputStream getResourceAsStream(String name) { + return BasicLauncher.class.getClassLoader().getResourceAsStream(name); + } + + @Override + public @Nullable byte[] getClassByteArray(String name, boolean runTransformers) throws IOException { + try (var stream = BasicLauncher.class.getClassLoader().getResourceAsStream(LoaderUtil.getClassFileName(name))) { + if (stream == null) return null; + return ByteStreams.toByteArray(stream); + } + } + + @Override + public Manifest getManifest(Path originPath) { + throw new UnsupportedOperationException("getManifest"); + } + + @Override + public boolean isDevelopment() { + return true; + } + + @Override + public String getEntrypoint() { + throw new UnsupportedOperationException("getEntrypoint"); + } + + @Override + public String getTargetNamespace() { + return "named"; + } + + @Override + public List getClassPath() { + return classpath; + } + } + + private record ClassTransformer(IMixinTransformer transformer) implements ClassFileTransformer { + @Override + public @Nullable byte[] transform(ClassLoader loader, String className, Class classBeingRedefined, ProtectionDomain protectionDomain, byte[] bytes) throws IllegalClassFormatException { + var name = className.replace('/', '.'); + var transformed = FabricTransformer.transform(true, EnvType.CLIENT, name, bytes); + transformed = transformer.transformClassBytes(name, name, transformed); + + return transformed == bytes ? null : transformed; + } + } +} diff --git a/projects/fabric/src/test/java/dan200/computercraft/shared/platform/FabricContainerTransferTest.java b/projects/fabric/src/test/java/dan200/computercraft/shared/platform/FabricContainerTransferTest.java new file mode 100644 index 000000000..0ed289a40 --- /dev/null +++ b/projects/fabric/src/test/java/dan200/computercraft/shared/platform/FabricContainerTransferTest.java @@ -0,0 +1,20 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.shared.platform; + +import dan200.computercraft.test.shared.WithMinecraft; +import dan200.computercraft.test.shared.platform.ContainerTransferContract; +import net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage; +import net.minecraft.world.Container; + +@WithMinecraft +public class FabricContainerTransferTest implements ContainerTransferContract { + @Override + @SuppressWarnings("UnstableApiUsage") + public ContainerTransfer.Slotted wrap(Container container) { + return FabricContainerTransfer.of(InventoryStorage.of(container, null)); + } +} diff --git a/projects/fabric/src/test/resources/junit-platform.properties b/projects/fabric/src/test/resources/junit-platform.properties new file mode 100644 index 000000000..6efc0d5e8 --- /dev/null +++ b/projects/fabric/src/test/resources/junit-platform.properties @@ -0,0 +1 @@ +junit.jupiter.extensions.autodetection.enabled=true diff --git a/projects/fabric/src/testMod/java/dan200/computercraft/gametest/core/TestMod.java b/projects/fabric/src/testMod/java/dan200/computercraft/gametest/core/TestMod.java new file mode 100644 index 000000000..c0f3b6d7c --- /dev/null +++ b/projects/fabric/src/testMod/java/dan200/computercraft/gametest/core/TestMod.java @@ -0,0 +1,34 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.gametest.core; + +import dan200.computercraft.api.ComputerCraftAPI; +import dan200.computercraft.export.Exporter; +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; +import net.fabricmc.fabric.api.event.Event; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; +import net.minecraft.resources.ResourceLocation; + +public class TestMod implements ModInitializer, ClientModInitializer { + @Override + public void onInitialize() { + TestHooks.init(); + + var phase = new ResourceLocation(ComputerCraftAPI.MOD_ID, "test_mod"); + ServerLifecycleEvents.SERVER_STARTED.addPhaseOrdering(Event.DEFAULT_PHASE, phase); + ServerLifecycleEvents.SERVER_STARTED.register(phase, TestHooks::onServerStarted); + + CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> CCTestCommand.register(dispatcher)); + } + + @Override + public void onInitializeClient() { + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> Exporter.register(dispatcher)); + } +} diff --git a/projects/fabric/src/testMod/java/dan200/computercraft/mixin/gametest/StructureUtilsMixin.java b/projects/fabric/src/testMod/java/dan200/computercraft/mixin/gametest/StructureUtilsMixin.java new file mode 100644 index 000000000..ba6a4ffb6 --- /dev/null +++ b/projects/fabric/src/testMod/java/dan200/computercraft/mixin/gametest/StructureUtilsMixin.java @@ -0,0 +1,59 @@ +/* + * This file is part of ComputerCraft - http://www.computercraft.info + * Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission. + * Send enquiries to dratcliffe@gmail.com + */ +package dan200.computercraft.mixin.gametest; + +import net.minecraft.gametest.framework.StructureUtils; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * Undo Fabric's mixin which ignores {@link StructureUtils#testStructuresDir}. + */ +@Mixin(value = StructureUtils.class, priority = 0) +public class StructureUtilsMixin { + // TODO: Replace with https://github.com/FabricMC/fabric/pull/2555 if merged. + + @Inject(method = "getStructureTemplate", at = @At("HEAD"), cancellable = true) + @SuppressWarnings("UnusedMethod") + private static void getStructureTemplate(String structureName, ServerLevel serverLevel, CallbackInfoReturnable result) { + result.setReturnValue(getStructureTemplateImpl(structureName, serverLevel)); + } + + @Unique + private static StructureTemplate getStructureTemplateImpl(String structureName, ServerLevel serverLevel) { + var structureTemplateManager = serverLevel.getStructureManager(); + + var structureId = new ResourceLocation(structureName); + var resourceStructure = structureTemplateManager.get(structureId); + if (resourceStructure.isPresent()) { + return resourceStructure.get(); + } else { + var path = Paths.get(StructureUtils.testStructuresDir, structureId.getPath() + ".snbt"); + var structureInfo = tryLoadStructure(path); + if (structureInfo == null) { + throw new RuntimeException("Could not find structure file " + path + ", and the structure is not available in the world structures either."); + } + + return structureTemplateManager.readStructure(structureInfo); + } + } + + @Shadow + private static CompoundTag tryLoadStructure(Path pathToStructure) { + throw new IllegalArgumentException("Uncallable"); + } +} diff --git a/projects/fabric/src/testMod/resources/computercraft-gametest.fabric.mixins.json b/projects/fabric/src/testMod/resources/computercraft-gametest.fabric.mixins.json new file mode 100644 index 000000000..ef3c72384 --- /dev/null +++ b/projects/fabric/src/testMod/resources/computercraft-gametest.fabric.mixins.json @@ -0,0 +1,12 @@ +{ + "required": true, + "package": "dan200.computercraft.mixin.gametest", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_17", + "injectors": { + "defaultRequire": 1 + }, + "mixins": [ + "StructureUtilsMixin" + ] +} diff --git a/projects/fabric/src/testMod/resources/fabric.mod.json b/projects/fabric/src/testMod/resources/fabric.mod.json new file mode 100644 index 000000000..d5ed77a50 --- /dev/null +++ b/projects/fabric/src/testMod/resources/fabric.mod.json @@ -0,0 +1,31 @@ +{ + "schemaVersion": 1, + "id": "cctest", + "version": "1.0.0", + "entrypoints": { + "main": [ + "dan200.computercraft.gametest.core.TestMod" + ], + "client": [ + "dan200.computercraft.gametest.core.TestMod" + ], + "fabric-gametest": [ + "dan200.computercraft.gametest.Computer_Test", + "dan200.computercraft.gametest.CraftOs_Test", + "dan200.computercraft.gametest.Disk_Drive_Test", + "dan200.computercraft.gametest.Loot_Test", + "dan200.computercraft.gametest.Modem_Test", + "dan200.computercraft.gametest.Monitor_Test", + "dan200.computercraft.gametest.Printer_Test", + "dan200.computercraft.gametest.Recipe_Test", + "dan200.computercraft.gametest.Turtle_Test" + ] + }, + "mixins": [ + "computercraft-gametest.mixins.json", + "computercraft-gametest.fabric.mixins.json" + ], + "depends": { + "computercraft": "*" + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index be342fdcb..439e0d31c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,9 +1,41 @@ pluginManagement { + // Duplicated in buildSrc/build.gradle.kts repositories { + mavenCentral() gradlePluginPortal() - maven("https://maven.minecraftforge.net") - maven("https://maven.parchmentmc.org") + + maven("https://maven.minecraftforge.net") { + name = "Forge" + content { + includeGroup("net.minecraftforge") + includeGroup("net.minecraftforge.gradle") + } + } + + maven("https://maven.parchmentmc.org") { + name = "Librarian" + content { + includeGroupByRegex("^org\\.parchmentmc.*") + } + } + + maven("https://repo.spongepowered.org/repository/maven-public/") { + name = "Sponge" + content { + includeGroup("org.spongepowered") + includeGroup("org.spongepowered.gradle.vanilla") + } + } + + maven("https://maven.fabricmc.net/") { + name = "Fabric" + content { + includeGroup("fabric-loom") + includeGroup("net.fabricmc") + } + } } + resolutionStrategy { eachPlugin { if (requested.id.id == "org.spongepowered.mixin") { @@ -23,6 +55,8 @@ include(":mc-stubs") include(":forge-stubs") include(":common-api") include(":common") +include(":fabric-api") +include(":fabric") include(":forge-api") include(":forge")