1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-01 22:22:59 +00:00

Compare commits

..

24 Commits

Author SHA1 Message Date
Jonathan Coates
9fbcbae5b3 Bump version to 1.98.2 2021-08-22 17:39:32 +01:00
Jonathan Coates
36a779dc18 Use data generators in a few more places
As always, a massive diff which is largely just moving files between
projects. This does fix a couple of issues with advancements, but
otherwise should behave the same.

Speaking of which, should probably go and test some of these recipes...
2021-08-21 15:50:01 +01:00
Jonathan Coates
cd8b8bbc74 Bump codecov action version
This'll be deprecated next year. We've plenty of time, but worth fixing
while I'm looking at this stuff.
2021-08-20 22:33:09 +01:00
Jonathan Coates
d8319bb35c Fix coverage not being generated for in-game tests 2021-08-20 22:13:21 +01:00
Jonathan Coates
afd6adbffa npm update
The worst ecosystem
2021-08-20 21:54:44 +01:00
Jonathan Coates
d3a5d1e314 Add tests for transmitting via wired modems
It crashes on 1.17 right now, so worth checking!
2021-08-20 18:35:00 +01:00
Jonathan Coates
56010382fb Rethink how computers run tests in game
Instead of using ids for each computer each computer is spawned with id
0 but has a label which matches up to its test name. This has several
advantages:

 - No more confusing IDs: the test code now just does thenComputerOk()
   and that's it - the computer to track is inferred from the test name.
 - All files are stored on one computer, which means we can write code
   which is shared between tests.
2021-08-20 17:05:27 +01:00
Jonathan Coates
0ff6b0ca70 Client-side tests
This spins up a Minecraft instance (much like we do for the server) and
instructs the client to take screenshots at particular times. We then
compare those screenshots and assert they match (modulo some small
delta).
2021-08-20 17:05:13 +01:00
Jonathan Coates
4b33306940 Refactor the test code to be closer to 1.17
Basically mimic the actual API that Minecraft would expose if the
methods hadn't been stripped. Lots of ATs and unsafe hacks to get this
working, but thankfully the API we can expose to the user is pretty
nice. Yay for Kotlin?

Anyway, will cause some immediate pain (yay merge conflicts) but should
make keeping the two in sync much easier.
2021-08-20 17:05:13 +01:00
Jonathan Coates
4dea3dff36 Move some Forge hooks into a separate class 2021-08-20 17:05:13 +01:00
Jonathan Coates
3e8c741170 Update test mod "generated" tags 2021-08-18 13:03:53 +01:00
Jonathan Coates
62baa72457 Add some tests for wired modems 2021-08-18 12:55:58 +01:00
Jonathan Coates
5eb711da87 Relocate test mod to testMod source set
This'll be fun to rebase 1.17 on to :).
2021-08-18 12:55:58 +01:00
Jonathan Coates
79c5df1d92 Fix weblate exporting the wrong language
Ughghgr.
2021-08-18 12:53:19 +01:00
Jonathan Coates
991ea6e829 Switch mappings over to Parchment
These are still equivalent to the official mappings but also include
method names and javadoc. Yay!

A bit weird to be on versioned mappings after 8 months of MojMap :).!
2021-08-18 12:49:50 +01:00
Weblate
1d160641a4 Translations for Japanese
Co-authored-by: MORIMORI0317 <morimori.0317@outlook.jp>
2021-08-18 10:53:58 +00:00
Weblate
c2b3d914f7 Added translation for Japanese
Co-authored-by: MORIMORI0317 <morimori.0317@outlook.jp>
2021-08-18 10:22:58 +00:00
Jonathan Coates
143b2bdbcd 🦀 ComputerCraft is dead 🦀 2021-08-15 22:25:31 +01:00
Jonathan Coates
8cb21ed4d1 Woops
I had this as assume-unchanged for some reason
2021-08-13 22:45:42 +01:00
Jonathan Coates
8aa7695fdd Some doc updates
- Fix some spacing in code blocks
 - Rewrite the index page
 - You can't see it, but update illuaminate.
2021-08-13 22:35:08 +01:00
Jonathan Coates
fa78818069 Several fixes to speaker volume
- Use linear attenuation.
 - Fix speakers being 16 times as loud as they should be. They correctly
   cut off at the right distance, but didn't fade out as one might
   expect.
 - Clamp volume at 0, not 1. Fixes #892
2021-08-12 18:19:53 +01:00
Jonathan Coates
62172c6049 Fix depending on a client-only class
I checked matrix but not transformationmatrix >_>.
2021-08-08 12:38:06 +01:00
Jonathan Coates
39f3cf8cbe Cache the tool's transformation matrix 2021-08-08 12:28:25 +01:00
Jonathan Coates
5082947331 Add 1.17 to the issue template 2021-08-08 12:23:02 +01:00
234 changed files with 5570 additions and 1698 deletions

2
.gitattributes vendored
View File

