1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-15 22:17:39 +00:00

Compare commits

...

60 Commits

Author SHA1 Message Date
Jonathan Coates
7f9a707f75 Bump version to 1.95.0
As is tradition.
2020-12-25 16:40:50 +00:00
Jonathan Coates
ed3913c1f4 Manually wrap strings for help (#602)
This saves us writing to a buffer multiple times, and so makes things much,
much faster.
2020-12-23 16:33:58 +00:00
Lupus590
16d74dd2e8 Add functions to wrap text 2020-12-23 16:21:04 +00:00
Jonathan Coates
24bb92007a Fix licence issues
I knew I shouldn't do modding on things which aren't my main computer.

I actually did run checkstyleMain before committing, but entirely forgot
about this one. Go me.
2020-12-23 15:58:40 +00:00
Jonathan Coates
2f0cae0bc1 Make upgrade recipe requirements a little more lax
- Move some common upgrade code to IUpgradeBase. 99% sure this this
   preserves binary compatibility (on the JVM at least).

 - Instead of requiring the share tag to match, allow upgrades to
   specify their own predicate. IMO this is a little ugly, but required
   to fix #614 as other mods chuck their own NBT on items.
2020-12-23 15:52:33 +00:00
Jonathan Coates
e3a672099c Fix JEI integration with turtle/pocket upgrades
- Remove incorrect impostor recipes for pocket computers. We were
   generating them from the list of turtle upgrades instead!
 - Fix JEI plugin not blocking impostor recipes as of the data-generator
   rewrite.
2020-12-23 15:46:27 +00:00
Jonathan Coates
abf425dfb5 Fix overflow in os.epoch
Closes #611
2020-12-23 12:33:47 +00:00
Jonathan Coates
663859d2e5 Fix double URL decode
Closes #613
2020-12-23 12:18:20 +00:00
Jonathan Coates
f5eb6ce03e Fix copy-paste error in inventory docs
I'm a very silly squid.
2020-12-15 09:31:12 +00:00
Jonathan Coates
4ae370b9db Merge pull request #606 from TheWireLord/numpadenter-support
Added Numpad Enter Support - bios.lua
2020-12-12 21:51:07 +00:00
TheWireLord
b97e950d86 Added Numpad Enter Support - bios.lua
Add the ability to use Numpad Enter and have it act just like normal Enter.
(Just like the web-based emulator on the Tweaked.cc wiki)
2020-12-12 16:45:02 -05:00
SquidDev
5865e9c41a Not sure what irritates me more
The fact that I didn't run checkstyle before pushing or checkstyle
itself. I wish this ran fast enough I could put it as a commit hook.
2020-12-11 21:41:29 +00:00
SquidDev
85cf2d5ff1 Docs for energy and inventory methods
The inventory transfer methods really need a proper tutorial with
screenshots and everything else, but this is a good starting point, I
guess.
2020-12-11 21:26:36 +00:00
SquidDev
05c3c8ad32 Generate docs for generic peripherals
This was the easy bit. Now I've got to write them!
2020-12-10 22:16:49 +00:00
SquidDev
bb8f4c624b Some sanity checks for get{Direction,Orientation}
Silly bodge, but should fix #600.
2020-12-10 19:13:49 +00:00
SquidDev
ea3a160367 Remove a couple of todos 2020-12-10 19:05:52 +00:00
SquidDev
737b3cb576 Don't use capabilities for generic peripherals
Maybe the capability system was a mistake in retrospect, as we don't
store the peripheral outside, so there's no way to reuse it. That will
probably come in a later change.

As a smaller fix, we pass the invalidate listener directly. The lifetime
of this is the same as the computer, so we don't create a new one each
time.

There's still the potential to leak memory if people break/replace a
computer (as listeners aren't removed), but that's an unavoidable flaw
with capabilities.

Fixes #593
2020-12-10 19:05:44 +00:00
SquidDev
d83a68f3ff Allow $private HTTP rule to block any private IP
This is a little magic compared with our previous approach of "list
every private IP range", but given then the sheer number we were
missing[1][2] this feels more reasonable.

Also refactor out some of the logic into separate classes, hopefully to
make things a little cleaner.

Fixes #594.

[1]: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml
[2]: https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
2020-12-05 11:32:00 +00:00
JackMacWindows
24d3777722 Added improved help viewer (#595)
- Pagination, with (page) up/down, q(uit) and scrolling support.
 - Render markdown style bullets ('-'/'*') using a '•' instead.
2020-12-02 19:22:12 +00:00
JackMacWindows
826797cbd5 Added documentation for global functions (#592) 2020-11-29 11:24:18 +00:00
Jonathan Coates
511eea39a1 Remove <!-- -->s in usages
We fixed the bug in illuaminate, so this should be redundant now.
2020-11-28 17:53:07 +00:00
SquidDev
24af36743d Try to handle a turtle being broken while ticked
Hopefully fixes #585. Hopefully.
2020-11-28 13:13:35 +00:00
SquidDev
e2761bb315 Woops
I ran the tests, just not checkstyle.
2020-11-28 12:13:43 +00:00
SquidDev
6734a0e112 Also generate computer models
I'm getting quite addicted to this. Maybe less savings than monitors,
but still worth doing due to the number of files created.

Also fix our angle calculations for monitors. Thankfully we hadn't
shipped this yet :).
2020-11-28 12:06:46 +00:00
SquidDev
d4199064ae Make fs.combine accept multiple arguments
Means we can now do fs.combine("a", "b", "c"). Of course, one may just
write "a/b/c" in this case, but it's definitely useful elsewhere.

This is /technically/ a breaking change as fs.combine(a, b:gsub(...))
will no longer function (as gsub returns multiple arguments). However,
I've done a quick search through GH and my Pastebin archives and can't
find any programs which would break. Fingers crossed.
2020-11-28 11:41:03 +00:00
SquidDev
04f9644ae7 Allow strings or numbers in textutils.*tabulate
A little dubious, but apparently CC used to support it. This means we're
consistent with methods like io.write or string.len which accept strings
or numbers.

Fixes #591
2020-11-27 21:29:11 +00:00
JackMacWindows
486f41f082 Fixed length check on function name in expect (#589) 2020-11-26 19:46:03 +00:00
Lupus590
fff8353451 Remove extra space (#586) 2020-11-21 12:25:19 +00:00
Lupus590
9a749642d2 Strict Globals (#583) 2020-11-21 12:11:40 +00:00
SquidDev
c35707725f More examples
Yay!
2020-11-20 21:59:17 +00:00
SquidDev
b0651082f4 Cleanup examples for the various modules 2020-11-20 19:36:28 +00:00
SquidDev
aab0cd34cd Use term.blit on original paint render
This makes it super speedy, meaning an initial refresh doesn't take ages
to load.
2020-11-20 15:06:47 +00:00
Luca
d2a1a00dc4 Clear gets an option to reset the palette (#582)
Fixes #555.
2020-11-17 12:53:20 +00:00
Stephen Gibson
f194f4fa3a Fix epoch documentation to use milliseconds (#580) 2020-11-13 17:27:28 +00:00
SquidDev
7f90f2f7ca Clean up some examples a little bit
Would be good if they didn't crash and burn on entry :).
2020-11-12 19:40:18 +00:00
SquidDev
9f57e77ed3 Add a link to the Java docs 2020-11-12 19:12:03 +00:00
SquidDev
ab39cb849d Publish Javadoc to tweaked.cc too
Closes #578

Also only publish docs for 1.15.x trunk for now. Tags aren't especially
useful until we add a version switcher.
2020-11-12 19:06:00 +00:00
Jonathan Coates
a4c9e89370 Runnable examples (#576)
Provides a basic interface for running examples on tweaked.cc. This is probably
janky as anything, but it works on my machine.

This is the culmination of 18 months of me building far too much infrastructure
(copy-cat, illuaminate), so that's nice I guess.

I should probably get out more.
2020-11-12 19:01:50 +00:00
SquidDev
c8aeddedd4 Auto-generate monitor models
I didn't think it was worth it, and then I found myself needing to
update a dozen of them. The code isn't especially pretty, but it works,
so that's fine.

Also fixes several issues with us using the wrong texture (closes #572).
I've put together a wiki page[1] which describes each texture in a
little more detail.

[1] https://github.com/SquidDev-CC/CC-Tweaked/wiki/Monitor-texture-reference
2020-11-11 21:14:53 +00:00
SquidDev
74ac5bb3d1 Bump to 1.94.0 2020-11-07 12:43:57 +00:00
Lupus590
d13bd2cce8 use arg[0] in all usage printouts (#571) 2020-11-04 14:03:08 +00:00
SquidDev
cc96e41d3e Remove stray copy-paste error from changelog 2020-11-03 14:37:24 +00:00
Drew Lemmy
741adfa7bb Use blit to draw boxes, add colors.toBlit (#570) 2020-11-01 19:28:18 +00:00
SquidDev
666e83cf4f Fix JSON objects failing to pass
Maybe I should run the whole test suite, not just the things I think
matter? Nah....
2020-11-01 11:48:19 +00:00
SquidDev
e2a635b6e5 Don't fail when codecov is being finicky 2020-11-01 11:36:53 +00:00
SquidDev
c58441b29c Various SNBT parsing improvements
Correctly handle:
 - Typed arrays ([I; 1, 2, 3])
 - All suffixed numbers (1.2d)
 - Single-quoted strings

Fixes #559
2020-11-01 11:36:48 +00:00
SquidDev
a6fcfb6af2 Draw in-hand pocket computers with blending
It might be worth switching to RenderTypes here, rather than a pure
Tesselator, but this'll do for now.

Fixes Zundrel/cc-tweaked-fabric#20.
2020-11-01 11:12:28 +00:00
SquidDev
17a9329207 Bump cct-javadoc version
Documentation will now be sorted (somewhat) correctly!
2020-10-31 12:50:03 +00:00
SquidDev
f6160bdc57 Fix players not getting advancements when they own turtles
When we construct a new ServerPlayerEntity (and thus TurtlePlayer), we
get the current (global) advancement state and call .setPlayer() on it.

As grantCriterion blocks FakePlayers from getting advancements, this
means a player will no longer receive any advancements, as the "wrong"
player object is being consulted.

As a temporary work around, we attempt to restore the previous player to
the advancement store. I'll try to upstream something into Forge to
resolve this properly.

Fixes #564
2020-10-31 10:59:24 +00:00
SquidDev
6aae4e5766 Remove superfluous imports
Hah, this is embarassing
2020-10-31 10:09:54 +00:00
SquidDev
84a6bb1cf3 Make generic peripherals on by default
This is a long way away from "feature complete" as it were. However,
it's definitely at a point where it's suitable for general usage - I'm
happy with the API, and don't think I'm going to be breaking things any
time soon.

That said, things aren't exposed yet for Java-side public consumption. I
was kinda waiting until working on Plethora to actually do that, but not
sure if/when that'll happen.

If someone else wants to work on an integration mod (or just adding
integrations for their own mod), do get in touch and I can work out how
to expose this.

Closes #452
2020-10-31 10:03:09 +00:00
SquidDev
c334423d42 Add function to get window visibility
Closes #562

Co-authored-by: devomaa <lmao@distruzione.org>
2020-10-31 09:54:38 +00:00
Jonathan Coates
113b560a20 Update configuration to match latest illuaminate
Ooooooh, it's all fancy now. Well, that or horrifically broken.
2020-10-27 22:20:01 +00:00
SquidDev
61fb4caaad Bump to 1.93.1 2020-10-23 17:44:52 +01:00
Jonathan Coates
6734af6e4a Merge pull request #560 from Lemmmy/lemmmy/fix-monitor-tbo
Fix TBO normalisation issues on old GPUs
2020-10-22 12:14:27 +01:00
Drew Lemmy
bf6053906d Fix TBO norm issues on old GPUs 2020-10-21 10:28:12 +01:00
Drew Lemmy
01d81cb91d Update illuaminate CSS for deprecation (#556) 2020-10-14 22:05:56 +01:00
Drew Lemmy
93068402a2 Document remaining OS functions (#554) 2020-10-11 22:38:18 +01:00
Drew Lemmy
34a2c835d4 Add color table to docs (#553) 2020-10-11 21:37:56 +01:00
Jonathan Coates
30d35883b8 Fix my docs
Thanks @plt-hokusai. Kinda embarrassing this slipped through - I
evidently need to lint examples too.
2020-10-08 09:48:36 +01:00
250 changed files with 4975 additions and 2593 deletions

View File

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

View File

@@ -34,6 +34,7 @@ jobs:
- name: Upload Coverage
run: bash <(curl -s https://codecov.io/bash)
continue-on-error: true
- name: Generate Java documentation stubs
run: ./gradlew luaJavadoc --no-daemon

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/" \
"$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

13
.gitignore vendored
View File

@@ -3,9 +3,8 @@
/logs
/build
/out
/doc/**/*.html
/doc/javadoc/
/doc/index.json
/doc/out/
/node_modules
# Runtime directories
/run
@@ -19,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

@@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.google.code.gson:gson:2.8.1'
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.179'
classpath 'net.minecraftforge.gradle:ForgeGradle:3.0.187'
classpath 'net.sf.proguard:proguard-gradle:6.1.0beta2'
classpath 'org.ajoberstar.grgit:grgit-gradle:3.0.0'
}
@@ -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.1.0'
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

125
doc/stub/global.lua Normal file
View File

@@ -0,0 +1,125 @@
--[[-
Functions in the global environment, defined in `bios.lua`. This does not
include standard Lua functions.
@module _G
]]
--[[- Pauses execution for the specified number of seconds.
As it waits for a fixed amount of world ticks, `time` will automatically be
rounded up to the nearest multiple of 0.05 seconds. If you are using coroutines
or the @{parallel|parallel API}, it will only pause execution of the current
thread, not the whole program.
**Note** Because sleep internally uses timers, it is a function that yields.
This means that you can use it to prevent "Too long without yielding" errors,
however, as the minimum sleep time is 0.05 seconds, it will slow your program
down.
**Warning** Internally, this function queues and waits for a timer event (using
@{os.startTimer}), however it does not listen for any other events. This means
that any event that occurs while sleeping will be entirely discarded. If you
need to receive events while sleeping, consider using @{os.startTimer|timers},
or the @{parallel|parallel API}.
@tparam number time The number of seconds to sleep for, rounded up to the
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
configuration.
This is a comma-separated list of settings pairs defined by the mod
configuration or server owner. By default, it is empty.
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

@@ -1,8 +1,6 @@
--- The http library allows communicating with web servers, sending and
-- receiving data from them.
--
-- #### `http_check` event
--
-- @module http
--- Asynchronously make a HTTP request to the given url.

View File

@@ -1,6 +1,125 @@
-- Defined in bios.lua
--[[- Loads the given API into the global environment.
**Warning** This function is deprecated. Use of this function will pollute the
global table, use @{require} instead.
This function loads and executes the file at the given path, and all global
variables and functions exported by it will by available through the use of
`myAPI.<function name>`, where `myAPI` is the base name of the API file.
@tparam string path The path of the API to load.
@treturn boolean Whether or not the API was successfully loaded.
@deprecated Use @{require}.
]]
function loadAPI(path) end
--- Unloads an API which was loaded by @{os.loadAPI}.
--
-- This effectively removes the specified table from `_G`.
--
-- @tparam string name The name of the API to unload.
-- @deprecated Use @{require}.
function unloadAPI(name) end
--[[- Pause execution of the current thread and waits for any events matching
`filter`.
This function @{coroutine.yield|yields} the current process and waits for it
to be resumed with a vararg list where the first element matches `filter`.
If no `filter` is supplied, this will match all events.
Unlike @{os.pullEventRaw}, it will stop the application upon a "terminate"
event, printing the error "Terminated".
@tparam[opt] string filter Event to filter for.
@treturn string event The name of the event that fired.
@treturn any param... Optional additional parameters of the event.
@usage Listen for `mouse_click` events.
while true do
local event, button, x, y = os.pullEvent("mouse_click")
print("Button", button, "was clicked at", x, ",", y)
end
@usage Listen for multiple events.
while true do
local eventData = {os.pullEvent()}
local event = eventData[1]
if event == "mouse_click" then
print("Button", eventData[2], "was clicked at", eventData[3], ",", eventData[4])
elseif event == "key" then
print("Key code", eventData[2], "was pressed")
end
end
@see os.pullEventRaw To pull the terminate event.
]]
function pullEvent(filter) end
--[[- Pause execution of the current thread and waits for events, including the
`terminate` event.
This behaves almost the same as @{os.pullEvent}, except it allows you to handle
the `terminate` event yourself - the program will not stop execution when
<kbd>Ctrl+T</kbd> is pressed.
@tparam[opt] string filter Event to filter for.
@treturn string event The name of the event that fired.
@treturn any param... Optional additional parameters of the event.
@usage Listen for `terminate` events.
while true do
local event = os.pullEventRaw()
if event == "terminate" then
print("Caught terminate event!")
end
end
@see os.pullEvent To pull events normally.
]]
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`).
--
-- This is defined by `bios.lua`. For the current version of CC:Tweaked, this
-- 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
arguments.
This function does not resolve program names like the shell does. This means
that, for example, `os.run("edit")` will not work. As well as this, it does not
provide access to the @{shell} API in the environment. For this behaviour, use
@{shell.run} instead.
If the program cannot be found, or failed to run, it will print the error and
return `false`. If you want to handle this more gracefully, use an alternative
such as @{loadfile}.
@tparam table env The environment to run the program with.
@tparam string path The exact path of the program to run.
@param ... The arguments to pass to the program.
@treturn boolean Whether or not the program ran successfully.
@usage Run the default shell from within your program:
os.run({}, "/rom/programs/shell.lua")
@see shell.run
@see loadfile
]]
function run(env, path, ...) end

View File

@@ -1,191 +0,0 @@
/* Basic reset on elements */
h1, h2, h3, h4, p, table, div, body {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* Make the page a little more airy */
body {
margin: 20px auto;
max-width: 1200px;
padding: 0 10px;
line-height: 1.6;
color: #222;
background: #fff;
}
/* Try to use system default fonts. */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans",
"Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
code, pre, .parameter, .type, .definition-name, .reference-code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
/* Some definitions of basic tags */
code {
color: #c7254e;
background-color: #f9f2f4;
}
p {
margin: 0.9em 0;
}
h1 {
font-size: 1.5em;
font-weight: lighter;
border-bottom: solid 1px #aaa;
}
h2, h3, h4 { margin: 1.4em 0 0.3em;}
h2 { font-size: 1.25em; }
h3 { font-size: 1.15em; font-weight: bold; }
h4 { font-size: 1.06em; }
a, a:visited, a:active { font-weight: bold; color: #004080; text-decoration: none; }
a:hover { text-decoration: underline; }
blockquote {
padding: 0.3em;
margin: 1em 0;
background: #f0f0f0;
border-left: solid 0.5em #ccc;
}
/* Stop sublists from having initial vertical space */
ul ul { margin-top: 0px; }
ol ul { margin-top: 0px; }
ol ol { margin-top: 0px; }
ul ol { margin-top: 0px; }
/* Make the target distinct; helps when we're navigating to a function */
a:target + * { background-color: #FFFF99; }
/* Allow linking to any subsection */
a[name]::before { content: "#"; }
/* Layout */
#main {
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
min-height: calc(100vh - 100px);
}
#main > nav {
flex-basis: 30%;
min-width: 150px;
max-width: 250px;
background-color: #f0f0f0;
}
nav h1, nav ul { padding: 0em 10px; }
nav h2 {
background-color:#e7e7e7;
font-size: 1.1em;
color:#000000;
padding: 5px 10px;
}
nav ul {
list-style-type: none;
margin: 0;
}
#content {
flex-shrink: 1;
flex-basis: 80%;
padding: 0px 10px;
}
footer {
text-align: right;
font-size: 0.8em;
}
/* The definition lists at the top of each page */
table.definition-list {
border-collapse: collapse;
width: 100%;
}
table.definition-list td, table.definition-list th {
border: 1px solid #cccccc;
padding: 5px;
}
table.definition-list th {
background-color: #f0f0f0;
min-width: 200px;
white-space: nowrap;
text-align: right;
}
table.definition-list td { width: 100%; }
dl.definition dt {
border-top: 1px solid #ccc;
padding-top: 1em;
display: flex;
}
dl.definition dt .definition-name {
padding: 0 0.1em;
margin: 0 0.1em;
flex-grow: 1;
}
dl.definition dd {
padding-bottom: 1em;
margin: 10px 0 0 20px;
}
dl.definition h3 {
font-size: .95em;
}
/* Links to source-code */
.source-link { font-size: 0.8em; }
.source-link::before { content: '[' }
.source-link::after { content: ']' }
a.source-link, a.source-link:visited, a.source-link:active { color: #505050; }
/* Method definitions */
span.parameter:after { content:":"; padding-left: 0.3em; }
.optional { text-decoration: underline dotted; }
/** Fancy colour display. */
.colour-ref {
display: inline-block;
width: 0.8em;
height: 0.8em;
margin: 0.1em 0.1em 0.3em 0.1em; /* Terrrible hack to force vertical alignment. */
border: solid 1px black;
box-sizing: border-box;
vertical-align: middle;
}
/* styles for prettification of source */
.highlight .comment { color: #558817; }
.highlight .constant { color: #a8660d; }
.highlight .escape { color: #844631; }
.highlight .keyword { color: #aa5050; font-weight: bold; }
.highlight .library { color: #0e7c6b; }
.highlight .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
.highlight .string { color: #8080ff; }
.highlight .literal-kw { color: #8080ff; }
.highlight .number { color: #f8660d; }
.highlight .operator { color: #2239a8; font-weight: bold; }
.highlight .preprocessor, pre .prepro { color: #a33243; }
.highlight .global { color: #800080; }
.highlight .user-keyword { color: #800080; }
.highlight .prompt { color: #558817; }
.highlight .url { color: #272fc2; text-decoration: underline; }

View File

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

View File

@@ -2,23 +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 build/docs/lua)
(logo src/main/resources/pack.png)
(index doc/index.md)
(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
@@ -50,7 +56,7 @@
;; colours imports from colors, and we don't handle that right now.
;; keys is entirely dynamic, so we skip it.
(dynamic-modules colours keys)
(dynamic-modules colours keys _G)
(globals
:max
@@ -69,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)))
@@ -79,26 +85,24 @@
/doc/stub/http.lua
/doc/stub/os.lua
/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))
(at /src/test/resources/test-rom
; We should still be able to test deprecated members.
@@ -108,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;
@@ -90,8 +73,6 @@ public final class ComputerCraft
public static boolean turtlesCanPush = true;
public static EnumSet<TurtleAction> turtleDisabledActions = EnumSet.noneOf( TurtleAction.class );
public static boolean genericPeripheral = false;
public static int computerTermWidth = 51;
public static int computerTermHeight = 19;

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

@@ -139,7 +139,7 @@ public interface ITurtleAccess
*
* @return This turtle's owner.
*/
@Nonnull
@Nullable
GameProfile getOwningPlayer();
/**

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

@@ -47,7 +47,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

@@ -115,6 +115,7 @@ public final class ItemPocketRenderer extends ItemMapLikeRenderer
private static void renderFrame( Matrix4f transform, ComputerFamily family, int colour, int width, int height )
{
RenderSystem.enableBlend();
Minecraft.getInstance().getTextureManager()
.bindTexture( colour != -1 ? ComputerBorderRenderer.BACKGROUND_COLOUR : ComputerBorderRenderer.getTexture( family ) );
@@ -133,7 +134,6 @@ public final class ItemPocketRenderer extends ItemMapLikeRenderer
private static void renderLight( Matrix4f transform, int colour, int width, int height )
{
RenderSystem.enableBlend();
RenderSystem.disableTexture();
float r = ((colour >>> 16) & 0xFF) / 255.0f;

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 );
}
/**
@@ -385,8 +398,8 @@ public class FSAPI implements ILuaAPI
*
* @param path The path to check the free space for.
* @return The amount of free space available, in bytes.
* @cc.treturn number|"unlimited" The amount of free space available, in bytes, or "unlimited".
* @throws LuaException If the path doesn't exist.
* @cc.treturn number|"unlimited" The amount of free space available, in bytes, or "unlimited".
*/
@LuaFunction
public final Object getFreeSpace( String path ) throws LuaException

View File

@@ -171,12 +171,18 @@ public class OSAPI implements ILuaAPI
/**
* Starts a timer that will run for the specified number of seconds. Once
* the timer fires, a timer event will be added to the queue with the ID
* returned from this function as the first parameter.
* the timer fires, a {@code timer} event will be added to the queue with
* the ID returned from this function as the first parameter.
*
* As with @{os.sleep|sleep}, {@code timer} will automatically be rounded up
* to the nearest multiple of 0.05 seconds, as it waits for a fixed amount
* of world ticks.
*
* @param timer The number of seconds until the timer fires.
* @return The ID of the new timer.
* @return The ID of the new timer. This can be used to filter the
* {@code timer} event, or {@link #cancelTimer cancel the timer}.
* @throws LuaException If the time is below zero.
* @see #cancelTimer To cancel a timer.
*/
@LuaFunction
public final int startTimer( double timer ) throws LuaException
@@ -199,11 +205,14 @@ public class OSAPI implements ILuaAPI
/**
* Sets an alarm that will fire at the specified world time. When it fires,
* an alarm event will be added to the event queue.
* an {@code alarm} event will be added to the event queue with the ID
* returned from this function as the first parameter.
*
* @param time The time at which to fire the alarm, in the range [0.0, 24.0).
* @return The ID of the alarm that was set.
* @return The ID of the new alarm. This can be used to filter the
* {@code alarm} event, or {@link #cancelAlarm cancel the alarm}.
* @throws LuaException If the time is out of range.
* @see #cancelAlarm To cancel an alarm.
*/
@LuaFunction
public final int setAlarm( double time ) throws LuaException
@@ -369,17 +378,17 @@ public class OSAPI implements ILuaAPI
}
/**
* Returns the number of seconds since an epoch depending on the locale.
* Returns the number of milliseconds since an epoch depending on the locale.
*
* * If called with {@code ingame}, returns the number of seconds since the
* * If called with {@code ingame}, returns the number of milliseconds since the
* world was created. This is the default.
* * If called with {@code utc}, returns the number of seconds since 1
* * If called with {@code utc}, returns the number of milliseconds since 1
* January 1970 in the UTC timezone.
* * If called with {@code local}, returns the number of seconds since 1
* * If called with {@code local}, returns the number of milliseconds since 1
* January 1970 in the server's local timezone.
*
* @param args The locale to get the seconds for. Defaults to {@code ingame} if not set.
* @return The seconds since the epoch depending on the selected locale.
* @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.
* @throws LuaException If an invalid locale is passed.
*/
@LuaFunction
@@ -403,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;
}

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