1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-04-11 21:33:15 +00:00

Merge branch 'mc-1.15.x' into mc-1.16.x

This commit is contained in:
Jonathan Coates 2020-12-25 16:43:32 +00:00
commit 96c577482d
202 changed files with 4269 additions and 2237 deletions

View File

@ -17,6 +17,5 @@ indent_size = 2
[*.yml]
indent_size = 2
[*.properties]
insert_final_newline = false

View File

@ -12,5 +12,8 @@ chmod 600 "$HOME/.ssh/key"
# And upload
rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \
"$GITHUB_WORKSPACE/doc/out/" \
"$GITHUB_WORKSPACE/build/docs/lua/" \
"$SSH_USER@$SSH_HOST:/var/www/tweaked.cc/$DEST"
rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \
"$GITHUB_WORKSPACE/build/docs/javadoc/" \
"$SSH_USER@$SSH_HOST:/var/www/tweaked.cc/$DEST/javadoc"

View File

@ -3,11 +3,7 @@ name: Build documentation
on:
push:
branches:
- master
- mc-1.15.x
tags:
release:
types: [ published ]
jobs:
make_doc:
@ -30,18 +26,20 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: ./gradlew compileJava --no-daemon || ./gradlew compileJava --no-daemon
- name: Generate Java documentation stubs
run: ./gradlew luaJavadoc --no-daemon
- name: Build documentation
- name: Setup illuaminate
run: |
test -d bin || mkdir bin
test -f bin/illuaminate || wget -q -Obin/illuaminate https://squiddev.cc/illuaminate/linux-x86-64/illuaminate
chmod +x bin/illuaminate
bin/illuaminate doc-gen
- name: Setup node
run: npm ci
- name: Build with Gradle
run: ./gradlew compileJava --no-daemon || ./gradlew compileJava --no-daemon
- name: Generate documentation
run: ./gradlew docWebsite javadoc --no-daemon
- name: Upload documentation
run: .github/workflows/make-doc.sh 2> /dev/null

10
.gitignore vendored
View File

@ -4,7 +4,7 @@
/build
/out
/doc/out/
/doc/javadoc/
/node_modules
# Runtime directories
/run
@ -18,10 +18,12 @@
.gradle
*.DS_Store
.classpath
.project
.settings/
/.classpath
/.project
/.settings
/.vscode
bin/
*.launch
/src/generated/resources/.cache
/src/web/mount/*.d.ts

View File

@ -67,3 +67,6 @@ dependencies {
You should also be careful to only use classes within the `dan200.computercraft.api` package. Non-API classes are
subject to change at any point. If you depend on functionality outside the API, file an issue, and we can look into
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/).

View File

@ -116,13 +116,14 @@ dependencies {
shade 'org.squiddev:Cobalt:0.5.1-SNAPSHOT'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
testImplementation 'org.hamcrest:hamcrest:2.2'
deployerJars "org.apache.maven.wagon:wagon-ssh:3.0.0"
cctJavadoc 'cc.tweaked:cct-javadoc:1.2.1'
cctJavadoc 'cc.tweaked:cct-javadoc:1.3.0'
}
// Compile tasks
@ -136,7 +137,7 @@ task luaJavadoc(type: Javadoc) {
group "documentation"
source = sourceSets.main.allJava
destinationDir = file("doc/javadoc")
destinationDir = file("${project.docsDir}/luaJavadoc")
classpath = sourceSets.main.compileClasspath
options.docletpath = configurations.cctJavadoc.files as List
@ -306,6 +307,58 @@ task compressJson(dependsOn: jar) {
assemble.dependsOn compressJson
// Web tasks
import org.apache.tools.ant.taskdefs.condition.Os
List<String> mkCommand(String command) {
return Os.isFamily(Os.FAMILY_WINDOWS) ? ["cmd", "/c", command] : ["sh", "-c", command]
}
task rollup(type: Exec) {
group = "build"
description = "Bundles JS into rollup"
inputs.files(fileTree("src/web")).withPropertyName("sources")
inputs.file("package-lock.json").withPropertyName("package-lock.json")
inputs.file("tsconfig.json").withPropertyName("Typescript config")
inputs.file("rollup.config.js").withPropertyName("Rollup config")
outputs.file("$buildDir/rollup/index.js").withPropertyName("output")
commandLine mkCommand('"node_modules/.bin/rollup" --config rollup.config.js')
}
task minifyWeb(type: Exec, dependsOn: rollup) {
group = "build"
description = "Bundles JS into rollup"
inputs.file("$buildDir/rollup/index.js").withPropertyName("sources")
inputs.file("package-lock.json").withPropertyName("package-lock.json")
outputs.file("$buildDir/rollup/index.min.js").withPropertyName("output")
commandLine mkCommand('"node_modules/.bin/terser"' + " -o $buildDir/rollup/index.min.js $buildDir/rollup/index.js")
}
task illuaminateDocs(type: Exec, dependsOn: [minifyWeb, luaJavadoc]) {
group = "build"
description = "Bundles JS into rollup"
inputs.files(fileTree("doc")).withPropertyName("docs")
inputs.files(fileTree("src/main/resources/data/computercraft/lua/rom")).withPropertyName("lua rom")
inputs.file("illuaminate.sexp").withPropertyName("illuaminate.sexp")
inputs.dir("$buildDir/docs/luaJavadoc")
inputs.file("$buildDir/rollup/index.min.js").withPropertyName("scripts")
inputs.file("src/web/styles.css").withPropertyName("styles")
outputs.dir("$buildDir/docs/lua")
commandLine mkCommand('"bin/illuaminate" doc-gen')
}
task docWebsite(type: Copy, dependsOn: [illuaminateDocs]) {
from 'doc/logo.png'
into "${project.docsDir}/lua"
}
// Check tasks
test {

View File

@ -15,7 +15,7 @@
function isDriveRoot(path) end
--[[- Provides completion for a file or directory name, suitable for use with
@{read}.
@{_G.read}.
When a directory is a possible candidate for completion, two entries are
included - one with a trailing slash (indicating that entries within this

View File

@ -1,6 +1,6 @@
--[[-
Global functions defined by `bios.lua`. This does not include standard Lua
functions.
Functions in the global environment, defined in `bios.lua`. This does not
include standard Lua functions.
@module _G
]]
@ -27,18 +27,87 @@ or the @{parallel|parallel API}.
nearest multiple of 0.05.
@see os.startTimer
@usage Sleep for three seconds.
print("Sleeping for three seconds")
sleep(3)
print("Done!")
]]
function sleep(time) end
--- Writes a line of text to the screen without a newline at the end, wrapping
-- text if necessary.
--
-- @tparam string text The text to write to the string
-- @treturn number The number of lines written
-- @see print A wrapper around write that adds a newline and accepts multiple arguments
-- @usage write("Hello, world")
function write(text) end
--- Prints the specified values to the screen separated by spaces, wrapping if
-- necessary. After printing, the cursor is moved to the next line.
--
-- @param ... The values to print on the screen
-- @treturn number The number of lines written
-- @usage print("Hello, world!")
function print(...) end
--- Prints the specified values to the screen in red, separated by spaces,
-- wrapping if necessary. After printing, the cursor is moved to the next line.
--
-- @param ... The values to print on the screen
-- @usage printError("Something went wrong!")
function printError(...) end
--[[- Reads user input from the terminal, automatically handling arrow keys,
pasting, character replacement, history scrollback, auto-completion, and
default values.
@tparam[opt] string replaceChar A character to replace each typed character with.
This can be used for hiding passwords, for example.
@tparam[opt] table history A table holding history items that can be scrolled
back to with the up/down arrow keys. The oldest item is at index 1, while the
newest item is at the highest index.
@tparam[opt] function(partial: string):({ string... }|nil) completeFn A function
to be used for completion. This function should take the partial text typed so
far, and returns a list of possible completion options.
@tparam[opt] string default Default text which should already be entered into
the prompt.
@treturn string The text typed in.
@see cc.completion For functions to help with completion.
@usage Read an string and echo it back to the user
write("> ")
local msg = read()
print(msg)
@usage Prompt a user for a password.
while true do
write("Password> ")
local pwd = read("*")
if pwd == "let me in" then break end
print("Incorrect password, try again.")
end
print("Logged in!")
@usage A complete example with completion, history and a default value.
local completion = require "cc.completion"
local history = { "potato", "orange", "apple" }
local choices = { "apple", "orange", "banana", "strawberry" }
write("> ")
local msg = read(nil, history, function(text) return completion.choice(text, choices) end, "app")
print(msg)
]]
function read(replaceChar, history, completeFn, default) end
--- The ComputerCraft and Minecraft version of the current computer environment.
--
-- For example, `ComputerCraft 1.93.0 (Minecraft 1.15.2)`.
-- @usage _HOST
_HOST = _HOST
--[[- The default computer settings as defined in the ComputerCraft
@ -51,5 +120,6 @@ An example value to disable autocompletion:
shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false
@usage _CC_DEFAULT_SETTINGS
]]
_CC_DEFAULT_SETTINGS = _CC_DEFAULT_SETTINGS

View File

@ -85,6 +85,9 @@ the `terminate` event yourself - the program will not stop execution when
function pullEventRaw(filter) end
--- Pauses execution for the specified number of seconds, alias of @{_G.sleep}.
--
-- @tparam number time The number of seconds to sleep for, rounded up to the
-- nearest multiple of 0.05.
function sleep(time) end
--- Get the current CraftOS version (for example, `CraftOS 1.8`).
@ -93,6 +96,7 @@ function sleep(time) end
-- should return `CraftOS 1.8`.
--
-- @treturn string The current CraftOS version.
-- @usage os.version()
function version() end
--[[- Run the program at the given path with the specified environment and
@ -113,7 +117,7 @@ such as @{loadfile}.
@treturn boolean Whether or not the program ran successfully.
@usage Run the default shell from within your program:
os.run({}, "/rom/programs/shell")
os.run({}, "/rom/programs/shell.lua")
@see shell.run
@see loadfile

View File

@ -1,14 +0,0 @@
/* Pretty tables, mostly inherited from table.definition-list */
table.pretty-table {
border-collapse: collapse;
width: 100%;
}
table.pretty-table td, table.pretty-table th {
border: 1px solid #cccccc;
padding: 2px 4px;
}
table.pretty-table th {
background-color: #f0f0f0;
}