@@ -1,6 +1,6 @@
# Ignore changes in generated files
src/generated/resources/data/** linguist-generated
src/test/server-files/structures linguist-generated
src/testMod/server-files/structures linguist-generated
* text=auto

View File

@@ -10,6 +10,7 @@ body:
options:
- 1.15.x
- 1.16.x
- 1.17.x
validations:
required: true
- type: input

View File

@@ -32,7 +32,7 @@ jobs:
run: |
./gradlew assemble || ./gradlew assemble
./gradlew downloadAssets || ./gradlew downloadAssets
./gradlew build
xvfb-run ./gradlew build
- name: Upload Jar
uses: actions/upload-artifact@v2
@@ -40,8 +40,17 @@ jobs:
name: CC-Tweaked
path: build/libs
- name: Upload Screnshots
uses: actions/upload-artifact@v2
with:
name: Screenshots
path: test-files/client/screenshots
if-no-files-found: ignore
retention-days: 5
if: failure()
- name: Upload Coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
- name: Parse test reports
run: ./tools/parse-reports.py

View File

@@ -90,10 +90,11 @@ Before we get into writing tests, it's worth mentioning the various test suites
These tests are run by the '"Core" Java' test suite, and so are also run with `./gradlew test`.
- In-game (`./src/test/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.
- In-game (`./src/testMod/java/dan200/computercraft/ingame/`): These tests are run on an actual Minecraft server and client,
using [the same system Mojang do][mc-test]. The aim of these is to test in-game behaviour of blocks and peripherals.
These are run by `./gradlew testInGame`.
These are run by `./gradlew testClient` and `./gradlew testServer`. You may want to run the client under `xvfb-run`
or similar when running in a headless environment.
## CraftOS tests
CraftOS's tests are written using a test system called "mcfly", heavily inspired by [busted] (and thus RSpec). Groups of

View File

@@ -1,40 +1,11 @@
# ![CC: Tweaked](doc/logo.png)
[![Current build status](https://github.com/SquidDev-CC/CC-Tweaked/workflows/Build/badge.svg)](https://github.com/SquidDev-CC/CC-Tweaked/actions "Current build status") [![Download CC: Tweaked on CurseForge](http://cf.way2muchnoise.eu/title/cc-tweaked.svg)](https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked on CurseForge")
[![Current build status](https://github.com/SquidDev-CC/CC-Tweaked/workflows/Build/badge.svg)](https://github.com/SquidDev-CC/CC-Tweaked/actions "Current build status") [![Download CC: Tweaked on CurseForge](http://cf.way2muchnoise.eu/title/cc-tweaked.svg)][CurseForge]
CC: Tweaked is a fork of [ComputerCraft](https://github.com/dan200/ComputerCraft), adding programmable computers,
turtles and more to Minecraft.
CC: Tweaked is a mod for Minecraft which adds programmable computers, turtles and more to the game. A fork of the
much-beloved [ComputerCraft], it continues its legacy with better performance, stability, and a wealth of new features.
## What?
ComputerCraft has always held a fond place in my heart: it's the mod which really got me into Minecraft, and it's the
mod which has kept me playing it for many years. However, development of the original mod has slowed, as the original
developers have had less time to work on the mod, and moved onto other projects and commitments.
CC: Tweaked (or CC:T for short) is an attempt to continue ComputerCraft's legacy. It's not intended to be a competitor
to CC, nor do I want to take it in a vastly different direction to the original mod. Instead, CC:T focuses on making the
ComputerCraft experience as _solid_ as possible, ironing out any wrinkles that may have developed over time.
## Features
CC: Tweaked contains all the features of the latest version of ComputerCraft, as well as numerous fixes, performance
improvements and several nifty additions. I'd recommend checking out [the releases page](https://github.com/SquidDev-CC/CC-Tweaked/releases)
to see the full set of changes, but here's a couple of the more interesting additions:
- Improvements to the `http` library, including websockets, support for other HTTP methods (`PUT`, `DELETE`, etc...)
and configurable limits on HTTP usage.
- Full-block wired modems, allowing one to wrap non-solid peripherals (such as turtles, or chests if Plethora is
installed).
- Pocket computers can be held like maps, allowing you to view the screen without entering a GUI.
- Printed pages and books can be placed in item frames and held like maps.
- Several profiling and administration tools for server owners, via the `/computercraft` command. This allows operators
to track which computers are hogging resources, turn on and shutdown multiple computers at once and interact with
computers remotely.
- Closer emulation of standard Lua, adding the `debug` and `io` libraries. This also enables seeking within binary
files, meaning you don't need to read large files into memory.
- Allow running multiple computers on multiple threads, reducing latency on worlds with many computers.
## Relation to CCTweaks?
This mod has nothing to do with CCTweaks, though there is no denying the name is a throwback to it. That being said,
several features have been included, such as full block modems, the Cobalt runtime and map-like rendering for pocket
computers.
CC: Tweaked can be installed from [CurseForge] or [Modrinth]. It requires the [Minecraft Forge][forge] mod loader, but
[versions are available for Fabric][ccrestitched].
## Contributing
Any contribution is welcome, be that using the mod, reporting bugs or contributing code. If you want to get started
@@ -46,8 +17,7 @@ ComputerCraft we have a [forum](https://forums.computercraft.cc/) and [Discord g
There's also a fairly populated, albeit quiet [IRC channel](http://webchat.esper.net/?channels=computercraft), if that's
more your cup of tea.
I'd generally recommend you don't contact me directly (email, DM, etc...) unless absolutely necessary (i.e. in order to
report exploits). You'll get a far quicker response if you ask the whole community!
We also host fairly comprehensive documentation at [tweaked.cc](https://tweaked.cc/ "The CC: Tweaked website").
## Using
CC: Tweaked is hosted on my maven repo, and so is relatively simple to depend on. You may wish to add a soft (or hard)
@@ -70,3 +40,9 @@ exposing more features.
We bundle the API sources with the jar, so documentation should be easily viewable within your editor. Alternatively,
the generated documentation [can be browsed online](https://tweaked.cc/javadoc/).
[computercraft]: https://github.com/dan200/ComputerCraft "ComputerCraft on GitHub"
[curseforge]: https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked from CurseForge"
[modrinth]: https://modrinth.com/mod/gu7yAYhd "Download CC: Tweaked from Modrinth"
[forge]: https://files.minecraftforge.net/ "Download Minecraft Forge."
[ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge"

View File

@@ -1,13 +1,12 @@
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://maven.minecraftforge.net"
}
maven { url = "https://maven.minecraftforge.net" }
maven { url = 'https://maven.parchmentmc.org' }
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:5.0.24'
classpath 'net.minecraftforge.gradle:ForgeGradle:5.1.+'
classpath 'org.parchmentmc:librarian:1.+'
}
}
@@ -23,6 +22,7 @@ plugins {
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
version = mod_version
@@ -45,10 +45,17 @@ tasks.withType(JavaExec).configureEach {
}
}
sourceSets {
main.resources {
srcDir 'src/generated/resources'
}
testMod {}
}
minecraft {
runs {
client {
workingDirectory project.file('run')
all {
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
@@ -59,28 +66,27 @@ minecraft {
}
}
client {
workingDirectory project.file('run')
}
server {
workingDirectory project.file("run/server")
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
arg "--nogui"
mods {
computercraft {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
args '--mod', 'computercraft', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
}
testClient {
workingDirectory project.file('test-files/client')
parent runs.client
mods {
computercraft {
source sourceSets.main
cctest {
source sourceSets.testMod
}
}
}
@@ -88,26 +94,19 @@ minecraft {
testServer {
workingDirectory project.file('test-files/server')
parent runs.server
arg "--nogui"
mods {
cctest {
source sourceSets.test
source sourceSets.testMod
}
}
}
}
mappings channel: 'official', version: mc_version
mappings channel: 'parchment', version: "${mapping_version}-${mc_version}"
accessTransformer file('src/main/resources/META-INF/accesstransformer.cfg')
accessTransformer file('src/test/resources/META-INF/accesstransformer.cfg')
}
sourceSets {
main.resources {
srcDir 'src/generated/resources'
}
accessTransformer file('src/testMod/resources/META-INF/accesstransformer.cfg')
}
repositories {
@@ -120,8 +119,11 @@ repositories {
configurations {
shade
compile.extendsFrom shade
implementation.extendsFrom shade
cctJavadoc
testModImplementation.extendsFrom(implementation)
testModImplementation.extendsFrom(testImplementation)
}
dependencies {
@@ -145,11 +147,17 @@ dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-reflect:1.3.72'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
testModImplementation sourceSets.main.output
cctJavadoc 'cc.tweaked:cct-javadoc:1.4.1'
}
// Compile tasks
compileTestModJava {
dependsOn(compileJava)
}
javadoc {
include "dan200/computercraft/api/**/*.java"
}
@@ -185,7 +193,7 @@ jar {
from configurations.shade.collect { it.isDirectory() ? it : zipTree(it) }
}
[compileJava, compileTestJava].forEach {
[compileJava, compileTestJava, compileTestModJava].forEach {
it.configure {
options.compilerArgs << "-Xlint" << "-Xlint:-processing"
}
@@ -280,7 +288,9 @@ task illuaminateDocs(type: Exec, dependsOn: [minifyWeb, luaJavadoc]) {
}
task docWebsite(type: Copy, dependsOn: [illuaminateDocs]) {
from 'doc/logo.png'
from 'doc'
include 'logo.png'
include 'images/**'
into "${project.docsDir}/lua"
}
@@ -318,7 +328,7 @@ license {
}
}
[licenseTest, licenseFormatTest].forEach {
[licenseTest, licenseFormatTest, licenseTestMod, licenseFormatTestMod].forEach {
it.configure {
include("**/*.java")
header file('config/license/main.txt')
@@ -346,57 +356,60 @@ task setupServer(type: Copy) {
group "test server"
description "Sets up the environment for the test server."
from("src/test/server-files") {
from("src/testMod/server-files") {
include "eula.txt"
include "server.properties"
}
into "test-files/server"
}
tasks.register('testInGame', JavaExec.class).configure {
it.group('test server')
it.description("Runs tests on a temporary Minecraft server.")
it.dependsOn(setupServer, 'prepareRunTestServer', 'cleanTestInGame')
["Client", "Server"].forEach { name ->
tasks.register("test$name", JavaExec.class).configure {
it.group('In-game tests')
it.description("Runs tests on a temporary Minecraft instance.")
it.dependsOn(setupServer, "prepareRunTest$name", "cleanTest$name", 'compileTestModJava')
// Copy from runTestServer. We do it in this slightly odd way as runTestServer
// isn't created until the task is configured (which is no good for us).
JavaExec exec = tasks.getByName('runTestServer')
exec.copyTo(it)
it.setClasspath(exec.getClasspath())
it.mainClass = exec.mainClass
it.setArgs(exec.getArgs())
// Copy from runTestServer. We do it in this slightly odd way as runTestServer
// isn't created until the task is configured (which is no good for us).
JavaExec exec = tasks.getByName("runTest$name")
exec.copyTo(it)
it.setClasspath(exec.getClasspath())
it.mainClass = exec.mainClass
it.setArgs(exec.getArgs())
it.systemProperty('forge.logging.console.level', 'info')
it.systemProperty('cctest.run', 'true')
it.systemProperty('forge.logging.console.level', 'info')
it.systemProperty('cctest.run', 'true')
// Jacoco and modlauncher don't play well together as the classes loaded in-game don't
// match up with those written to disk. We get Jacoco to dump all classes to disk, and
// use that when generating the report.
def coverageOut = new File(buildDir, 'jacocoClassDump/testInGame')
jacoco.applyTo(it)
it.jacoco.setIncludes(["dan200.computercraft.*"])
it.jacoco.setClassDumpDir(coverageOut)
it.outputs.dir(coverageOut)
// Older versions of modlauncher don't include a protection domain (and thus no code
// source). Jacoco skips such classes by default, so we need to explicitly include them.
it.jacoco.setIncludeNoLocationClasses(true)
}
tasks.register('jacocoTestInGameReport', JacocoReport.class).configure {
it.group('test server')
it.description('Generate coverage reports for in-game tests (testInGame)')
it.dependsOn('testInGame')
it.executionData(new File(buildDir, 'jacoco/testInGame.exec'))
it.sourceDirectories.from(sourceSets.main.allJava.srcDirs)
it.classDirectories.from(new File(buildDir, 'jacocoClassDump/testInGame'))
it.reports {
xml.enabled true
html.enabled true
// Jacoco and modlauncher don't play well together as the classes loaded in-game don't
// match up with those written to disk. We get Jacoco to dump all classes to disk, and
// use that when generating the report.
def coverageOut = new File(buildDir, "jacocoClassDump/test$name")
jacoco.applyTo(it)
it.jacoco.setIncludes(["dan200.computercraft.*"])
it.jacoco.setClassDumpDir(coverageOut)
it.outputs.dir(coverageOut)
// Older versions of modlauncher don't include a protection domain (and thus no code
// source). Jacoco skips such classes by default, so we need to explicitly include them.
it.jacoco.setIncludeNoLocationClasses(true)
}
tasks.register("jacocoTest${name}Report", JacocoReport.class).configure {
it.group('In-game')
it.description("Generate coverage reports for test$name")
it.dependsOn("test$name")
it.executionData(new File(buildDir, "jacoco/test${name}.exec"))
it.sourceDirectories.from(sourceSets.main.allJava.srcDirs)
it.classDirectories.from(new File(buildDir, "jacocoClassDump/test$name"))
it.reports {
xml.enabled true
html.enabled true
}
}
check.dependsOn("jacocoTest${name}Report")
}
check.dependsOn('jacocoTestInGameReport')
// Upload tasks
@@ -448,10 +461,6 @@ curseforge {
releaseType = 'release'
changelog = "Release notes can be found on the GitHub repository (https://github.com/SquidDev-CC/CC-Tweaked/releases/tag/v${mc_version}-${mod_version})."
relations {
incompatible "computercraft"
}
addGameVersion "${mc_version}"
}
}

View File

@@ -50,6 +50,6 @@ exclude: |
(?x)^(
src/generated|
src/test/resources/test-rom/data/json-parsing/|
src/test/server-files/|
src/testMod/server-files/|
config/idea/
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
doc/images/peripherals.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

BIN
doc/images/turtle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

View File

@@ -1,11 +1,55 @@
# ![CC: Tweaked](logo.png) [![Download CC: Tweaked on CurseForge](https://cf.way2muchnoise.eu/title/cc-tweaked.svg)](https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked on CurseForge")
# ![CC: Tweaked](logo.png)
CC: Tweaked is a mod for Minecraft which adds programmable computers, turtles and more to the game. A fork of the
much-beloved [ComputerCraft], it continues its legacy with better performance, stability, and a wealth of new features.
CC: Tweaked is a fork of [ComputerCraft], adding programmable computers, turtles and more to Minecraft.
CC: Tweaked can be installed from [CurseForge] or [Modrinth]. It requires the [Minecraft Forge][forge] mod loader, but
[versions are available for Fabric][ccrestitched].
This website contains documentation for all Lua libraries and APIs from the latest version of CC: Tweaked. This
documentation is still in development, so will most likely be incomplete. If you've found something you think is wrong,
or would like to help out [please get in touch on GitHub][gh].
## Features
Controlled using the [Lua programming language][lua], CC: Tweaked's computers provides all the tools you need to start
writing code and automating your Minecraft world.
![A ComputerCraft terminal open and ready to be programmed.](images/basic-terminal.png){.big-image}
While computers are incredibly powerful, they're rather limited by their inability to move about. *Turtles* are the
solution here. They can move about the world, placing and breaking blocks, swinging a sword to protect you from zombies,
or whatever else you program them to!
![A turtle tunneling in Minecraft.](images/turtle.png){.big-image}
Not all problems can be solved with a pickaxe though, and so CC: Tweaked also provides a bunch of additional peripherals
for your computers. You can play a tune with speakers, display text or images on a monitor, connect all your
computers together with modems, and much more.
Computers can now also interact with inventories such as chests, allowing you to build complex inventory and item
management systems.
![A chest's contents being read by a computer and displayed on a monitor.](images/peripherals.png){.big-image}
## Getting Started
While ComputerCraft is lovely for both experienced programmers and for people who have never coded before, it can be a
little daunting getting started. Thankfully, there's several fantastic tutorials out there:
- [Direwolf20's ComputerCraft tutorials](https://www.youtube.com/watch?v=wrUHUhfCY5A "ComputerCraft Tutorial Episode 1 - HELP! and Hello World")
- [Sethbling's ComputerCraft series](https://www.youtube.com/watch?v=DSsx4VSe-Uk "Programming Tutorial with Minecraft Turtles -- Ep. 1: Intro to Turtles and If-Then-Else_End")
- [Lyqyd's Computer Basics 1](http://www.computercraft.info/forums2/index.php?/topic/15033-computer-basics-i/ "Computer Basics I")
Once you're a little more familiar with the mod, the sidebar and links below provide more detailed documentation on the
various APIs and peripherals provided by the mod.
If you get stuck, do pop in to the [Minecraft Computer Mod Discord guild][discord] or ComputerCraft's
[IRC channel][irc].
## Get Involved
CC: Tweaked lives on [GitHub]. If you've got any ideas, feedback or bugs please do [create an issue][bug].
[github]: https://github.com/SquidDev-CC/CC-Tweaked/ "CC: Tweaked on GitHub"
[bug]: https://github.com/SquidDev-CC/CC-Tweaked/issues/new/choose
[computercraft]: https://github.com/dan200/ComputerCraft "ComputerCraft on GitHub"
[gh]: https://github.com/SquidDev-CC/CC-Tweaked "CC:Tweaked on GitHub"
[curseforge]: https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked from CurseForge"
[modrinth]: https://modrinth.com/mod/gu7yAYhd "Download CC: Tweaked from Modrinth"
[forge]: https://files.minecraftforge.net/ "Download Minecraft Forge."
[ccrestitched]: https://www.curseforge.com/minecraft/mc-mods/cc-restitched "Download CC: Restitched from CurseForge"
[lua]: https://www.lua.org/ "Lua's main website"
[discord]: https://discord.computercraft.cc "The Minecraft Computer Mods Discord"
[irc]: http://webchat.esper.net/?channels=computercraft "IRC webchat on EsperNet"

View File

@@ -1,7 +1,8 @@
# Mod properties
mod_version=1.98.1
mod_version=1.98.2
# Minecraft properties (update mods.toml when changing)
mc_version=1.16.5
mapping_version=2021.08.08
forge_version=36.1.0
# NO SERIOUSLY, UPDATE mods.toml WHEN CHANGING

176
package-lock.json generated
View File

@@ -13,7 +13,7 @@
"tslib": "^2.0.3"
},
"devDependencies": {
"@rollup/plugin-typescript": "^6.1.0",
"@rollup/plugin-typescript": "^8.2.5",
"requirejs": "^2.3.6",
"rollup": "^2.33.1",
"terser": "^5.3.8",
@@ -21,9 +21,9 @@
}
},
"node_modules/@rollup/plugin-typescript": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-6.1.0.tgz",
"integrity": "sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ==",
"version": "8.2.5",
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.5.tgz",
"integrity": "sha512-QL/LvDol/PAGB2O0S7/+q2HpSUNodpw7z6nGn9BfoVCPOZ0r4EALrojFU29Bkoi2Hr2jgTocTejJ5GGWZfOxbQ==",
"dev": true,
"dependencies": {
"@rollup/pluginutils": "^3.1.0",
@@ -31,6 +31,11 @@
},
"engines": {
"node": ">=8.0.0"
},
"peerDependencies": {
"rollup": "^2.14.0",
"tslib": "*",
"typescript": ">=3.7.0"
}
},
"node_modules/@rollup/pluginutils": {
@@ -45,6 +50,9 @@
},
"engines": {
"node": ">= 8.0.0"
},
"peerDependencies": {
"rollup": "^1.20.0||^2.0.0"
}
},
"node_modules/@types/estree": {
@@ -54,9 +62,9 @@
"dev": true
},
"node_modules/buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true
},
"node_modules/commander": {
@@ -72,10 +80,11 @@
"dev": true
},
"node_modules/fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"hasInstallScript": true,
"optional": true,
"os": [
"darwin"
@@ -103,33 +112,43 @@
}
},
"node_modules/is-core-module": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz",
"integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==",
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz",
"integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==",
"dev": true,
"dependencies": {
"has": "^1.0.3"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"node_modules/picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true,
"engines": {
"node": ">=8.6"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/preact": {
"version": "10.5.5",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.5.5.tgz",
"integrity": "sha512-5ONLNH1SXMzzbQoExZX4TELemNt+TEDb622xXFNfZngjjM9qtrzseJt+EfiUu4TZ6EJ95X5sE1ES4yqHFSIdhg=="
"version": "10.5.14",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.5.14.tgz",
"integrity": "sha512-KojoltCrshZ099ksUZ2OQKfbH66uquFoxHSbnwKbTJHeQNvx42EmC7wQVWNuDt6vC5s3nudRHFtKbpY4ijKlaQ==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/preact"
}
},
"node_modules/requirejs": {
"version": "2.3.6",
@@ -145,19 +164,22 @@
}
},
"node_modules/resolve": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz",
"integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==",
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"dev": true,
"dependencies": {
"is-core-module": "^2.0.0",
"is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/rollup": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.33.1.tgz",
"integrity": "sha512-uY4O/IoL9oNW8MMcbA5hcOaz6tZTMIh7qJHx/tzIJm+n1wLoY38BLn6fuy7DhR57oNFLMbDQtDeJoFURt5933w==",
"version": "2.56.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.2.tgz",
"integrity": "sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
@@ -166,7 +188,7 @@
"node": ">=10.0.0"
},
"optionalDependencies": {
"fsevents": "~2.1.2"
"fsevents": "~2.3.2"
}
},
"node_modules/source-map": {
@@ -198,9 +220,9 @@
}
},
"node_modules/terser": {
"version": "5.3.8",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz",
"integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==",
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
"integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
"dev": true,
"dependencies": {
"commander": "^2.20.0",
@@ -215,14 +237,14 @@
}
},
"node_modules/tslib": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"node_modules/typescript": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==",
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -235,9 +257,9 @@
},
"dependencies": {
"@rollup/plugin-typescript": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-6.1.0.tgz",
"integrity": "sha512-hJxaiE6WyNOsK+fZpbFh9CUijZYqPQuAOWO5khaGTUkM8DYNNyA2TDlgamecE+qLOG1G1+CwbWMAx3rbqpp6xQ==",
"version": "8.2.5",
"resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-8.2.5.tgz",
"integrity": "sha512-QL/LvDol/PAGB2O0S7/+q2HpSUNodpw7z6nGn9BfoVCPOZ0r4EALrojFU29Bkoi2Hr2jgTocTejJ5GGWZfOxbQ==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.1.0",
@@ -262,9 +284,9 @@
"dev": true
},
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
"dev": true
},
"commander": {
@@ -280,9 +302,9 @@
"dev": true
},
"fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"optional": true
},
@@ -302,30 +324,30 @@
}
},
"is-core-module": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.1.0.tgz",
"integrity": "sha512-YcV7BgVMRFRua2FqQzKtTDMz8iCuLEyGKjr70q8Zm1yy2qKcurbFEd79PAdHV77oL3NrAaOVQIbMmiHQCHB7ZA==",
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz",
"integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==",
"dev": true,
"requires": {
"has": "^1.0.3"
}
},
"path-parse": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true
},
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz",
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true
},
"preact": {
"version": "10.5.5",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.5.5.tgz",
"integrity": "sha512-5ONLNH1SXMzzbQoExZX4TELemNt+TEDb622xXFNfZngjjM9qtrzseJt+EfiUu4TZ6EJ95X5sE1ES4yqHFSIdhg=="
"version": "10.5.14",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.5.14.tgz",
"integrity": "sha512-KojoltCrshZ099ksUZ2OQKfbH66uquFoxHSbnwKbTJHeQNvx42EmC7wQVWNuDt6vC5s3nudRHFtKbpY4ijKlaQ=="
},
"requirejs": {
"version": "2.3.6",
@@ -334,22 +356,22 @@
"dev": true
},
"resolve": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz",
"integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==",
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"dev": true,
"requires": {
"is-core-module": "^2.0.0",
"is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
}
},
"rollup": {
"version": "2.33.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.33.1.tgz",
"integrity": "sha512-uY4O/IoL9oNW8MMcbA5hcOaz6tZTMIh7qJHx/tzIJm+n1wLoY38BLn6fuy7DhR57oNFLMbDQtDeJoFURt5933w==",
"version": "2.56.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.2.tgz",
"integrity": "sha512-s8H00ZsRi29M2/lGdm1u8DJpJ9ML8SUOpVVBd33XNeEeL3NVaTiUcSBHzBdF3eAyR0l7VSpsuoVUGrRHq7aPwQ==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
"fsevents": "~2.3.2"
}
},
"source-map": {
@@ -377,9 +399,9 @@
}
},
"terser": {
"version": "5.3.8",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz",
"integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==",
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
"integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
"dev": true,
"requires": {
"commander": "^2.20.0",
@@ -388,14 +410,14 @@
}
},
"tslib": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
},
"typescript": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==",
"version": "4.3.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
"integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
"dev": true
}
}

View File

@@ -9,7 +9,7 @@
"tslib": "^2.0.3"
},
"devDependencies": {
"@rollup/plugin-typescript": "^6.1.0",
"@rollup/plugin-typescript": "^8.2.5",
"requirejs": "^2.3.6",
"rollup": "^2.33.1",
"terser": "^5.3.8",

View File

@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "computercraft:block/speaker"
},
"facing=south": {
"model": "computercraft:block/speaker",
"y": 180
},
"facing=west": {
"model": "computercraft:block/speaker",
"y": 270
},
"facing=east": {
"model": "computercraft:block/speaker",
"y": 90
}
}
}

View File

@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "computercraft:block/turtle_advanced"
},
"facing=south": {
"model": "computercraft:block/turtle_advanced",
"y": 180
},
"facing=west": {
"model": "computercraft:block/turtle_advanced",
"y": 270
},
"facing=east": {
"model": "computercraft:block/turtle_advanced",
"y": 90
}
}
}

View File

@@ -0,0 +1,19 @@
{
"variants": {
"facing=north": {
"model": "computercraft:block/turtle_normal"
},
"facing=south": {
"model": "computercraft:block/turtle_normal",
"y": 180
},
"facing=west": {
"model": "computercraft:block/turtle_normal",
"y": 270
},
"facing=east": {
"model": "computercraft:block/turtle_normal",
"y": 90
}
}
}