View File

@ -1,5 +1,5 @@
# Mod properties
mod_version=1.94.0
mod_version=1.95.0
# Minecraft properties (update mods.toml when changing)
mc_version=1.16.4

View File

@ -2,26 +2,29 @@
(sources
/doc/stub/
/doc/javadoc/
/build/docs/luaJavadoc/
/src/main/resources/*/computercraft/lua/bios.lua
/src/main/resources/*/computercraft/lua/rom/
/src/test/resources/test-rom)
/src/test/resources/test-rom
/src/web/mount)
(doc
(title "CC: Tweaked")
(destination doc/out)
(destination build/docs/lua)
(logo src/main/resources/pack.png)
(index doc/index.md)
(styles doc/styles.css)
(styles src/web/styles.css)
(scripts build/rollup/index.js)
(source-link https://github.com/SquidDev-CC/CC-Tweaked/blob/${commit}/${path}#L${line})
(module-kinds
(peripheral Peripherals))
(peripheral Peripherals)
(generic_peripheral "Generic Peripherals"))
(library-path
/doc/stub/
/doc/javadoc/
/build/docs/luaJavadoc/
/src/main/resources/*/computercraft/lua/rom/apis
/src/main/resources/*/computercraft/lua/rom/apis/command
@ -72,7 +75,7 @@
(lint (allow-toplevel-global true)))
;; Silence some variable warnings in documentation stubs.
(at (/doc/stub/ /doc/javadoc/)
(at (/doc/stub/ /build/docs/luaJavadoc/)
(linters -var:unused-global)
(lint (allow-toplevel-global true)))
@ -84,26 +87,19 @@
/doc/stub/turtle.lua
/doc/stub/global.lua
; Java generated APIs
/doc/javadoc/turtle.lua
/build/docs/luaJavadoc/turtle.lua
; Peripherals
/doc/javadoc/drive.lua
/doc/javadoc/speaker.lua
/doc/javadoc/printer.lua
/build/docs/luaJavadoc/drive.lua
/build/docs/luaJavadoc/speaker.lua
/build/docs/luaJavadoc/printer.lua
; Generic peripherals
/build/docs/luaJavadoc/fluid_storage.lua
; Lua APIs
/src/main/resources/*/computercraft/lua/rom/apis/io.lua
/src/main/resources/*/computercraft/lua/rom/apis/window.lua)
(linters -doc:undocumented -doc:undocumented-arg -doc:undocumented-return))
;; These currently rely on unknown references.
(at
(/src/main/resources/*/computercraft/lua/rom/apis/textutils.lua
/src/main/resources/*/computercraft/lua/rom/modules/main/cc/completion.lua
/src/main/resources/*/computercraft/lua/rom/modules/main/cc/shell/completion.lua
/src/main/resources/*/computercraft/lua/rom/programs/shell.lua
/doc/stub/fs.lua)
(linters -doc:unresolved-reference))
;; Suppress warnings for the BIOS using its own deprecated members for now.
(at /src/main/resources/*/computercraft/lua/bios.lua
(linters -var:deprecated))
@ -116,3 +112,5 @@
(globals
:max sleep write
cct_test describe expect howlci fail it pending stub)))
(at /src/web/mount/expr_template.lua (lint (globals :max __expr__)))

172
package-lock.json generated Normal file
View File

@ -0,0 +1,172 @@
{
"name": "tweaked.cc",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"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==",
"dev": true,
"requires": {
"@rollup/pluginutils": "^3.1.0",
"resolve": "^1.17.0"
}
},
"@rollup/pluginutils": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz",
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"estree-walker": "^1.0.1",
"picomatch": "^2.2.2"
}
},
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"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==",
"dev": true
},
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true
},
"estree-walker": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz",
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==",
"dev": true
},
"fsevents": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
"integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
"dev": true,
"optional": true
},
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
"dev": true
},
"has": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
"dev": true,
"requires": {
"function-bind": "^1.1.1"
}
},
"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==",
"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==",
"dev": true
},
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true
},
"preact": {
"version": "10.5.5",
"resolved": "https://registry.npmjs.org/preact/-/preact-10.5.5.tgz",
"integrity": "sha512-5ONLNH1SXMzzbQoExZX4TELemNt+TEDb622xXFNfZngjjM9qtrzseJt+EfiUu4TZ6EJ95X5sE1ES4yqHFSIdhg=="
},
"requirejs": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
"integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==",
"dev": true
},
"resolve": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.18.1.tgz",
"integrity": "sha512-lDfCPaMKfOJXjy0dPayzPdF1phampNWr3qFCjAu+rw/qbQmr5jWH5xN2hwh9QKfw9E5v4hwV7A+jrCmL8yjjqA==",
"dev": true,
"requires": {
"is-core-module": "^2.0.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==",
"dev": true,
"requires": {
"fsevents": "~2.1.2"
}
},
"source-map": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==",
"dev": true
},
"source-map-support": {
"version": "0.5.19",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
"integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
}
}
},
"terser": {
"version": "5.3.8",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.3.8.tgz",
"integrity": "sha512-zVotuHoIfnYjtlurOouTazciEfL7V38QMAOhGqpXDEg6yT13cF4+fEP9b0rrCEQTn+tT46uxgFsTZzhygk+CzQ==",
"dev": true,
"requires": {
"commander": "^2.20.0",
"source-map": "~0.7.2",
"source-map-support": "~0.5.19"
}
},
"tslib": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
},
"typescript": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.5.tgz",
"integrity": "sha512-ywmr/VrTVCmNTJ6iV2LwIrfG1P+lv6luD8sUJs+2eI9NLGigaN+nUQc13iHqisq7bra9lnmUSYqbJvegraBOPQ==",
"dev": true
}
}
}

18
package.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "tweaked.cc",
"version": "1.0.0",
"description": "Website additions for tweaked.cc",
"author": "SquidDev",
"license": "BSD-3-Clause",
"dependencies": {
"preact": "^10.5.5",
"tslib": "^2.0.3"
},
"devDependencies": {
"@rollup/plugin-typescript": "^6.1.0",
"requirejs": "^2.3.6",
"rollup": "^2.33.1",
"terser": "^5.3.8",
"typescript": "^4.0.5"
}
}

55
rollup.config.js Normal file
View File

@ -0,0 +1,55 @@
import { readFileSync, promises as fs } from "fs";
import path from "path";
import typescript from "@rollup/plugin-typescript";
const input = "src/web";
const requirejs = readFileSync("node_modules/requirejs/require.js");
export default {
input: [`${input}/index.tsx`],
output: {
file: "build/rollup/index.js",
// We bundle requirejs (and config) into the header. It's rather gross
// but also works reasonably well.
banner: `${requirejs}\nrequire.config({ paths: { copycat: "https://copy-cat.squiddev.cc" } });`,
format: "amd",
preferConst: true,
amd: {
define: "require",
}
},
context: "window",
external: ["copycat/embed"],
plugins: [
typescript(),
{
name: "cc-tweaked",
async options(options) {
// Generate .d.ts files for all /mount files. This is the worst way to do it,
// but we need to run before the TS pass.
const template = "declare const contents : string;\nexport default contents;\n";
const files = await fs.readdir(`${input}/mount`);
await Promise.all(files
.filter(x => path.extname(x) !== ".ts")
.map(async file => {
const path = `${input}/mount/${file}.d.ts`;
const contents = await fs.readFile(path, { encoding: "utf-8" }).catch(() => "");
if (contents !== template) await fs.writeFile(path, template);
})
);
return options;
},
async transform(code, file) {
// Allow loading files in /mount.
const ext = path.extname(file);
return ext != '.tsx' && ext != '.ts' && path.dirname(file) === path.resolve(`${input}/mount`)
? `export default ${JSON.stringify(code)};\n`
: null;
},
}
],
};

View File

@ -0,0 +1,49 @@
{
"variants": {
"facing=north,state=off": {
"model": "computercraft:block/computer_advanced_off"
},
"facing=south,state=off": {
"model": "computercraft:block/computer_advanced_off",
"y": 180
},
"facing=west,state=off": {
"model": "computercraft:block/computer_advanced_off",
"y": 270
},
"facing=east,state=off": {
"model": "computercraft:block/computer_advanced_off",
"y": 90
},
"facing=north,state=on": {
"model": "computercraft:block/computer_advanced_on"
},
"facing=south,state=on": {
"model": "computercraft:block/computer_advanced_on",
"y": 180
},
"facing=west,state=on": {
"model": "computercraft:block/computer_advanced_on",
"y": 270
},
"facing=east,state=on": {
"model": "computercraft:block/computer_advanced_on",
"y": 90
},
"facing=north,state=blinking": {
"model": "computercraft:block/computer_advanced_blinking"
},
"facing=south,state=blinking": {
"model": "computercraft:block/computer_advanced_blinking",
"y": 180
},
"facing=west,state=blinking": {
"model": "computercraft:block/computer_advanced_blinking",
"y": 270
},
"facing=east,state=blinking": {
"model": "computercraft:block/computer_advanced_blinking",
"y": 90
}
}
}

View File

@ -0,0 +1,49 @@
{
"variants": {
"facing=north,state=off": {
"model": "computercraft:block/computer_command_off"
},
"facing=south,state=off": {
"model": "computercraft:block/computer_command_off",
"y": 180
},
"facing=west,state=off": {
"model": "computercraft:block/computer_command_off",
"y": 270
},
"facing=east,state=off": {
"model": "computercraft:block/computer_command_off",
"y": 90
},
"facing=north,state=on": {
"model": "computercraft:block/computer_command_on"
},
"facing=south,state=on": {
"model": "computercraft:block/computer_command_on",
"y": 180
},
"facing=west,state=on": {
"model": "computercraft:block/computer_command_on",
"y": 270
},
"facing=east,state=on": {
"model": "computercraft:block/computer_command_on",
"y": 90
},
"facing=north,state=blinking": {
"model": "computercraft:block/computer_command_blinking"
},
"facing=south,state=blinking": {
"model": "computercraft:block/computer_command_blinking",
"y": 180
},
"facing=west,state=blinking": {
"model": "computercraft:block/computer_command_blinking",
"y": 270
},
"facing=east,state=blinking": {
"model": "computercraft:block/computer_command_blinking",
"y": 90
}
}
}

View File

@ -0,0 +1,49 @@
{
"variants": {
"facing=north,state=off": {
"model": "computercraft:block/computer_normal_off"
},
"facing=south,state=off": {
"model": "computercraft:block/computer_normal_off",
"y": 180
},
"facing=west,state=off": {
"model": "computercraft:block/computer_normal_off",
"y": 270
},
"facing=east,state=off": {
"model": "computercraft:block/computer_normal_off",
"y": 90
},
"facing=north,state=on": {
"model": "computercraft:block/computer_normal_on"
},
"facing=south,state=on": {
"model": "computercraft:block/computer_normal_on",
"y": 180
},
"facing=west,state=on": {
"model": "computercraft:block/computer_normal_on",
"y": 270
},
"facing=east,state=on": {
"model": "computercraft:block/computer_normal_on",
"y": 90
},
"facing=north,state=blinking": {
"model": "computercraft:block/computer_normal_blinking"
},
"facing=south,state=blinking": {
"model": "computercraft:block/computer_normal_blinking",
"y": 180
},
"facing=west,state=blinking": {
"model": "computercraft:block/computer_normal_blinking",
"y": 270
},
"facing=east,state=blinking": {
"model": "computercraft:block/computer_normal_blinking",
"y": 90
}
}
}

View File

@ -0,0 +1,852 @@
{
"variants": {
"facing=north,orientation=down,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 90
},
"facing=south,orientation=down,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 270
},
"facing=south,orientation=up,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=none": {
"model": "computercraft:block/monitor_advanced",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=none": {
"model": "computercraft:block/monitor_advanced"
},
"facing=south,orientation=north,state=none": {
"model": "computercraft:block/monitor_advanced",
"y": 180
},
"facing=west,orientation=north,state=none": {
"model": "computercraft:block/monitor_advanced",
"y": 270
},
"facing=east,orientation=north,state=none": {
"model": "computercraft:block/monitor_advanced",
"y": 90
},
"facing=north,orientation=down,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 90
},
"facing=south,orientation=down,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 270
},
"facing=south,orientation=up,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=l": {
"model": "computercraft:block/monitor_advanced_l"
},
"facing=south,orientation=north,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"y": 180
},
"facing=west,orientation=north,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"y": 270
},
"facing=east,orientation=north,state=l": {
"model": "computercraft:block/monitor_advanced_l",
"y": 90
},
"facing=north,orientation=down,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 90
},
"facing=south,orientation=down,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 270
},
"facing=south,orientation=up,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=r": {
"model": "computercraft:block/monitor_advanced_r"
},
"facing=south,orientation=north,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"y": 180
},
"facing=west,orientation=north,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"y": 270
},
"facing=east,orientation=north,state=r": {
"model": "computercraft:block/monitor_advanced_r",
"y": 90
},
"facing=north,orientation=down,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 90
},
"facing=south,orientation=down,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 270
},
"facing=south,orientation=up,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lr": {
"model": "computercraft:block/monitor_advanced_lr"
},
"facing=south,orientation=north,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"y": 180
},
"facing=west,orientation=north,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"y": 270
},
"facing=east,orientation=north,state=lr": {
"model": "computercraft:block/monitor_advanced_lr",
"y": 90
},
"facing=north,orientation=down,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 90
},
"facing=south,orientation=down,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 270
},
"facing=south,orientation=up,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=u": {
"model": "computercraft:block/monitor_advanced_u"
},
"facing=south,orientation=north,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"y": 180
},
"facing=west,orientation=north,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"y": 270
},
"facing=east,orientation=north,state=u": {
"model": "computercraft:block/monitor_advanced_u",
"y": 90
},
"facing=north,orientation=down,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 90
},
"facing=south,orientation=down,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 270
},
"facing=south,orientation=up,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=d": {
"model": "computercraft:block/monitor_advanced_d"
},
"facing=south,orientation=north,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"y": 180
},
"facing=west,orientation=north,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"y": 270
},
"facing=east,orientation=north,state=d": {
"model": "computercraft:block/monitor_advanced_d",
"y": 90
},
"facing=north,orientation=down,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 90
},
"facing=south,orientation=down,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 270
},
"facing=south,orientation=up,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=ud": {
"model": "computercraft:block/monitor_advanced_ud"
},
"facing=south,orientation=north,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"y": 180
},
"facing=west,orientation=north,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"y": 270
},
"facing=east,orientation=north,state=ud": {
"model": "computercraft:block/monitor_advanced_ud",
"y": 90
},
"facing=north,orientation=down,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 90
},
"facing=south,orientation=down,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 270
},
"facing=south,orientation=up,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=rd": {
"model": "computercraft:block/monitor_advanced_rd"
},
"facing=south,orientation=north,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"y": 180
},
"facing=west,orientation=north,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"y": 270
},
"facing=east,orientation=north,state=rd": {
"model": "computercraft:block/monitor_advanced_rd",
"y": 90
},
"facing=north,orientation=down,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 90
},
"facing=south,orientation=down,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 270
},
"facing=south,orientation=up,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=ld": {
"model": "computercraft:block/monitor_advanced_ld"
},
"facing=south,orientation=north,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"y": 180
},
"facing=west,orientation=north,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"y": 270
},
"facing=east,orientation=north,state=ld": {
"model": "computercraft:block/monitor_advanced_ld",
"y": 90
},
"facing=north,orientation=down,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 90
},
"facing=south,orientation=down,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 270
},
"facing=south,orientation=up,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=ru": {
"model": "computercraft:block/monitor_advanced_ru"
},
"facing=south,orientation=north,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"y": 180
},
"facing=west,orientation=north,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"y": 270
},
"facing=east,orientation=north,state=ru": {
"model": "computercraft:block/monitor_advanced_ru",
"y": 90
},
"facing=north,orientation=down,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 90
},
"facing=south,orientation=down,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 270
},
"facing=south,orientation=up,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lu": {
"model": "computercraft:block/monitor_advanced_lu"
},
"facing=south,orientation=north,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"y": 180
},
"facing=west,orientation=north,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"y": 270
},
"facing=east,orientation=north,state=lu": {
"model": "computercraft:block/monitor_advanced_lu",
"y": 90
},
"facing=north,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 90
},
"facing=south,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 270
},
"facing=south,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd"
},
"facing=south,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"y": 180
},
"facing=west,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"y": 270
},
"facing=east,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_advanced_lrd",
"y": 90
},
"facing=north,orientation=down,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 90
},
"facing=south,orientation=down,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 270
},
"facing=south,orientation=up,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=rud": {
"model": "computercraft:block/monitor_advanced_rud"
},
"facing=south,orientation=north,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"y": 180
},
"facing=west,orientation=north,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"y": 270
},
"facing=east,orientation=north,state=rud": {
"model": "computercraft:block/monitor_advanced_rud",
"y": 90
},
"facing=north,orientation=down,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 90
},
"facing=south,orientation=down,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 270
},
"facing=south,orientation=up,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lud": {
"model": "computercraft:block/monitor_advanced_lud"
},
"facing=south,orientation=north,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"y": 180
},
"facing=west,orientation=north,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"y": 270
},
"facing=east,orientation=north,state=lud": {
"model": "computercraft:block/monitor_advanced_lud",
"y": 90
},
"facing=north,orientation=down,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 90
},
"facing=south,orientation=down,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 270
},
"facing=south,orientation=up,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lru": {
"model": "computercraft:block/monitor_advanced_lru"
},
"facing=south,orientation=north,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"y": 180
},
"facing=west,orientation=north,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"y": 270
},
"facing=east,orientation=north,state=lru": {
"model": "computercraft:block/monitor_advanced_lru",
"y": 90
},
"facing=north,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 90
},
"facing=south,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 270
},
"facing=south,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud"
},
"facing=south,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"y": 180
},
"facing=west,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"y": 270
},
"facing=east,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_advanced_lrud",
"y": 90
}
}
}

View File

@ -0,0 +1,852 @@
{
"variants": {
"facing=north,orientation=down,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 90
},
"facing=south,orientation=down,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 270
},
"facing=south,orientation=up,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=none": {
"model": "computercraft:block/monitor_normal",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=none": {
"model": "computercraft:block/monitor_normal"
},
"facing=south,orientation=north,state=none": {
"model": "computercraft:block/monitor_normal",
"y": 180
},
"facing=west,orientation=north,state=none": {
"model": "computercraft:block/monitor_normal",
"y": 270
},
"facing=east,orientation=north,state=none": {
"model": "computercraft:block/monitor_normal",
"y": 90
},
"facing=north,orientation=down,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 90
},
"facing=south,orientation=down,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 270
},
"facing=south,orientation=up,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=l": {
"model": "computercraft:block/monitor_normal_l",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=l": {
"model": "computercraft:block/monitor_normal_l"
},
"facing=south,orientation=north,state=l": {
"model": "computercraft:block/monitor_normal_l",
"y": 180
},
"facing=west,orientation=north,state=l": {
"model": "computercraft:block/monitor_normal_l",
"y": 270
},
"facing=east,orientation=north,state=l": {
"model": "computercraft:block/monitor_normal_l",
"y": 90
},
"facing=north,orientation=down,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 90
},
"facing=south,orientation=down,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 270
},
"facing=south,orientation=up,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=r": {
"model": "computercraft:block/monitor_normal_r",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=r": {
"model": "computercraft:block/monitor_normal_r"
},
"facing=south,orientation=north,state=r": {
"model": "computercraft:block/monitor_normal_r",
"y": 180
},
"facing=west,orientation=north,state=r": {
"model": "computercraft:block/monitor_normal_r",
"y": 270
},
"facing=east,orientation=north,state=r": {
"model": "computercraft:block/monitor_normal_r",
"y": 90
},
"facing=north,orientation=down,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 90
},
"facing=south,orientation=down,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 270
},
"facing=south,orientation=up,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lr": {
"model": "computercraft:block/monitor_normal_lr"
},
"facing=south,orientation=north,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"y": 180
},
"facing=west,orientation=north,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"y": 270
},
"facing=east,orientation=north,state=lr": {
"model": "computercraft:block/monitor_normal_lr",
"y": 90
},
"facing=north,orientation=down,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 90
},
"facing=south,orientation=down,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 270
},
"facing=south,orientation=up,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=u": {
"model": "computercraft:block/monitor_normal_u",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=u": {
"model": "computercraft:block/monitor_normal_u"
},
"facing=south,orientation=north,state=u": {
"model": "computercraft:block/monitor_normal_u",
"y": 180
},
"facing=west,orientation=north,state=u": {
"model": "computercraft:block/monitor_normal_u",
"y": 270
},
"facing=east,orientation=north,state=u": {
"model": "computercraft:block/monitor_normal_u",
"y": 90
},
"facing=north,orientation=down,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 90
},
"facing=south,orientation=down,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 270
},
"facing=south,orientation=up,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=d": {
"model": "computercraft:block/monitor_normal_d",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=d": {
"model": "computercraft:block/monitor_normal_d"
},
"facing=south,orientation=north,state=d": {
"model": "computercraft:block/monitor_normal_d",
"y": 180
},
"facing=west,orientation=north,state=d": {
"model": "computercraft:block/monitor_normal_d",
"y": 270
},
"facing=east,orientation=north,state=d": {
"model": "computercraft:block/monitor_normal_d",
"y": 90
},
"facing=north,orientation=down,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 90
},
"facing=south,orientation=down,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 270
},
"facing=south,orientation=up,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=ud": {
"model": "computercraft:block/monitor_normal_ud"
},
"facing=south,orientation=north,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"y": 180
},
"facing=west,orientation=north,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"y": 270
},
"facing=east,orientation=north,state=ud": {
"model": "computercraft:block/monitor_normal_ud",
"y": 90
},
"facing=north,orientation=down,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 90
},
"facing=south,orientation=down,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 270
},
"facing=south,orientation=up,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=rd": {
"model": "computercraft:block/monitor_normal_rd"
},
"facing=south,orientation=north,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"y": 180
},
"facing=west,orientation=north,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"y": 270
},
"facing=east,orientation=north,state=rd": {
"model": "computercraft:block/monitor_normal_rd",
"y": 90
},
"facing=north,orientation=down,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 90
},
"facing=south,orientation=down,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 270
},
"facing=south,orientation=up,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=ld": {
"model": "computercraft:block/monitor_normal_ld"
},
"facing=south,orientation=north,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"y": 180
},
"facing=west,orientation=north,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"y": 270
},
"facing=east,orientation=north,state=ld": {
"model": "computercraft:block/monitor_normal_ld",
"y": 90
},
"facing=north,orientation=down,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 90
},
"facing=south,orientation=down,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 270
},
"facing=south,orientation=up,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=ru": {
"model": "computercraft:block/monitor_normal_ru"
},
"facing=south,orientation=north,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"y": 180
},
"facing=west,orientation=north,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"y": 270
},
"facing=east,orientation=north,state=ru": {
"model": "computercraft:block/monitor_normal_ru",
"y": 90
},
"facing=north,orientation=down,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 90
},
"facing=south,orientation=down,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 270
},
"facing=south,orientation=up,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lu": {
"model": "computercraft:block/monitor_normal_lu"
},
"facing=south,orientation=north,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"y": 180
},
"facing=west,orientation=north,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"y": 270
},
"facing=east,orientation=north,state=lu": {
"model": "computercraft:block/monitor_normal_lu",
"y": 90
},
"facing=north,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 90
},
"facing=south,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 270
},
"facing=south,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd"
},
"facing=south,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"y": 180
},
"facing=west,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"y": 270
},
"facing=east,orientation=north,state=lrd": {
"model": "computercraft:block/monitor_normal_lrd",
"y": 90
},
"facing=north,orientation=down,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 90
},
"facing=south,orientation=down,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 270
},
"facing=south,orientation=up,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=rud": {
"model": "computercraft:block/monitor_normal_rud"
},
"facing=south,orientation=north,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"y": 180
},
"facing=west,orientation=north,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"y": 270
},
"facing=east,orientation=north,state=rud": {
"model": "computercraft:block/monitor_normal_rud",
"y": 90
},
"facing=north,orientation=down,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 90
},
"facing=south,orientation=down,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 270
},
"facing=south,orientation=up,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lud": {
"model": "computercraft:block/monitor_normal_lud"
},
"facing=south,orientation=north,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"y": 180
},
"facing=west,orientation=north,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"y": 270
},
"facing=east,orientation=north,state=lud": {
"model": "computercraft:block/monitor_normal_lud",
"y": 90
},
"facing=north,orientation=down,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 90
},
"facing=south,orientation=down,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 270
},
"facing=south,orientation=up,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lru": {
"model": "computercraft:block/monitor_normal_lru"
},
"facing=south,orientation=north,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"y": 180
},
"facing=west,orientation=north,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"y": 270
},
"facing=east,orientation=north,state=lru": {
"model": "computercraft:block/monitor_normal_lru",
"y": 90
},
"facing=north,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 90
},
"facing=south,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 90,
"y": 180
},
"facing=west,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 90,
"y": 270
},
"facing=east,orientation=down,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 90,
"y": 90
},
"facing=north,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 270
},
"facing=south,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 270,
"y": 180
},
"facing=west,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 270,
"y": 270
},
"facing=east,orientation=up,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"x": 270,
"y": 90
},
"facing=north,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud"
},
"facing=south,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"y": 180
},
"facing=west,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"y": 270
},
"facing=east,orientation=north,state=lrud": {
"model": "computercraft:block/monitor_normal_lrud",
"y": 90
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_16",
"side": "computercraft:block/monitor_advanced_4",
"top": "computercraft:block/monitor_advanced_0",
"back": "computercraft:block/monitor_advanced_32"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_20",
"side": "computercraft:block/monitor_advanced_7",
"top": "computercraft:block/monitor_advanced_0",
"back": "computercraft:block/monitor_advanced_36"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_19",
"side": "computercraft:block/monitor_advanced_4",
"top": "computercraft:block/monitor_advanced_1",
"back": "computercraft:block/monitor_advanced_33"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_31",
"side": "computercraft:block/monitor_advanced_7",
"top": "computercraft:block/monitor_advanced_1",
"back": "computercraft:block/monitor_advanced_45"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_18",
"side": "computercraft:block/monitor_advanced_4",
"top": "computercraft:block/monitor_advanced_2",
"back": "computercraft:block/monitor_advanced_34"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_30",
"side": "computercraft:block/monitor_advanced_7",
"top": "computercraft:block/monitor_advanced_2",
"back": "computercraft:block/monitor_advanced_46"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_24",
"side": "computercraft:block/monitor_advanced_5",
"top": "computercraft:block/monitor_advanced_2",
"back": "computercraft:block/monitor_advanced_40"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_27",
"side": "computercraft:block/monitor_advanced_6",
"top": "computercraft:block/monitor_advanced_2",
"back": "computercraft:block/monitor_advanced_43"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_25",
"side": "computercraft:block/monitor_advanced_5",
"top": "computercraft:block/monitor_advanced_1",
"back": "computercraft:block/monitor_advanced_39"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_28",
"side": "computercraft:block/monitor_advanced_6",
"top": "computercraft:block/monitor_advanced_1",
"back": "computercraft:block/monitor_advanced_42"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_17",
"side": "computercraft:block/monitor_advanced_4",
"top": "computercraft:block/monitor_advanced_3",
"back": "computercraft:block/monitor_advanced_35"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_29",
"side": "computercraft:block/monitor_advanced_7",
"top": "computercraft:block/monitor_advanced_3",
"back": "computercraft:block/monitor_advanced_47"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_23",
"side": "computercraft:block/monitor_advanced_5",
"top": "computercraft:block/monitor_advanced_3",
"back": "computercraft:block/monitor_advanced_41"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_26",
"side": "computercraft:block/monitor_advanced_6",
"top": "computercraft:block/monitor_advanced_3",
"back": "computercraft:block/monitor_advanced_44"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_22",
"side": "computercraft:block/monitor_advanced_5",
"top": "computercraft:block/monitor_advanced_0",
"back": "computercraft:block/monitor_advanced_38"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_advanced_21",
"side": "computercraft:block/monitor_advanced_6",
"top": "computercraft:block/monitor_advanced_0",
"back": "computercraft:block/monitor_advanced_37"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_16",
"side": "computercraft:block/monitor_normal_4",
"top": "computercraft:block/monitor_normal_0",
"back": "computercraft:block/monitor_normal_32"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_20",
"side": "computercraft:block/monitor_normal_7",
"top": "computercraft:block/monitor_normal_0",
"back": "computercraft:block/monitor_normal_36"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_19",
"side": "computercraft:block/monitor_normal_4",
"top": "computercraft:block/monitor_normal_1",
"back": "computercraft:block/monitor_normal_33"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_31",
"side": "computercraft:block/monitor_normal_7",
"top": "computercraft:block/monitor_normal_1",
"back": "computercraft:block/monitor_normal_45"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_18",
"side": "computercraft:block/monitor_normal_4",
"top": "computercraft:block/monitor_normal_2",
"back": "computercraft:block/monitor_normal_34"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_30",
"side": "computercraft:block/monitor_normal_7",
"top": "computercraft:block/monitor_normal_2",
"back": "computercraft:block/monitor_normal_46"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_24",
"side": "computercraft:block/monitor_normal_5",
"top": "computercraft:block/monitor_normal_2",
"back": "computercraft:block/monitor_normal_40"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_27",
"side": "computercraft:block/monitor_normal_6",
"top": "computercraft:block/monitor_normal_2",
"back": "computercraft:block/monitor_normal_43"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_25",
"side": "computercraft:block/monitor_normal_5",
"top": "computercraft:block/monitor_normal_1",
"back": "computercraft:block/monitor_normal_39"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_28",
"side": "computercraft:block/monitor_normal_6",
"top": "computercraft:block/monitor_normal_1",
"back": "computercraft:block/monitor_normal_42"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_17",
"side": "computercraft:block/monitor_normal_4",
"top": "computercraft:block/monitor_normal_3",
"back": "computercraft:block/monitor_normal_35"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_29",
"side": "computercraft:block/monitor_normal_7",
"top": "computercraft:block/monitor_normal_3",
"back": "computercraft:block/monitor_normal_47"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_23",
"side": "computercraft:block/monitor_normal_5",
"top": "computercraft:block/monitor_normal_3",
"back": "computercraft:block/monitor_normal_41"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_26",
"side": "computercraft:block/monitor_normal_6",
"top": "computercraft:block/monitor_normal_3",
"back": "computercraft:block/monitor_normal_44"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_22",
"side": "computercraft:block/monitor_normal_5",
"top": "computercraft:block/monitor_normal_0",
"back": "computercraft:block/monitor_normal_38"
}
}

View File

@ -0,0 +1,9 @@
{
"parent": "computercraft:block/monitor_base",
"textures": {
"front": "computercraft:block/monitor_normal_21",
"side": "computercraft:block/monitor_normal_6",
"top": "computercraft:block/monitor_normal_0",
"back": "computercraft:block/monitor_normal_37"
}
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_advanced/minecraft/crafting_table"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
},
{
"item": "minecraft:crafting_table"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_advanced/minecraft/crafting_table"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_advanced/minecraft/diamond_axe"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
},
{
"item": "minecraft:diamond_axe"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_advanced/minecraft/diamond_axe"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_advanced/minecraft/diamond_hoe"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
},
{
"item": "minecraft:diamond_hoe"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_advanced/minecraft/diamond_hoe"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_advanced/minecraft/diamond_pickaxe"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
},
{
"item": "minecraft:diamond_pickaxe"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_advanced/minecraft/diamond_pickaxe"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_advanced/minecraft/diamond_shovel"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
},
{
"item": "minecraft:diamond_shovel"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_advanced/minecraft/diamond_shovel"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_advanced/minecraft/diamond_sword"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_advanced"
},
{
"item": "minecraft:diamond_sword"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_advanced/minecraft/diamond_sword"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_normal/minecraft/crafting_table"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
},
{
"item": "minecraft:crafting_table"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_normal/minecraft/crafting_table"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_normal/minecraft/diamond_axe"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
},
{
"item": "minecraft:diamond_axe"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_normal/minecraft/diamond_axe"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_normal/minecraft/diamond_hoe"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
},
{
"item": "minecraft:diamond_hoe"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_normal/minecraft/diamond_hoe"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_normal/minecraft/diamond_pickaxe"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
},
{
"item": "minecraft:diamond_pickaxe"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_normal/minecraft/diamond_pickaxe"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_normal/minecraft/diamond_shovel"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
},
{
"item": "minecraft:diamond_shovel"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_normal/minecraft/diamond_shovel"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,35 +0,0 @@
{
"parent": "minecraft:recipes/root",
"rewards": {
"recipes": [
"computercraft:pocket_normal/minecraft/diamond_sword"
]
},
"criteria": {
"has_items": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"item": "computercraft:pocket_computer_normal"
},
{
"item": "minecraft:diamond_sword"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "computercraft:pocket_normal/minecraft/diamond_sword"
}
}
},
"requirements": [
[
"has_items",
"has_the_recipe"
]
]
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_advanced",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_advanced"
},
"P": {
"item": "minecraft:crafting_table"
}
},
"result": {
"item": "computercraft:pocket_computer_advanced"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_advanced",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_advanced"
},
"P": {
"item": "minecraft:diamond_axe"
}
},
"result": {
"item": "computercraft:pocket_computer_advanced"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_advanced",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_advanced"
},
"P": {
"item": "minecraft:diamond_hoe"
}
},
"result": {
"item": "computercraft:pocket_computer_advanced"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_advanced",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_advanced"
},
"P": {
"item": "minecraft:diamond_pickaxe"
}
},
"result": {
"item": "computercraft:pocket_computer_advanced"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_advanced",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_advanced"
},
"P": {
"item": "minecraft:diamond_shovel"
}
},
"result": {
"item": "computercraft:pocket_computer_advanced"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_advanced",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_advanced"
},
"P": {
"item": "minecraft:diamond_sword"
}
},
"result": {
"item": "computercraft:pocket_computer_advanced"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_normal",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_normal"
},
"P": {
"item": "minecraft:crafting_table"
}
},
"result": {
"item": "computercraft:pocket_computer_normal"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_normal",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_normal"
},
"P": {
"item": "minecraft:diamond_axe"
}
},
"result": {
"item": "computercraft:pocket_computer_normal"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_normal",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_normal"
},
"P": {
"item": "minecraft:diamond_hoe"
}
},
"result": {
"item": "computercraft:pocket_computer_normal"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_normal",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_normal"
},
"P": {
"item": "minecraft:diamond_pickaxe"
}
},
"result": {
"item": "computercraft:pocket_computer_normal"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_normal",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_normal"
},
"P": {
"item": "minecraft:diamond_shovel"
}
},
"result": {
"item": "computercraft:pocket_computer_normal"
}
}

View File

@ -1,19 +0,0 @@
{
"type": "computercraft:impostor_shaped",
"group": "computercraft:pocket_normal",
"pattern": [
"#",
"P"
],
"key": {
"#": {
"item": "computercraft:pocket_computer_normal"
},
"P": {
"item": "minecraft:diamond_sword"
}
},
"result": {
"item": "computercraft:pocket_computer_normal"
}
}

View File

@ -22,30 +22,17 @@ import net.minecraftforge.fml.common.Mod;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Mod( ComputerCraft.MOD_ID )
public final class ComputerCraft
{
public static final String MOD_ID = "computercraft";
// Configuration options
public static final String[] DEFAULT_HTTP_ALLOW = new String[] { "*" };
public static final String[] DEFAULT_HTTP_DENY = new String[] {
"127.0.0.0/8",
"0.0.0.0/8",
"10.0.0.0/8",
"172.16.0.0/12",
"192.168.0.0/16",
"fd00::/8",
};
public static int computerSpaceLimit = 1000 * 1000;
public static int floppySpaceLimit = 125 * 1000;
public static int maximumFilesOpen = 128;
@ -61,14 +48,10 @@ public final class ComputerCraft
public static boolean httpEnabled = true;
public static boolean httpWebsocketEnabled = true;
public static List<AddressRule> httpRules = Collections.unmodifiableList( Stream.concat(
Stream.of( DEFAULT_HTTP_DENY )
.map( x -> AddressRule.parse( x, null, Action.DENY.toPartial() ) )
.filter( Objects::nonNull ),
Stream.of( DEFAULT_HTTP_ALLOW )
.map( x -> AddressRule.parse( x, null, Action.ALLOW.toPartial() ) )
.filter( Objects::nonNull )
).collect( Collectors.toList() ) );
public static List<AddressRule> httpRules = Collections.unmodifiableList( Arrays.asList(
AddressRule.parse( "$private", null, Action.DENY.toPartial() ),
AddressRule.parse( "*", null, Action.ALLOW.toPartial() )
) );
public static int httpMaxRequests = 16;
public static int httpMaxWebsockets = 4;

View File

@ -0,0 +1,86 @@
/*
* This file is part of the public ComputerCraft API - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2020. 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;
import dan200.computercraft.api.pocket.IPocketUpgrade;
import dan200.computercraft.api.turtle.ITurtleUpgrade;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import javax.annotation.Nonnull;
/**
* Common functionality between {@link ITurtleUpgrade} and {@link IPocketUpgrade}.
*/
public interface IUpgradeBase
{
/**
* Gets a unique identifier representing this type of turtle upgrade. eg: "computercraft:wireless_modem"
* or "my_mod:my_upgrade".
*
* You should use a unique resource domain to ensure this upgrade is uniquely identified.
* The upgrade will fail registration if an already used ID is specified.
*
* @return The unique ID for this upgrade.
*/
@Nonnull
ResourceLocation getUpgradeID();
/**
* Return an unlocalised string to describe this type of computer in item names.
*
* Examples of built-in adjectives are "Wireless", "Mining" and "Crafty".
*
* @return The localisation key for this upgrade's adjective.
*/
@Nonnull
String getUnlocalisedAdjective();
/**
* Return an item stack representing the type of item that a computer must be crafted
* with to create a version which holds this upgrade. This item stack is also used
* to determine the upgrade given by {@code turtle.equipLeft()} or {@code pocket.equipBack()}
*
* This should be constant over a session (or at least a datapack reload). It is recommended
* that you cache the stack too, in order to prevent constructing it every time the method
* is called.
*
* @return The item stack to craft with, or {@link ItemStack#EMPTY} if it cannot be crafted.
*/
@Nonnull
ItemStack getCraftingItem();
/**
* Determine if an item is suitable for being used for this upgrade.
*
* When un-equipping an upgrade, we return {@link #getCraftingItem()} rather than
* the original stack. In order to prevent people losing items with enchantments (or
* repairing items with non-0 damage), we impose additional checks on the item.
*
* The default check requires that any non-capability NBT is exactly the same as the
* crafting item, but this may be relaxed for your upgrade.
*
* @param stack The stack to check. This is guaranteed to be non-empty and have the same item as
* {@link #getCraftingItem()}.
* @return If this stack may be used to equip this upgrade.
* @see net.minecraftforge.common.crafting.NBTIngredient#test(ItemStack) For the implementation of the default
* check.
*/
default boolean isItemSuitable( @Nonnull ItemStack stack )
{
ItemStack crafting = getCraftingItem();
// A more expanded form of ItemStack.areShareTagsEqual, but allowing an empty tag to be equal to a
// null one.
CompoundNBT shareTag = stack.getItem().getShareTag( stack );
CompoundNBT craftingShareTag = crafting.getItem().getShareTag( crafting );
if( shareTag == craftingShareTag ) return true;
if( shareTag == null ) return craftingShareTag.isEmpty();
if( craftingShareTag == null ) return shareTag.isEmpty();
return shareTag.equals( craftingShareTag );
}
}

View File

@ -6,10 +6,8 @@
package dan200.computercraft.api.pocket;
import dan200.computercraft.api.ComputerCraftAPI;
import dan200.computercraft.api.IUpgradeBase;
import dan200.computercraft.api.peripheral.IPeripheral;
import dan200.computercraft.api.turtle.ITurtleUpgrade;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import javax.annotation.Nonnull;
@ -18,49 +16,10 @@ import javax.annotation.Nullable;
/**
* Additional peripherals for pocket computers.
*
* This is similar to {@link ITurtleUpgrade}.
* @see ComputerCraftAPI#registerPocketUpgrade(IPocketUpgrade)
*/
public interface IPocketUpgrade
public interface IPocketUpgrade extends IUpgradeBase
{
/**
* Gets a unique identifier representing this type of turtle upgrade. eg: "computercraft:wireless_modem" or
* "my_mod:my_upgrade".
*
* You should use a unique resource domain to ensure this upgrade is uniquely identified. The upgrade will fail
* registration if an already used ID is specified.
*
* @return The upgrade's id.
* @see IPocketUpgrade#getUpgradeID()
* @see ComputerCraftAPI#registerPocketUpgrade(IPocketUpgrade)
*/
@Nonnull
ResourceLocation getUpgradeID();
/**
* Return an unlocalised string to describe the type of pocket computer this upgrade provides.
*
* An example of a built-in adjectives is "Wireless" - this is converted to "Wireless Pocket Computer".
*
* @return The unlocalised adjective.
* @see ITurtleUpgrade#getUnlocalisedAdjective()
*/
@Nonnull
String getUnlocalisedAdjective();
/**
* Return an item stack representing the type of item that a pocket computer must be crafted with to create a
* pocket computer which holds this upgrade. This item stack is also used to determine the upgrade given by
* {@code pocket.equip()}/{@code pocket.unequip()}.
*
* Ideally this should be constant over a session. It is recommended that you cache
* the item too, in order to prevent constructing it every time the method is called.
*
* @return The item stack used for crafting. This can be {@link ItemStack#EMPTY} if crafting is disabled.
*/
@Nonnull
ItemStack getCraftingItem();
/**
* Creates a peripheral for the pocket computer.
*

View File

@ -6,6 +6,7 @@
package dan200.computercraft.api.turtle;
import dan200.computercraft.api.ComputerCraftAPI;
import dan200.computercraft.api.IUpgradeBase;
import dan200.computercraft.api.client.TransformedModel;
import dan200.computercraft.api.peripheral.IPeripheral;
import dan200.computercraft.api.turtle.event.TurtleAttackEvent;
@ -13,7 +14,6 @@ import dan200.computercraft.api.turtle.event.TurtleBlockEvent;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
@ -28,29 +28,8 @@ import javax.annotation.Nullable;
*
* @see ComputerCraftAPI#registerTurtleUpgrade(ITurtleUpgrade)
*/
public interface ITurtleUpgrade
public interface ITurtleUpgrade extends IUpgradeBase
{
/**
* Gets a unique identifier representing this type of turtle upgrade. eg: "computercraft:wireless_modem" or "my_mod:my_upgrade".
* You should use a unique resource domain to ensure this upgrade is uniquely identified.
* The turtle will fail registration if an already used ID is specified.
*
* @return The unique ID for this upgrade.
* @see ComputerCraftAPI#registerTurtleUpgrade(ITurtleUpgrade)
*/
@Nonnull
ResourceLocation getUpgradeID();
/**
* Return an unlocalised string to describe this type of turtle in turtle item names.
*
* Examples of built-in adjectives are "Wireless", "Mining" and "Crafty".
*
* @return The localisation key for this upgrade's adjective.
*/
@Nonnull
String getUnlocalisedAdjective();
/**
* Return whether this turtle adds a tool or a peripheral to the turtle.
*
@ -60,19 +39,6 @@ public interface ITurtleUpgrade
@Nonnull
TurtleUpgradeType getType();
/**
* Return an item stack representing the type of item that a turtle must be crafted
* with to create a turtle which holds this upgrade. This item stack is also used
* to determine the upgrade given by {@code turtle.equip()}
*
* Ideally this should be constant over a session. It is recommended that you cache
* the item too, in order to prevent constructing it every time the method is called.
*
* @return The item stack to craft with, or {@link ItemStack#EMPTY} if it cannot be crafted.
*/
@Nonnull
ItemStack getCraftingItem();
/**
* Will only be called for peripheral upgrades. Creates a peripheral for a turtle being placed using this upgrade.
*

View File

@ -55,7 +55,6 @@ public final class ComputerCraftProxyClient
ClientRegistry.bindTileEntityRenderer( Registry.ModTiles.MONITOR_ADVANCED.get(), TileEntityMonitorRenderer::new );
ClientRegistry.bindTileEntityRenderer( Registry.ModTiles.TURTLE_NORMAL.get(), TileEntityTurtleRenderer::new );
ClientRegistry.bindTileEntityRenderer( Registry.ModTiles.TURTLE_ADVANCED.get(), TileEntityTurtleRenderer::new );
// TODO: ClientRegistry.bindTileEntityRenderer( TileCable.FACTORY, x -> new TileEntityCableRenderer() );
RenderingRegistry.registerEntityRenderingHandler( Registry.ModEntities.TURTLE_PLAYER.get(), TurtlePlayerRenderer::new );

View File

@ -50,7 +50,6 @@ class MonitorTextureBufferShader
RenderSystem.glUniform1i( uniformWidth, width );
RenderSystem.glUniform1i( uniformHeight, height );
// TODO: Cache this? Maybe??
PALETTE_BUFFER.rewind();
for( int i = 0; i < 16; i++ )
{

View File

@ -5,6 +5,7 @@
*/
package dan200.computercraft.core.apis;
import dan200.computercraft.api.lua.IArguments;
import dan200.computercraft.api.lua.ILuaAPI;
import dan200.computercraft.api.lua.LuaException;
import dan200.computercraft.api.lua.LuaFunction;
@ -83,17 +84,29 @@ public class FSAPI implements ILuaAPI
}
/**
* Combines two parts of a path into one full path, adding separators as
* Combines several parts of a path into one full path, adding separators as
* needed.
*
* @param pathA The first part of the path. For example, a parent directory path.
* @param pathB The second part of the path. For example, a file name.
* @param arguments The paths to combine.
* @return The new path, with separators added between parts as needed.
* @cc.tparam string path The first part of the path. For example, a parent directory path.
* @cc.tparam string ... Additional parts of the path to combine.
* @throws LuaException On argument errors.
*/
@LuaFunction
public final String combine( String pathA, String pathB )
public final String combine( IArguments arguments ) throws LuaException
{
return fileSystem.combine( pathA, pathB );
StringBuilder result = new StringBuilder();
result.append( FileSystem.sanitizePath( arguments.getString( 0 ), true ) );
for( int i = 1, n = arguments.count(); i < n; i++ )
{
String part = FileSystem.sanitizePath( arguments.getString( i ), true );
if( result.length() != 0 && !part.isEmpty() ) result.append( '/' );
result.append( part );
}
return FileSystem.sanitizePath( result.toString(), true );
}
/**

View File

@ -381,11 +381,11 @@ public class OSAPI implements ILuaAPI
* Returns the number of milliseconds since an epoch depending on the locale.
*
* * If called with {@code ingame}, returns the number of milliseconds since the
* world was created. This is the default.
* world was created. This is the default.
* * If called with {@code utc}, returns the number of milliseconds since 1
* January 1970 in the UTC timezone.
* January 1970 in the UTC timezone.
* * If called with {@code local}, returns the number of milliseconds since 1
* January 1970 in the server's local timezone.
* January 1970 in the server's local timezone.
*
* @param args The locale to get the milliseconds for. Defaults to {@code ingame} if not set.
* @return The milliseconds since the epoch depending on the selected locale.
@ -412,7 +412,7 @@ public class OSAPI implements ILuaAPI
// Get in-game epoch
synchronized( m_alarms )
{
return m_day * 86400000 + (int) (m_time * 3600000.0f);
return m_day * 86400000L + (long) (m_time * 3600000.0);
}
default:
throw new LuaException( "Unsupported operation" );

View File

@ -0,0 +1,149 @@
/*
* This file is part of ComputerCraft - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2020. Do not distribute without permission.
* Send enquiries to dratcliffe@gmail.com
*/
package dan200.computercraft.core.apis.http.options;
import com.google.common.net.InetAddresses;
import dan200.computercraft.ComputerCraft;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.regex.Pattern;
/**
* A predicate on an address. Matches against a domain and an ip address.
*
* @see AddressRule#apply(Iterable, String, InetSocketAddress) for the actual handling of this rule.
*/
interface AddressPredicate
{
default boolean matches( String domain )
{
return false;
}
default boolean matches( InetAddress socketAddress )
{
return false;
}
final class HostRange implements AddressPredicate
{
private final byte[] min;
private final byte[] max;
HostRange( byte[] min, byte[] max )
{
this.min = min;
this.max = max;
}
@Override
public boolean matches( InetAddress address )
{
byte[] entry = address.getAddress();
if( entry.length != min.length ) return false;
for( int i = 0; i < entry.length; i++ )
{
int value = 0xFF & entry[i];
if( value < (0xFF & min[i]) || value > (0xFF & max[i]) ) return false;
}
return true;
}
public static HostRange parse( String addressStr, String prefixSizeStr )
{
int prefixSize;
try
{
prefixSize = Integer.parseInt( prefixSizeStr );
}
catch( NumberFormatException e )
{
ComputerCraft.log.error(
"Malformed http whitelist/blacklist entry '{}': Cannot extract size of CIDR mask from '{}'.",
addressStr + '/' + prefixSizeStr, prefixSizeStr
);
return null;
}
InetAddress address;
try
{
address = InetAddresses.forString( addressStr );
}
catch( IllegalArgumentException e )
{
ComputerCraft.log.error(
"Malformed http whitelist/blacklist entry '{}': Cannot extract IP address from '{}'.",
addressStr + '/' + prefixSizeStr, prefixSizeStr
);
return null;
}
// Mask the bytes of the IP address.
byte[] minBytes = address.getAddress(), maxBytes = address.getAddress();
int size = prefixSize;
for( int i = 0; i < minBytes.length; i++ )
{
if( size <= 0 )
{
minBytes[i] &= 0;
maxBytes[i] |= 0xFF;
}
else if( size < 8 )
{
minBytes[i] &= 0xFF << (8 - size);
maxBytes[i] |= ~(0xFF << (8 - size));
}
size -= 8;
}
return new HostRange( minBytes, maxBytes );
}
}
final class DomainPattern implements AddressPredicate
{
private final Pattern pattern;
DomainPattern( Pattern pattern )
{
this.pattern = pattern;
}
@Override
public boolean matches( String domain )
{
return pattern.matcher( domain ).matches();
}
@Override
public boolean matches( InetAddress socketAddress )
{
return pattern.matcher( socketAddress.getHostAddress() ).matches();
}
}
final class PrivatePattern implements AddressPredicate
{
static final PrivatePattern INSTANCE = new PrivatePattern();
@Override
public boolean matches( InetAddress socketAddress )
{
return socketAddress.isAnyLocalAddress()
|| socketAddress.isLoopbackAddress()
|| socketAddress.isLinkLocalAddress()
|| socketAddress.isSiteLocalAddress();
}
}
}

View File

@ -6,10 +6,13 @@
package dan200.computercraft.core.apis.http.options;
import com.google.common.net.InetAddresses;
import dan200.computercraft.ComputerCraft;
import dan200.computercraft.core.apis.http.options.AddressPredicate.DomainPattern;
import dan200.computercraft.core.apis.http.options.AddressPredicate.HostRange;
import dan200.computercraft.core.apis.http.options.AddressPredicate.PrivatePattern;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
@ -25,45 +28,13 @@ public final class AddressRule
public static final int TIMEOUT = 30_000;
public static final int WEBSOCKET_MESSAGE = 128 * 1024;
private static final class HostRange
{
private final byte[] min;
private final byte[] max;
private HostRange( byte[] min, byte[] max )
{
this.min = min;
this.max = max;
}
public boolean contains( InetAddress address )
{
byte[] entry = address.getAddress();
if( entry.length != min.length ) return false;
for( int i = 0; i < entry.length; i++ )
{
int value = 0xFF & entry[i];
if( value < (0xFF & min[i]) || value > (0xFF & max[i]) ) return false;
}
return true;
}
}
private final HostRange ip;
private final Pattern domainPattern;
private final AddressPredicate predicate;
private final Integer port;
private final PartialOptions partial;
private AddressRule(
@Nullable HostRange ip,
@Nullable Pattern domainPattern,
@Nullable Integer port,
@Nonnull PartialOptions partial )
private AddressRule( @Nonnull AddressPredicate predicate, @Nullable Integer port, @Nonnull PartialOptions partial )
{
this.ip = ip;
this.domainPattern = domainPattern;
this.predicate = predicate;
this.partial = partial;
this.port = port;
}
@ -76,103 +47,50 @@ public final class AddressRule
{
String addressStr = filter.substring( 0, cidr );
String prefixSizeStr = filter.substring( cidr + 1 );
int prefixSize;
try
{
prefixSize = Integer.parseInt( prefixSizeStr );
}
catch( NumberFormatException e )
{
ComputerCraft.log.error(
"Malformed http whitelist/blacklist entry '{}': Cannot extract size of CIDR mask from '{}'.",
filter, prefixSizeStr
);
return null;
}
InetAddress address;
try
{
address = InetAddresses.forString( addressStr );
}
catch( IllegalArgumentException e )
{
ComputerCraft.log.error(
"Malformed http whitelist/blacklist entry '{}': Cannot extract IP address from '{}'.",
filter, prefixSizeStr
);
return null;
}
// Mask the bytes of the IP address.
byte[] minBytes = address.getAddress(), maxBytes = address.getAddress();
int size = prefixSize;
for( int i = 0; i < minBytes.length; i++ )
{
if( size <= 0 )
{
minBytes[i] &= 0;
maxBytes[i] |= 0xFF;
}
else if( size < 8 )
{
minBytes[i] &= 0xFF << (8 - size);
maxBytes[i] |= ~(0xFF << (8 - size));
}
size -= 8;
}
return new AddressRule( new HostRange( minBytes, maxBytes ), null, port, partial );
HostRange range = HostRange.parse( addressStr, prefixSizeStr );
return range == null ? null : new AddressRule( range, port, partial );
}
else if( filter.equalsIgnoreCase( "$private" ) )
{
return new AddressRule( PrivatePattern.INSTANCE, port, partial );
}
else
{
Pattern pattern = Pattern.compile( "^\\Q" + filter.replaceAll( "\\*", "\\\\E.*\\\\Q" ) + "\\E$" );
return new AddressRule( null, pattern, port, partial );
Pattern pattern = Pattern.compile( "^\\Q" + filter.replaceAll( "\\*", "\\\\E.*\\\\Q" ) + "\\E$", Pattern.CASE_INSENSITIVE );
return new AddressRule( new DomainPattern( pattern ), port, partial );
}
}
/**
* Determine whether the given address matches a series of patterns.
*
* @param domain The domain to match
* @param socketAddress The address to check.
* @param domain The domain to match
* @param port The port of the address.
* @param address The address to check.
* @param ipv4Address An ipv4 version of the address, if the original was an ipv6 address.
* @return Whether it matches any of these patterns.
*/
private boolean matches( String domain, InetSocketAddress socketAddress )
private boolean matches( String domain, int port, InetAddress address, Inet4Address ipv4Address )
{
InetAddress address = socketAddress.getAddress();
if( port != null && port != socketAddress.getPort() ) return false;
if( domainPattern != null )
{
if( domainPattern.matcher( domain ).matches() ) return true;
if( domainPattern.matcher( address.getHostName() ).matches() ) return true;
}
// Match the normal address
if( matchesAddress( address ) ) return true;
// If we're an IPv4 address in disguise then let's check that.
return address instanceof Inet6Address && InetAddresses.is6to4Address( (Inet6Address) address )
&& matchesAddress( InetAddresses.get6to4IPv4Address( (Inet6Address) address ) );
if( this.port != null && this.port != port ) return false;
return predicate.matches( domain )
|| predicate.matches( address )
|| (ipv4Address != null && predicate.matches( ipv4Address ));
}
private boolean matchesAddress( InetAddress address )
{
if( domainPattern != null && domainPattern.matcher( address.getHostAddress() ).matches() ) return true;
return ip != null && ip.contains( address );
}
public static Options apply( Iterable<? extends AddressRule> rules, String domain, InetSocketAddress address )
public static Options apply( Iterable<? extends AddressRule> rules, String domain, InetSocketAddress socketAddress )
{
PartialOptions options = null;
boolean hasMany = false;
int port = socketAddress.getPort();
InetAddress address = socketAddress.getAddress();
Inet4Address ipv4Address = address instanceof Inet6Address && InetAddresses.is6to4Address( (Inet6Address) address )
? InetAddresses.get6to4IPv4Address( (Inet6Address) address ) : null;
for( AddressRule rule : rules )
{
if( !rule.matches( domain, address ) ) continue;
if( !rule.matches( domain, port, address, ipv4Address ) ) continue;
if( options == null )
{

View File

@ -21,10 +21,8 @@ import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.*;
import java.io.Closeable;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
@ -244,9 +242,9 @@ public final class HttpRequestHandler extends SimpleChannelInboundHandler<HttpOb
try
{
return uri.resolve( new URI( URLDecoder.decode( location, "UTF-8" ) ) );
return uri.resolve( new URI( location ) );
}
catch( UnsupportedEncodingException | IllegalArgumentException | URISyntaxException e )
catch( IllegalArgumentException | URISyntaxException e )
{
return null;
}

View File

@ -98,7 +98,7 @@ public class FileSystem
mounts.remove( sanitizePath( path ) );
}
public synchronized String combine( String path, String childPath )
public String combine( String path, String childPath )
{
path = sanitizePath( path, true );
childPath = sanitizePath( childPath, true );
@ -479,7 +479,7 @@ public class FileSystem
private static final Pattern threeDotsPattern = Pattern.compile( "^\\.{3,}$" );
private static String sanitizePath( String path, boolean allowWildcards )
public static String sanitizePath( String path, boolean allowWildcards )
{
// Allow windowsy slashes
path = path.replace( '\\', '/' );

View File

@ -0,0 +1,163 @@
/*
* This file is part of ComputerCraft - http://www.computercraft.info
* Copyright Daniel Ratcliffe, 2011-2020. Do not distribute without permission.
* Send enquiries to dratcliffe@gmail.com
*/
package dan200.computercraft.data;
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.monitor.BlockMonitor;
import dan200.computercraft.shared.peripheral.monitor.MonitorEdgeState;
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 javax.annotation.Nonnull;
public class BlockModelProvider extends BlockStateProvider
{
private final ModelFile monitorBase;
private final ModelFile orientable;
public BlockModelProvider( DataGenerator generator, ExistingFileHelper existingFileHelper )
{
super( generator, ComputerCraft.MOD_ID, existingFileHelper );
monitorBase = models().getExistingFile( new ResourceLocation( ComputerCraft.MOD_ID, "block/monitor_base" ) );
orientable = models().getExistingFile( new ResourceLocation( "block/orientable" ) );
}
@Nonnull
@Override
public String getName()
{
return "Block states and models";
}
@Override
protected void registerStatesAndModels()
{
registerMonitors( Registry.ModBlocks.MONITOR_NORMAL.get() );
registerMonitors( Registry.ModBlocks.MONITOR_ADVANCED.get() );
registerComputer( Registry.ModBlocks.COMPUTER_NORMAL.get() );
registerComputer( Registry.ModBlocks.COMPUTER_ADVANCED.get() );
registerComputer( Registry.ModBlocks.COMPUTER_COMMAND.get() );
}
private void registerComputer( BlockComputer block )
{
VariantBlockStateBuilder builder = getVariantBuilder( block );
for( ComputerState state : BlockComputer.STATE.getAllowedValues() )
{
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 ) ) );
for( Direction facing : BlockComputer.FACING.getAllowedValues() )
{
builder.partialState()
.with( BlockComputer.STATE, state )
.with( BlockComputer.FACING, facing )
.addModels( new ConfiguredModel( model, 0, toYAngle( facing ), false ) );
}
}
}
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 );
VariantBlockStateBuilder builder = getVariantBuilder( block );
for( MonitorEdgeState edge : BlockMonitor.STATE.getAllowedValues() )
{
String suffix = edge == MonitorEdgeState.NONE ? "" : "_" + edge.getName();
ModelFile model = models().getBuilder( suffix( block, suffix ) );
for( Direction facing : BlockMonitor.FACING.getAllowedValues() )
{
for( Direction orientation : BlockMonitor.ORIENTATION.getAllowedValues() )
{
builder.partialState()
.with( BlockMonitor.STATE, edge )
.with( BlockMonitor.FACING, facing )
.with( BlockMonitor.ORIENTATION, orientation )
.addModels( new ConfiguredModel( model, toXAngle( orientation ), toYAngle( facing ), false ) );
}
}
}
}
private void registerMonitorModel( String prefix, String corners, int front, int side, int top, int back )
{
String texturePrefix = ComputerCraft.MOD_ID + ":block/" + prefix + "_";
models().getBuilder( prefix + corners )
.parent( monitorBase )
.texture( "front", texturePrefix + front )
.texture( "side", texturePrefix + side )
.texture( "top", texturePrefix + top )
.texture( "back", texturePrefix + back );
}
private static int toXAngle( Direction direction )
{
switch( direction )
{
default:
return 0;
case UP:
return 270;
case DOWN:
return 90;
}
}
private static int toYAngle( Direction direction )
{
return ((int) direction.getHorizontalAngle() + 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 )
{
ResourceLocation id = block.getRegistryName();
return new ResourceLocation( id.getNamespace(), "block/" + id.getPath() + suffix ).toString();
}
}

View File

@ -24,5 +24,6 @@ public class Generators
generator.addProvider( new Recipes( generator ) );
generator.addProvider( new LootTables( generator ) );
generator.addProvider( new Tags( generator, event.getExistingFileHelper() ) );
generator.addProvider( new BlockModelProvider( generator, event.getExistingFileHelper() ) );
}
}

View File

@ -8,6 +8,7 @@ package dan200.computercraft.data;
import dan200.computercraft.ComputerCraft;
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.computer.core.ComputerFamily;
@ -117,7 +118,7 @@ public class Recipes extends RecipeProvider
String nameId = family.name().toLowerCase( Locale.ROOT );
TurtleUpgrades.getVanillaUpgrades().forEach( upgrade -> {
PocketUpgrades.getVanillaUpgrades().forEach( upgrade -> {
ItemStack result = PocketComputerItemFactory.create( -1, null, -1, family, null );
ShapedRecipeBuilder
.shapedRecipe( result.getItem() )

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