View File

@@ -0,0 +1,16 @@
{
"variants": {
"modem=false,peripheral=false": {
"model": "computercraft:block/wired_modem_full_off"
},
"modem=true,peripheral=false": {
"model": "computercraft:block/wired_modem_full_on"
},
"modem=false,peripheral=true": {
"model": "computercraft:block/wired_modem_full_off_peripheral"
},
"modem=true,peripheral=true": {
"model": "computercraft:block/wired_modem_full_on_peripheral"
}
}
}

View File

@@ -0,0 +1,54 @@
{
"variants": {
"facing=down,on=false": {
"model": "computercraft:block/wireless_modem_advanced_off",
"x": 90,
"y": 90
},
"facing=up,on=false": {
"model": "computercraft:block/wireless_modem_advanced_off",
"x": 270,
"y": 90
},
"facing=north,on=false": {
"model": "computercraft:block/wireless_modem_advanced_off"
},
"facing=south,on=false": {
"model": "computercraft:block/wireless_modem_advanced_off",
"y": 180
},
"facing=west,on=false": {
"model": "computercraft:block/wireless_modem_advanced_off",
"y": 270
},
"facing=east,on=false": {
"model": "computercraft:block/wireless_modem_advanced_off",
"y": 90
},
"facing=down,on=true": {
"model": "computercraft:block/wireless_modem_advanced_on",
"x": 90,
"y": 90
},
"facing=up,on=true": {
"model": "computercraft:block/wireless_modem_advanced_on",
"x": 270,
"y": 90
},
"facing=north,on=true": {
"model": "computercraft:block/wireless_modem_advanced_on"
},
"facing=south,on=true": {
"model": "computercraft:block/wireless_modem_advanced_on",
"y": 180
},
"facing=west,on=true": {
"model": "computercraft:block/wireless_modem_advanced_on",
"y": 270
},
"facing=east,on=true": {
"model": "computercraft:block/wireless_modem_advanced_on",
"y": 90
}
}
}

View File

@@ -0,0 +1,54 @@
{
"variants": {
"facing=down,on=false": {
"model": "computercraft:block/wireless_modem_normal_off",
"x": 90,
"y": 90
},
"facing=up,on=false": {
"model": "computercraft:block/wireless_modem_normal_off",
"x": 270,
"y": 90
},
"facing=north,on=false": {
"model": "computercraft:block/wireless_modem_normal_off"
},
"facing=south,on=false": {
"model": "computercraft:block/wireless_modem_normal_off",
"y": 180
},
"facing=west,on=false": {
"model": "computercraft:block/wireless_modem_normal_off",
"y": 270
},
"facing=east,on=false": {
"model": "computercraft:block/wireless_modem_normal_off",
"y": 90
},
"facing=down,on=true": {
"model": "computercraft:block/wireless_modem_normal_on",
"x": 90,
"y": 90
},
"facing=up,on=true": {
"model": "computercraft:block/wireless_modem_normal_on",
"x": 270,
"y": 90
},
"facing=north,on=true": {
"model": "computercraft:block/wireless_modem_normal_on"
},
"facing=south,on=true": {
"model": "computercraft:block/wireless_modem_normal_on",
"y": 180
},
"facing=west,on=true": {
"model": "computercraft:block/wireless_modem_normal_on",
"y": 270
},
"facing=east,on=true": {
"model": "computercraft:block/wireless_modem_normal_on",
"y": 90
}
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_advanced_top",
"side": "computercraft:block/computer_advanced_side",
"front": "computercraft:block/computer_advanced_front_blink"
"front": "computercraft:block/computer_advanced_front_blink",
"top": "computercraft:block/computer_advanced_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_advanced_top",
"side": "computercraft:block/computer_advanced_side",
"front": "computercraft:block/computer_advanced_front"
"front": "computercraft:block/computer_advanced_front",
"top": "computercraft:block/computer_advanced_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_advanced_top",
"side": "computercraft:block/computer_advanced_side",
"front": "computercraft:block/computer_advanced_front_on"
"front": "computercraft:block/computer_advanced_front_on",
"top": "computercraft:block/computer_advanced_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_command_top",
"side": "computercraft:block/computer_command_side",
"front": "computercraft:block/computer_command_front_blink"
"front": "computercraft:block/computer_command_front_blink",
"top": "computercraft:block/computer_command_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_command_top",
"side": "computercraft:block/computer_command_side",
"front": "computercraft:block/computer_command_front"
"front": "computercraft:block/computer_command_front",
"top": "computercraft:block/computer_command_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_command_top",
"side": "computercraft:block/computer_command_side",
"front": "computercraft:block/computer_command_front_on"
"front": "computercraft:block/computer_command_front_on",
"top": "computercraft:block/computer_command_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_normal_top",
"side": "computercraft:block/computer_normal_side",
"front": "computercraft:block/computer_normal_front_blink"
"front": "computercraft:block/computer_normal_front_blink",
"top": "computercraft:block/computer_normal_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_normal_top",
"side": "computercraft:block/computer_normal_side",
"front": "computercraft:block/computer_normal_front"
"front": "computercraft:block/computer_normal_front",
"top": "computercraft:block/computer_normal_top"
}
}

View File

@@ -1,8 +1,8 @@
{
"parent": "block/orientable",
"parent": "minecraft:block/orientable",
"textures": {
"top": "computercraft:block/computer_normal_top",
"side": "computercraft:block/computer_normal_side",
"front": "computercraft:block/computer_normal_front_on"
"front": "computercraft:block/computer_normal_front_on",
"top": "computercraft:block/computer_normal_top"
}
}

View File

@@ -0,0 +1,8 @@
{
"parent": "minecraft:block/orientable",
"textures": {
"side": "computercraft:block/monitor_advanced_4",
"front": "computercraft:block/monitor_advanced_15",
"top": "computercraft:block/monitor_advanced_0"
}
}

View File

@@ -0,0 +1,8 @@
{
"parent": "minecraft:block/orientable",
"textures": {
"side": "computercraft:block/monitor_normal_4",
"front": "computercraft:block/monitor_normal_15",
"top": "computercraft:block/monitor_normal_0"
}
}

View File

@@ -0,0 +1,8 @@
{
"parent": "minecraft:block/orientable",
"textures": {
"side": "computercraft:block/speaker_side",
"front": "computercraft:block/speaker_front",
"top": "computercraft:block/speaker_top"
}
}

View File

@@ -0,0 +1,4 @@
{
"loader": "computercraft:turtle",
"model": "computercraft:block/turtle_advanced_base"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "computercraft:block/turtle_base",
"textures": {
"texture": "computercraft:block/turtle_advanced"
}
}

View File

@@ -0,0 +1,4 @@
{
"loader": "computercraft:turtle",
"model": "computercraft:block/turtle_normal_base"
}

View File

@@ -0,0 +1,6 @@
{
"parent": "computercraft:block/turtle_base",
"textures": {
"texture": "computercraft:block/turtle_normal"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "computercraft:block/wired_modem_face"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "computercraft:block/wired_modem_face_peripheral"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "computercraft:block/wired_modem_face_on"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:block/cube_all",
"textures": {
"all": "computercraft:block/wired_modem_face_peripheral_on"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wired_modem_face",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wired_modem_face_peripheral",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wired_modem_face_on",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wired_modem_face_peripheral_on",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wireless_modem_advanced_face",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wireless_modem_advanced_face_on",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wireless_modem_normal_face",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,7 @@
{
"parent": "computercraft:block/modem",
"textures": {
"front": "computercraft:block/wireless_modem_normal_face_on",
"back": "computercraft:block/modem_back"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/computer_advanced_blinking"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/computer_command_blinking"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/computer_normal_blinking"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/monitor_advanced_item"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/monitor_normal_item"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/speaker"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/turtle_advanced"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/turtle_normal"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/wired_modem_off"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/wired_modem_full_off"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/wireless_modem_advanced_off"
}

View File

@@ -0,0 +1,3 @@
{
"parent": "computercraft:block/wireless_modem_normal_off"
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:printed_book"
]
},
"criteria": {
"has_printer": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:printer"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:printed_book"
}
}
},
"requirements": [
[
"has_printer",
"has_the_recipe"
]
]
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:printed_pages"
]
},
"criteria": {
"has_printer": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:printer"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:printed_pages"
}
}
},
"requirements": [
[
"has_printer",
"has_the_recipe"
]
]
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:skull_cloudy"
]
},
"criteria": {
"has_monitor": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:monitor_normal"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:skull_cloudy"
}
}
},
"requirements": [
[
"has_monitor",
"has_the_recipe"
]
]
}

View File

@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:skull_dan200"
]
},
"criteria": {
"has_computer": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:computer_advanced"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:skull_dan200"
}
}
},
"requirements": [
[
"has_computer",
"has_the_recipe"
]
]
}

View File

@@ -0,0 +1,52 @@
{
"type": "minecraft:block",
"pools": [
{
"name": "cable",
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "computercraft:cable"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
},
{
"condition": "minecraft:block_state_property",
"block": "computercraft:cable",
"properties": {
"cable": "true"
}
}
]
},
{
"name": "wired_modem",
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "computercraft:wired_modem"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:block_state_property",
"block": "computercraft:cable",
"properties": {
"modem": "none"
}
}
}
]
}
]
}

View File

@@ -0,0 +1,3 @@
{
"type": "computercraft:colour"
}

View File

@@ -0,0 +1,3 @@
{
"type": "computercraft:disk"
}

View File

@@ -0,0 +1,3 @@
{
"type": "computercraft:pocket_computer_upgrade"
}

View File

@@ -0,0 +1,17 @@
{
"type": "computercraft:impostor_shapeless",
"ingredients": [
{
"tag": "forge:leather"
},
{
"item": "computercraft:printed_page"
},
{
"tag": "forge:string"
}
],
"result": {
"item": "computercraft:printed_book"
}
}

View File

@@ -0,0 +1,17 @@
{
"type": "computercraft:impostor_shapeless",
"ingredients": [
{
"item": "computercraft:printed_page"
},
{
"item": "computercraft:printed_page"
},
{
"tag": "forge:string"
}
],
"result": {
"item": "computercraft:printed_pages"
}
}

View File

@@ -0,0 +1,3 @@
{
"type": "computercraft:printout"
}

View File

@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:heads"
},
{
"item": "computercraft:monitor_normal"
}
],
"result": {
"item": "minecraft:player_head",
"nbt": "{SkullOwner:{Id:\"6d074736-b1e9-4378-a99b-bd8777821c9c\",Name:\"Cloudhunter\"}}"
}
}

View File

@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"tag": "forge:heads"
},
{
"item": "computercraft:computer_advanced"
}
],
"result": {
"item": "minecraft:player_head",
"nbt": "{SkullOwner:{Id:\"f3c8d69b-0776-4512-8434-d1b2165909eb\",Name:\"dan200\"}}"
}
}

View File

@@ -0,0 +1,3 @@
{
"type": "computercraft:turtle_upgrade"
}

View File

@@ -61,6 +61,7 @@ public class SoundManager
setPosition( position );
this.volume = volume;
this.pitch = pitch;
attenuation = ISound.AttenuationType.LINEAR;
}
void setPosition( Vector3d position )

View File

@@ -30,15 +30,15 @@ import dan200.computercraft.core.computer.ComputerSide;
*
* @cc.usage Toggle the redstone signal above the computer every 0.5 seconds.
*
* <pre>
* <pre>{@code
* while true do
* redstone.setOutput("top", not redstone.getOutput("top"))
* sleep(0.5)
* end
* </pre>
* }</pre>
* @cc.usage Mimic a redstone comparator in [subtraction mode][comparator].
*
* <pre>
* <pre>{@code
* while true do
* local rear = rs.getAnalogueInput("back")
* local sides = math.max(rs.getAnalogueInput("left"), rs.getAnalogueInput("right"))
@@ -46,7 +46,7 @@ import dan200.computercraft.core.computer.ComputerSide;
*
* os.pullEvent("redstone") -- Wait for a change to inputs.
* end
* </pre>
* }</pre>
*
* [comparator]: https://minecraft.gamepedia.com/Redstone_Comparator#Subtract_signal_strength "Redstone Comparator on
* the Minecraft wiki."
@@ -205,9 +205,9 @@ public class RedstoneAPI implements ILuaAPI
* @param mask The mask to test.
* @return If the colours are on.
* @cc.usage Check if @{colors.white} and @{colors.black} are on above the computer.
* <pre>
* <pre>{@code
* print(redstone.testBundledInput("top", colors.combine(colors.white, colors.black)))
* </pre>
* }</pre>
* @see #getBundledInput
*/
@LuaFunction

View File

@@ -0,0 +1,44 @@
/*
* This file is part of ComputerCraft - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2021. Do not distribute without permission.
* Send enquiries to dratcliffe@gmail.com
*/
package dan200.computercraft.data;
import com.google.gson.JsonObject;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.CustomLoaderBuilder;
import net.minecraftforge.client.model.generators.ModelBuilder;
import net.minecraftforge.common.data.ExistingFileHelper;
import java.util.function.BiFunction;
import java.util.function.Consumer;
public class BasicCustomLoader<T extends ModelBuilder<T>> extends CustomLoaderBuilder<T>
{
private final Consumer<JsonObject> extra;
protected BasicCustomLoader( ResourceLocation loaderId, T parent, ExistingFileHelper existingFileHelper, Consumer<JsonObject> extra )
{
super( loaderId, parent, existingFileHelper );
this.extra = extra;
}
public static <T extends ModelBuilder<T>> BiFunction<T, ExistingFileHelper, CustomLoaderBuilder<T>> makeFactory( ResourceLocation id )
{
return makeFactory( id, j -> { } );
}
public static <T extends ModelBuilder<T>> BiFunction<T, ExistingFileHelper, CustomLoaderBuilder<T>> makeFactory( ResourceLocation id, Consumer<JsonObject> extra )
{
return ( parent, x ) -> new BasicCustomLoader<>( id, parent, x, extra );
}
@Override
public JsonObject toJson( JsonObject json )
{
super.toJson( json );
extra.accept( json );
return json;
}
}

View File

@@ -9,21 +9,27 @@ import dan200.computercraft.ComputerCraft;
import dan200.computercraft.shared.Registry;
import dan200.computercraft.shared.computer.blocks.BlockComputer;
import dan200.computercraft.shared.computer.core.ComputerState;
import dan200.computercraft.shared.peripheral.modem.wired.BlockWiredModemFull;
import dan200.computercraft.shared.peripheral.modem.wireless.BlockWirelessModem;
import dan200.computercraft.shared.peripheral.monitor.BlockMonitor;
import dan200.computercraft.shared.peripheral.monitor.MonitorEdgeState;
import dan200.computercraft.shared.turtle.blocks.BlockTurtle;
import net.minecraft.block.Block;
import net.minecraft.data.DataGenerator;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.generators.*;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.registries.IForgeRegistryEntry;
import javax.annotation.Nonnull;
import java.util.Objects;
public class BlockModelProvider extends BlockStateProvider
{
private ModelFile monitorBase;
private ModelFile orientable;
private ModelFile turtleBase;
private ModelFile modemBase;
public BlockModelProvider( DataGenerator generator, ExistingFileHelper existingFileHelper )
{
@@ -41,14 +47,33 @@ public class BlockModelProvider extends BlockStateProvider
protected void registerStatesAndModels()
{
monitorBase = models().getExistingFile( new ResourceLocation( ComputerCraft.MOD_ID, "block/monitor_base" ) );
orientable = models().getExistingFile( new ResourceLocation( "block/orientable" ) );
registerMonitors( Registry.ModBlocks.MONITOR_NORMAL.get() );
registerMonitors( Registry.ModBlocks.MONITOR_ADVANCED.get() );
turtleBase = models().getExistingFile( new ResourceLocation( ComputerCraft.MOD_ID, "block/turtle_base" ) );
modemBase = models().getExistingFile( new ResourceLocation( ComputerCraft.MOD_ID, "block/modem" ) );
registerComputer( Registry.ModBlocks.COMPUTER_NORMAL.get() );
registerComputer( Registry.ModBlocks.COMPUTER_ADVANCED.get() );
registerComputer( Registry.ModBlocks.COMPUTER_COMMAND.get() );
registerTurtle( Registry.ModBlocks.TURTLE_NORMAL.get() );
registerTurtle( Registry.ModBlocks.TURTLE_ADVANCED.get() );
registerWirelessModem( Registry.ModBlocks.WIRELESS_MODEM_NORMAL.get() );
registerWirelessModem( Registry.ModBlocks.WIRELESS_MODEM_ADVANCED.get() );
registerWiredModems();
registerMonitors( Registry.ModBlocks.MONITOR_NORMAL.get() );
registerMonitors( Registry.ModBlocks.MONITOR_ADVANCED.get() );
// Register the simple things.
ModelFile speaker = models().orientable(
name( Registry.ModBlocks.SPEAKER.get() ),
blockTexture( Registry.ModBlocks.SPEAKER.get(), "_side" ),
blockTexture( Registry.ModBlocks.SPEAKER.get(), "_front" ),
blockTexture( Registry.ModBlocks.SPEAKER.get(), "_top" )
);
horizontalBlock( Registry.ModBlocks.SPEAKER.get(), speaker );
simpleBlockItem( Registry.ModBlocks.SPEAKER.get(), speaker );
}
private void registerComputer( BlockComputer block )
@@ -56,12 +81,12 @@ public class BlockModelProvider extends BlockStateProvider
VariantBlockStateBuilder builder = getVariantBuilder( block );
for( ComputerState state : BlockComputer.STATE.getPossibleValues() )
{
BlockModelBuilder model = models()
.getBuilder( suffix( block, "_" + state ) )
.parent( orientable )
.texture( "top", suffix( block, "_top" ) )
.texture( "side", suffix( block, "_side" ) )
.texture( "front", suffix( block, "_front" + toSuffix( state ) ) );
BlockModelBuilder model = models().orientable(
extendedName( block, "_" + state ),
blockTexture( block, "_side" ),
blockTexture( block, "_front" + state.getTexture() ),
blockTexture( block, "_top" )
);
for( Direction facing : BlockComputer.FACING.getPossibleValues() )
{
@@ -71,33 +96,118 @@ public class BlockModelProvider extends BlockStateProvider
.addModels( new ConfiguredModel( model, 0, toYAngle( facing ), false ) );
}
}
simpleBlockItem( block, models().getBuilder( extendedName( block, "_blinking" ) ) );
}
private void registerTurtle( BlockTurtle block )
{
VariantBlockStateBuilder builder = getVariantBuilder( block );
BlockModelBuilder base = models()
.getBuilder( extendedName( block, "_base" ) )
.parent( turtleBase )
.texture( "texture", blockTexture( block ) );
BlockModelBuilder model = models()
.getBuilder( name( block ) )
.customLoader( BasicCustomLoader.makeFactory( new ResourceLocation( ComputerCraft.MOD_ID, "turtle" ), x -> {
x.addProperty( "model", base.getLocation().toString() );
} ) )
.end();
for( Direction facing : BlockTurtle.FACING.getPossibleValues() )
{
builder.partialState()
.with( BlockTurtle.FACING, facing )
.addModels( new ConfiguredModel( model, 0, toYAngle( facing ), false ) );
}
simpleBlockItem( block, models().getBuilder( name( block ) ) );
}
private void registerWirelessModem( BlockWirelessModem block )
{
VariantBlockStateBuilder builder = getVariantBuilder( block );
for( boolean on : BlockWirelessModem.ON.getPossibleValues() )
{
ModelFile model = modemModel( extendedName( block, on ? "_on" : "_off" ), blockTexture( block, "_face" + (on ? "_on" : "") ) );
for( Direction facing : BlockWirelessModem.FACING.getPossibleValues() )
{
builder.partialState()
.with( BlockWirelessModem.FACING, facing )
.with( BlockWirelessModem.ON, on )
.addModels( new ConfiguredModel( model, toXAngle( facing ), toYAngle( facing ), false ) );
}
}
simpleBlockItem( block, models().getBuilder( extendedName( block, "_off" ) ) );
}
private void registerWiredModems()
{
Block fullBlock = Registry.ModBlocks.WIRED_MODEM_FULL.get();
VariantBlockStateBuilder fullBlockState = getVariantBuilder( fullBlock );
for( boolean on : BlockWiredModemFull.MODEM_ON.getPossibleValues() )
{
for( boolean peripheral : BlockWiredModemFull.PERIPHERAL_ON.getPossibleValues() )
{
String suffix = (on ? "_on" : "_off") + (peripheral ? "_peripheral" : "");
ResourceLocation faceTexture = new ResourceLocation(
ComputerCraft.MOD_ID,
"block/wired_modem_face" + (peripheral ? "_peripheral" : "") + (on ? "_on" : "")
);
ModelFile fullBlockModel = models().cubeAll( blockTexture( fullBlock, suffix ).toString(), faceTexture );
fullBlockState.partialState()
.with( BlockWiredModemFull.MODEM_ON, on )
.with( BlockWiredModemFull.PERIPHERAL_ON, peripheral )
.addModels( new ConfiguredModel( fullBlockModel ) );
modemModel( "wired_modem" + suffix, faceTexture );
}
}
simpleBlockItem( fullBlock, models().getBuilder( extendedName( fullBlock, "_off" ) ) );
itemModels()
.getBuilder( name( Registry.ModItems.WIRED_MODEM.get() ) )
.parent( models().getBuilder( "wired_modem_off" ) );
}
private ModelFile modemModel( String name, ResourceLocation texture )
{
return models()
.getBuilder( name )
.parent( modemBase )
.texture( "front", texture )
.texture( "back", new ResourceLocation( ComputerCraft.MOD_ID, "block/modem_back" ) );
}
private void registerMonitors( BlockMonitor block )
{
String name = block.getRegistryName().getPath();
registerMonitorModel( name, "", 16, 4, 0, 32 );
registerMonitorModel( name, "_d", 20, 7, 0, 36 );
registerMonitorModel( name, "_l", 19, 4, 1, 33 );
registerMonitorModel( name, "_ld", 31, 7, 1, 45 );
registerMonitorModel( name, "_lr", 18, 4, 2, 34 );
registerMonitorModel( name, "_lrd", 30, 7, 2, 46 );
registerMonitorModel( name, "_lru", 24, 5, 2, 40 );
registerMonitorModel( name, "_lrud", 27, 6, 2, 43 );
registerMonitorModel( name, "_lu", 25, 5, 1, 39 );
registerMonitorModel( name, "_lud", 28, 6, 1, 42 );
registerMonitorModel( name, "_r", 17, 4, 3, 35 );
registerMonitorModel( name, "_rd", 29, 7, 3, 47 );
registerMonitorModel( name, "_ru", 23, 5, 3, 41 );
registerMonitorModel( name, "_rud", 26, 6, 3, 44 );
registerMonitorModel( name, "_u", 22, 5, 0, 38 );
registerMonitorModel( name, "_ud", 21, 6, 0, 37 );
String name = blockTexture( block ).toString();
monitorModel( name, "", 16, 4, 0, 32 );
monitorModel( name, "_d", 20, 7, 0, 36 );
monitorModel( name, "_l", 19, 4, 1, 33 );
monitorModel( name, "_ld", 31, 7, 1, 45 );
monitorModel( name, "_lr", 18, 4, 2, 34 );
monitorModel( name, "_lrd", 30, 7, 2, 46 );
monitorModel( name, "_lru", 24, 5, 2, 40 );
monitorModel( name, "_lrud", 27, 6, 2, 43 );
monitorModel( name, "_lu", 25, 5, 1, 39 );
monitorModel( name, "_lud", 28, 6, 1, 42 );
monitorModel( name, "_r", 17, 4, 3, 35 );
monitorModel( name, "_rd", 29, 7, 3, 47 );
monitorModel( name, "_ru", 23, 5, 3, 41 );
monitorModel( name, "_rud", 26, 6, 3, 44 );
monitorModel( name, "_u", 22, 5, 0, 38 );
monitorModel( name, "_ud", 21, 6, 0, 37 );
VariantBlockStateBuilder builder = getVariantBuilder( block );
for( MonitorEdgeState edge : BlockMonitor.STATE.getPossibleValues() )
{
String suffix = edge == MonitorEdgeState.NONE ? "" : "_" + edge.getSerializedName();
ModelFile model = models().getBuilder( suffix( block, suffix ) );
ModelFile model = models().getBuilder( extend( block.getRegistryName(), suffix ) );
for( Direction facing : BlockMonitor.FACING.getPossibleValues() )
{
@@ -111,11 +221,18 @@ public class BlockModelProvider extends BlockStateProvider
}
}
}
simpleBlockItem( block, models().orientable(
extendedName( block, "_item" ),
blockTexture( block, "_4" ),
blockTexture( block, "_15" ),
blockTexture( block, "_0" )
) );
}
private void registerMonitorModel( String prefix, String corners, int front, int side, int top, int back )
private void monitorModel( String prefix, String corners, int front, int side, int top, int back )
{
String texturePrefix = ComputerCraft.MOD_ID + ":block/" + prefix + "_";
String texturePrefix = prefix + "_";
models().getBuilder( prefix + corners )
.parent( monitorBase )
.texture( "front", texturePrefix + front )
@@ -142,23 +259,27 @@ public class BlockModelProvider extends BlockStateProvider
return ((int) direction.toYRot() + 180) % 360;
}
private static String toSuffix( ComputerState state )
{
switch( state )
{
default:
case OFF:
return "";
case ON:
return "_on";
case BLINKING:
return "_blink";
}
}
private static String suffix( Block block, String suffix )
private static ResourceLocation blockTexture( Block block, String suffix )
{
ResourceLocation id = block.getRegistryName();
return new ResourceLocation( id.getNamespace(), "block/" + id.getPath() + suffix ).toString();
return new ResourceLocation( id.getNamespace(), "block/" + id.getPath() + suffix );
}
@Nonnull
private String name( @Nonnull IForgeRegistryEntry<?> term )
{
return Objects.requireNonNull( term.getRegistryName() ).toString();
}
@Nonnull
private String extendedName( @Nonnull IForgeRegistryEntry<?> term, @Nonnull String suffix )
{
return extend( Objects.requireNonNull( term.getRegistryName() ), suffix );
}
@Nonnull
private String extend( @Nonnull ResourceLocation location, @Nonnull String suffix )
{
return new ResourceLocation( location.getNamespace(), location.getPath() + suffix ).toString();
}
}

View File

@@ -11,10 +11,14 @@ import dan200.computercraft.shared.Registry;
import dan200.computercraft.shared.data.BlockNamedEntityLootCondition;
import dan200.computercraft.shared.data.HasComputerIdLootCondition;
import dan200.computercraft.shared.data.PlayerCreativeLootCondition;
import dan200.computercraft.shared.peripheral.modem.wired.BlockCable;
import dan200.computercraft.shared.peripheral.modem.wired.CableModemVariant;
import net.minecraft.advancements.criterion.StatePropertiesPredicate;
import net.minecraft.block.Block;
import net.minecraft.data.DataGenerator;
import net.minecraft.loot.*;
import net.minecraft.loot.conditions.Alternative;
import net.minecraft.loot.conditions.BlockStateProperty;
import net.minecraft.loot.conditions.SurvivesExplosion;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.RegistryObject;
@@ -46,6 +50,30 @@ public class LootTables extends LootTableProvider
computerDrop( add, Registry.ModBlocks.TURTLE_NORMAL );
computerDrop( add, Registry.ModBlocks.TURTLE_ADVANCED );
add.accept( Registry.ModBlocks.CABLE.get().getLootTable(), LootTable
.lootTable()
.setParamSet( LootParameterSets.BLOCK )
.withPool( LootPool.lootPool()
.name( "cable" )
.setRolls( ConstantRange.exactly( 1 ) )
.add( ItemLootEntry.lootTableItem( Registry.ModItems.CABLE.get() ) )
.when( SurvivesExplosion.survivesExplosion() )
.when( BlockStateProperty.hasBlockStateProperties( Registry.ModBlocks.CABLE.get() )
.setProperties( StatePropertiesPredicate.Builder.properties().hasProperty( BlockCable.CABLE, true ) )
)
)
.withPool( LootPool.lootPool()
.name( "wired_modem" )
.setRolls( ConstantRange.exactly( 1 ) )
.add( ItemLootEntry.lootTableItem( Registry.ModItems.WIRED_MODEM.get() ) )
.when( SurvivesExplosion.survivesExplosion() )
.when( BlockStateProperty.hasBlockStateProperties( Registry.ModBlocks.CABLE.get() )
.setProperties( StatePropertiesPredicate.Builder.properties().hasProperty( BlockCable.MODEM, CableModemVariant.None ) )
.invert()
)
)
.build() );
add.accept( CommonHooks.LOOT_TREASURE_DISK, LootTable
.lootTable()
.setParamSet( LootParameterSets.ALL_PARAMS )

View File

@@ -10,10 +10,15 @@ import dan200.computercraft.data.Tags.CCTags;
import dan200.computercraft.shared.PocketUpgrades;
import dan200.computercraft.shared.Registry;
import dan200.computercraft.shared.TurtleUpgrades;
import dan200.computercraft.shared.common.ColourableRecipe;
import dan200.computercraft.shared.common.IColouredItem;
import dan200.computercraft.shared.computer.core.ComputerFamily;
import dan200.computercraft.shared.media.recipes.DiskRecipe;
import dan200.computercraft.shared.media.recipes.PrintoutRecipe;
import dan200.computercraft.shared.pocket.items.PocketComputerItemFactory;
import dan200.computercraft.shared.pocket.recipes.PocketComputerUpgradeRecipe;
import dan200.computercraft.shared.turtle.items.TurtleItemFactory;
import dan200.computercraft.shared.turtle.recipes.TurtleUpgradeRecipe;
import dan200.computercraft.shared.util.Colour;
import dan200.computercraft.shared.util.ImpostorRecipe;
import dan200.computercraft.shared.util.ImpostorShapelessRecipe;
@@ -22,6 +27,9 @@ import net.minecraft.advancements.criterion.ItemPredicate;
import net.minecraft.block.Blocks;
import net.minecraft.data.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tags.ITag;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
@@ -45,6 +53,12 @@ public class Recipes extends RecipeProvider
diskColours( add );
pocketUpgrades( add );
turtleUpgrades( add );
addSpecial( add, PrintoutRecipe.SERIALIZER );
addSpecial( add, DiskRecipe.SERIALIZER );
addSpecial( add, ColourableRecipe.SERIALIZER );
addSpecial( add, TurtleUpgradeRecipe.SERIALIZER );
addSpecial( add, PocketComputerUpgradeRecipe.SERIALIZER );
}
/**
@@ -303,6 +317,41 @@ public class Recipes extends RecipeProvider
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
.unlockedBy( "has_wireless", inventoryChange( Registry.ModBlocks.WIRELESS_MODEM_NORMAL.get() ) )
.save( add );
ShapelessRecipeBuilder
.shapeless( Items.PLAYER_HEAD )
.requires( Tags.Items.HEADS )
.requires( Registry.ModItems.MONITOR_NORMAL.get() )
.unlockedBy( "has_monitor", inventoryChange( Registry.ModItems.MONITOR_NORMAL.get() ) )
.save(
RecipeWrapper.wrap( IRecipeSerializer.SHAPELESS_RECIPE, add, playerHead( "Cloudhunter", "6d074736-b1e9-4378-a99b-bd8777821c9c" ) ),
new ResourceLocation( ComputerCraft.MOD_ID, "skull_cloudy" )
);
ShapelessRecipeBuilder
.shapeless( Items.PLAYER_HEAD )
.requires( Tags.Items.HEADS )
.requires( Registry.ModItems.COMPUTER_ADVANCED.get() )
.unlockedBy( "has_computer", inventoryChange( Registry.ModItems.COMPUTER_ADVANCED.get() ) )
.save(
RecipeWrapper.wrap( IRecipeSerializer.SHAPELESS_RECIPE, add, playerHead( "dan200", "f3c8d69b-0776-4512-8434-d1b2165909eb" ) ),
new ResourceLocation( ComputerCraft.MOD_ID, "skull_dan200" )
);
ShapelessRecipeBuilder
.shapeless( Registry.ModItems.PRINTED_PAGES.get() )
.requires( Registry.ModItems.PRINTED_PAGE.get(), 2 )
.requires( Tags.Items.STRING )
.unlockedBy( "has_printer", inventoryChange( Registry.ModBlocks.PRINTER.get() ) )
.save( RecipeWrapper.wrap( ImpostorShapelessRecipe.SERIALIZER, add ) );
ShapelessRecipeBuilder
.shapeless( Registry.ModItems.PRINTED_BOOK.get() )
.requires( Tags.Items.LEATHER )
.requires( Registry.ModItems.PRINTED_PAGE.get(), 1 )
.requires( Tags.Items.STRING )
.unlockedBy( "has_printer", inventoryChange( Registry.ModBlocks.PRINTER.get() ) )
.save( RecipeWrapper.wrap( ImpostorShapelessRecipe.SERIALIZER, add ) );
}
private static DyeColor ofColour( Colour colour )
@@ -319,4 +368,20 @@ public class Recipes extends RecipeProvider
{
return InventoryChangeTrigger.Instance.hasItems( stack );
}
private static CompoundNBT playerHead( String name, String uuid )
{
CompoundNBT owner = new CompoundNBT();
owner.putString( "Name", name );
owner.putString( "Id", uuid );
CompoundNBT tag = new CompoundNBT();
tag.put( "SkullOwner", owner );
return tag;
}
private static void addSpecial( Consumer<IFinishedRecipe> add, SpecialRecipeSerializer<?> special )
{
CustomRecipeBuilder.special( special ).save( add, special.getRegistryName().toString() );
}
}

View File

@@ -98,5 +98,5 @@ public final class ColourableRecipe extends SpecialRecipe
return SERIALIZER;
}
public static final IRecipeSerializer<?> SERIALIZER = new SpecialRecipeSerializer<>( ColourableRecipe::new );
public static final SpecialRecipeSerializer<?> SERIALIZER = new SpecialRecipeSerializer<>( ColourableRecipe::new );
}

View File

@@ -91,9 +91,9 @@ public class CommandAPI implements ILuaAPI
* @cc.treturn number|nil The number of "affected" objects, or `nil` if the command failed. The definition of this
* varies from command to command.
* @cc.usage Set the block above the command computer to stone.
* <pre>
* <pre>{@code
* commands.exec("setblock ~ ~1 ~ minecraft:stone")
* </pre>
* }</pre>
*/
@LuaFunction( mainThread = true )
public final Object[] exec( String command )
@@ -117,9 +117,9 @@ public class CommandAPI implements ILuaAPI
* @return The "task id". When this command has been executed, it will queue a `task_complete` event with a matching id.
* @throws LuaException (hidden) If the task cannot be created.
* @cc.usage Asynchronously sets the block above the computer to stone.
* <pre>
* <pre>{@code
* commands.execAsync("~ ~1 ~ minecraft:stone")
* </pre>
* }</pre>
* @cc.see parallel One may also use the parallel API to run multiple commands at once.
*/
@LuaFunction

View File

@@ -11,15 +11,17 @@ import javax.annotation.Nonnull;
public enum ComputerState implements IStringSerializable
{
OFF( "off" ),
ON( "on" ),
BLINKING( "blinking" );
OFF( "off", "" ),
ON( "on", "_on" ),
BLINKING( "blinking", "_blink" );
private final String name;
private final String texture;
ComputerState( String name )
ComputerState( String name, String texture )
{
this.name = name;
this.texture = texture;
}
@Nonnull
@@ -34,4 +36,10 @@ public enum ComputerState implements IStringSerializable
{
return name;
}
@Nonnull
public String getTexture()
{
return texture;
}
}

View File

@@ -14,20 +14,16 @@ import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.Tags;
import javax.annotation.Nonnull;
public class DiskRecipe extends SpecialRecipe
{
private final Ingredient paper = Ingredient.of( Items.PAPER );
private final Ingredient redstone = Ingredient.of( Items.REDSTONE );
// TODO: Ingredient.fromTag( Tags.Items.DUSTS_REDSTONE );
public DiskRecipe( ResourceLocation id )
{
super( id );
@@ -45,12 +41,12 @@ public class DiskRecipe extends SpecialRecipe
if( !stack.isEmpty() )
{
if( paper.test( stack ) )
if( stack.getItem() == Items.PAPER )
{
if( paperFound ) return false;
paperFound = true;
}
else if( redstone.test( stack ) )
else if( Tags.Items.DUSTS_REDSTONE.contains( stack.getItem() ) )
{
if( redstoneFound ) return false;
redstoneFound = true;
@@ -77,7 +73,7 @@ public class DiskRecipe extends SpecialRecipe
if( stack.isEmpty() ) continue;
if( !paper.test( stack ) && !redstone.test( stack ) )
if( stack.getItem() != Items.PAPER && !Tags.Items.DUSTS_REDSTONE.contains( stack.getItem() ) )
{
DyeColor dye = ColourUtils.getStackColour( stack );
if( dye != null ) tracker.addColour( dye );
@@ -107,5 +103,5 @@ public class DiskRecipe extends SpecialRecipe
return SERIALIZER;
}
public static final IRecipeSerializer<DiskRecipe> SERIALIZER = new SpecialRecipeSerializer<>( DiskRecipe::new );
public static final SpecialRecipeSerializer<DiskRecipe> SERIALIZER = new SpecialRecipeSerializer<>( DiskRecipe::new );
}

View File

@@ -10,20 +10,16 @@ import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.SpecialRecipe;
import net.minecraft.item.crafting.SpecialRecipeSerializer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.common.Tags;
import javax.annotation.Nonnull;
public final class PrintoutRecipe extends SpecialRecipe
{
private final Ingredient paper = Ingredient.of( net.minecraft.item.Items.PAPER );
private final Ingredient leather = Ingredient.of( net.minecraft.item.Items.LEATHER );
private final Ingredient string = Ingredient.of( Items.STRING );
private PrintoutRecipe( ResourceLocation id )
{
super( id );
@@ -77,7 +73,7 @@ public final class PrintoutRecipe extends SpecialRecipe
numPrintouts++;
printoutFound = true;
}
else if( paper.test( stack ) )
else if( stack.getItem() == Items.PAPER )
{
if( printouts == null )
{
@@ -87,11 +83,11 @@ public final class PrintoutRecipe extends SpecialRecipe
numPages++;
numPrintouts++;
}
else if( string.test( stack ) && !stringFound )
else if( Tags.Items.STRING.contains( stack.getItem() ) && !stringFound )
{
stringFound = true;
}
else if( leather.test( stack ) && !leatherFound )
else if( Tags.Items.LEATHER.contains( stack.getItem() ) && !leatherFound )
{
leatherFound = true;
}
@@ -163,5 +159,5 @@ public final class PrintoutRecipe extends SpecialRecipe
return SERIALIZER;
}
public static final IRecipeSerializer<?> SERIALIZER = new SpecialRecipeSerializer<>( PrintoutRecipe::new );
public static final SpecialRecipeSerializer<?> SERIALIZER = new SpecialRecipeSerializer<>( PrintoutRecipe::new );
}

View File

@@ -90,7 +90,6 @@ public final class NetworkHandler
}
/**
* /**
* Register packet, and a thread-unsafe handler for it.
*
* @param <T> The type of the packet to send.

View File

@@ -30,7 +30,7 @@ import javax.annotation.Nullable;
public class BlockDiskDrive extends BlockGeneric
{
static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
static final EnumProperty<DiskDriveState> STATE = EnumProperty.create( "state", DiskDriveState.class );
public static final EnumProperty<DiskDriveState> STATE = EnumProperty.create( "state", DiskDriveState.class );
public BlockDiskDrive( Properties settings )
{

View File

@@ -34,7 +34,7 @@ public final class WiredModemLocalPeripheral
private static final String NBT_PERIPHERAL_TYPE = "PeripheralType";
private static final String NBT_PERIPHERAL_ID = "PeripheralId";
private int id;
private int id = -1;
private String type;
private IPeripheral peripheral;

View File

@@ -28,11 +28,11 @@ import javax.annotation.Nullable;
* @cc.module monitor
* @cc.usage Write "Hello, world!" to an adjacent monitor:
*
* <pre>
* <pre>{@code
* local monitor = peripheral.find("monitor")
* monitor.setCursorPos(1, 1)
* monitor.write("Hello, world!")
* </pre>
* }</pre>
*/
public class MonitorPeripheral extends TermMethods implements IPeripheral
{

View File

@@ -176,7 +176,8 @@ public abstract class SpeakerPeripheral implements IPeripheral
World world = getWorld();
Vector3d pos = getPosition();
float range = MathHelper.clamp( volume, 1.0f, 3.0f ) * 16;
float actualVolume = MathHelper.clamp( volume, 0.0f, 3.0f );
float range = actualVolume * 16;
context.issueMainThreadTask( () -> {
MinecraftServer server = world.getServer();
@@ -186,13 +187,13 @@ public abstract class SpeakerPeripheral implements IPeripheral
{
server.getPlayerList().broadcast(
null, pos.x, pos.y, pos.z, range, world.dimension(),
new SPlaySoundPacket( name, SoundCategory.RECORDS, pos, range, pitch )
new SPlaySoundPacket( name, SoundCategory.RECORDS, pos, actualVolume, pitch )
);
}
else
{
NetworkHandler.sendToAllAround(
new SpeakerPlayClientMessage( getSource(), pos, name, range, pitch ),
new SpeakerPlayClientMessage( getSource(), pos, name, actualVolume, pitch ),
world, pos, range
);
}

View File

@@ -25,13 +25,13 @@ import net.minecraftforge.items.wrapper.PlayerMainInvWrapper;
* This API is only available on pocket computers. As such, you may use its presence to determine what kind of computer
* you are using:
*
* <pre>
* <pre>{@code
* if pocket then
* print("On a pocket computer")
* else
* print("On something else")
* end
* </pre>
* }</pre>
*
* @cc.module pocket
*/

View File

@@ -113,5 +113,5 @@ public final class PocketComputerUpgradeRecipe extends SpecialRecipe
return SERIALIZER;
}
public static final IRecipeSerializer<PocketComputerUpgradeRecipe> SERIALIZER = new SpecialRecipeSerializer<>( PocketComputerUpgradeRecipe::new );
public static final SpecialRecipeSerializer<PocketComputerUpgradeRecipe> SERIALIZER = new SpecialRecipeSerializer<>( PocketComputerUpgradeRecipe::new );
}

View File

@@ -185,5 +185,5 @@ public final class TurtleUpgradeRecipe extends SpecialRecipe
return SERIALIZER;
}
public static final IRecipeSerializer<TurtleUpgradeRecipe> SERIALIZER = new SpecialRecipeSerializer<>( TurtleUpgradeRecipe::new );
public static final SpecialRecipeSerializer<TurtleUpgradeRecipe> SERIALIZER = new SpecialRecipeSerializer<>( TurtleUpgradeRecipe::new );
}

View File

@@ -91,14 +91,7 @@ public class TurtleTool extends AbstractTurtleUpgrade
@OnlyIn( Dist.CLIENT )
public TransformedModel getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
{
float xOffset = side == TurtleSide.LEFT ? -0.40625f : 0.40625f;
Matrix4f transform = new Matrix4f( new float[] {
0.0f, 0.0f, -1.0f, 1.0f + xOffset,
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f, 1.0f,
0.0f, 0.0f, 0.0f, 1.0f,
} );
return TransformedModel.of( getCraftingItem(), new TransformationMatrix( transform ) );
return TransformedModel.of( getCraftingItem(), side == TurtleSide.LEFT ? Transforms.leftTransform : Transforms.rightTransform );
}
@Nonnull
@@ -293,4 +286,20 @@ public class TurtleTool extends AbstractTurtleUpgrade
Direction direction = tile.isRemoved() ? null : turtle.getDirection().getOpposite();
DropConsumer.clearAndDrop( turtle.getWorld(), turtle.getPosition(), direction );
}
private static class Transforms
{
static final TransformationMatrix leftTransform = getMatrixFor( -0.40625f );
static final TransformationMatrix rightTransform = getMatrixFor( 0.40625f );
private static TransformationMatrix getMatrixFor( float offset )
{
return new TransformationMatrix( new Matrix4f( new float[] {
0.0f, 0.0f, -1.0f, 1.0f + offset,
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f, 1.0f,
0.0f, 0.0f, 0.0f, 1.0f,
} ) );
}
}
}

View File

@@ -1,8 +0,0 @@
{
"variants": {
"facing=north": { "model": "computercraft:block/speaker" },
"facing=south": { "model": "computercraft:block/speaker", "y": 180 },
"facing=west": { "model": "computercraft:block/speaker", "y": 270 },
"facing=east": { "model": "computercraft:block/speaker", "y": 90 }
}
}

View File

@@ -1,8 +0,0 @@
{
"variants": {
"facing=north": { "model": "computercraft:block/turtle_advanced" },
"facing=south": { "model": "computercraft:block/turtle_advanced", "y": 180 },
"facing=west": { "model": "computercraft:block/turtle_advanced", "y": 270 },
"facing=east": { "model": "computercraft:block/turtle_advanced", "y": 90 }
}
}

View File

@@ -1,8 +0,0 @@
{
"variants": {
"facing=north": { "model": "computercraft:block/turtle_normal" },
"facing=south": { "model": "computercraft:block/turtle_normal", "y": 180 },
"facing=west": { "model": "computercraft:block/turtle_normal", "y": 270 },
"facing=east": { "model": "computercraft:block/turtle_normal", "y": 90 }
}
}

View File

@@ -1,8 +0,0 @@
{
"variants": {
"facing=north": { "model": "computercraft:turtle_normal" },
"facing=south": { "model": "computercraft:turtle_normal", "y": 180 },
"facing=west": { "model": "computercraft:turtle_normal", "y": 270 },
"facing=east": { "model": "computercraft:turtle_normal", "y": 90 }
}
}

View File

@@ -1,8 +0,0 @@
{
"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" }
}
}

View File

@@ -1,17 +0,0 @@
{
"variants": {
"facing=up,on=false": { "model": "computercraft:block/wireless_modem_advanced_off", "x": 270 },
"facing=down,on=false": { "model": "computercraft:block/wireless_modem_advanced_off", "x": 90 },
"facing=north,on=false": { "model": "computercraft:block/wireless_modem_advanced_off" },
"facing=south,on=false": { "model": "computercraft:block/wireless_modem_advanced_off", "y": 180 },
"facing=west,on=false": { "model": "computercraft:block/wireless_modem_advanced_off", "y": 270 },
"facing=east,on=false": { "model": "computercraft:block/wireless_modem_advanced_off", "y": 90 },
"facing=up,on=true": { "model": "computercraft:block/wireless_modem_advanced_on", "x": 270 },
"facing=down,on=true": { "model": "computercraft:block/wireless_modem_advanced_on", "x": 90 },
"facing=north,on=true": { "model": "computercraft:block/wireless_modem_advanced_on" },
"facing=south,on=true": { "model": "computercraft:block/wireless_modem_advanced_on", "y": 180 },
"facing=west,on=true": { "model": "computercraft:block/wireless_modem_advanced_on", "y": 270 },
"facing=east,on=true": { "model": "computercraft:block/wireless_modem_advanced_on", "y": 90 }
}
}

Some files were not shown because too many files have changed in this diff Show More