mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 20:20:30 +00:00
Merge branch 'mc-1.16.x' into mc-1.17.x
This commit is contained in:
commit
bca964629a
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -4,5 +4,5 @@ contact_links:
|
|||||||
url: https://discord.computercraft.cc
|
url: https://discord.computercraft.cc
|
||||||
about: Get help on the ComputerCraft Discord.
|
about: Get help on the ComputerCraft Discord.
|
||||||
- name: GitHub Discussions
|
- name: GitHub Discussions
|
||||||
url: https://github.com/SquidDev-CC/CC-Tweaked/discussions
|
url: https://github.com/cc-tweaked/CC-Tweaked/discussions
|
||||||
about: Or ask questions on GitHub Discussions.
|
about: Or ask questions on GitHub Discussions.
|
||||||
|
4
.github/workflows/make-doc.sh
vendored
4
.github/workflows/make-doc.sh
vendored
@ -13,7 +13,7 @@ chmod 600 "$HOME/.ssh/key"
|
|||||||
# And upload
|
# And upload
|
||||||
rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \
|
rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \
|
||||||
"$GITHUB_WORKSPACE/build/docs/lua/" \
|
"$GITHUB_WORKSPACE/build/docs/lua/" \
|
||||||
"$SSH_USER@$SSH_HOST:/var/www/tweaked.cc/$DEST"
|
"$SSH_USER@$SSH_HOST:/$DEST"
|
||||||
rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \
|
rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \
|
||||||
"$GITHUB_WORKSPACE/build/docs/javadoc/" \
|
"$GITHUB_WORKSPACE/build/docs/javadoc/" \
|
||||||
"$SSH_USER@$SSH_HOST:/var/www/tweaked.cc/$DEST/javadoc"
|
"$SSH_USER@$SSH_HOST:/$DEST/javadoc"
|
||||||
|
@ -16,11 +16,11 @@ automatically with GitHub, so please don't submit PRs adding/changing translatio
|
|||||||
In order to develop CC: Tweaked, you'll need to download the source code and then run it. This is a pretty simple
|
In order to develop CC: Tweaked, you'll need to download the source code and then run it. This is a pretty simple
|
||||||
process. When building on Windows, Use `gradlew.bat` instead of `./gradlew`.
|
process. When building on Windows, Use `gradlew.bat` instead of `./gradlew`.
|
||||||
|
|
||||||
- **Clone the repository:** `git clone https://github.com/SquidDev-CC/CC-Tweaked.git && cd CC-Tweaked`
|
- **Clone the repository:** `git clone https://github.com/cc-tweaked/CC-Tweaked.git && cd CC-Tweaked`
|
||||||
- **Setup Forge:** `./gradlew build`
|
- **Setup Forge:** `./gradlew build`
|
||||||
- **Run Minecraft:** `./gradlew runClient` (or run the `GradleStart` class from your IDE).
|
- **Run Minecraft:** `./gradlew runClient` (or run the `GradleStart` class from your IDE).
|
||||||
- **Optionally:** For small PRs (especially those only touching Lua code), it may be easier to use GitPod, which
|
- **Optionally:** For small PRs (especially those only touching Lua code), it may be easier to use GitPod, which
|
||||||
provides a pre-configured environment: [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-2b2b2b?logo=gitpod)](https://gitpod.io/#https://github.com/SquidDev-CC/CC-Tweaked/)
|
provides a pre-configured environment: [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-2b2b2b?logo=gitpod)](https://gitpod.io/#https://github.com/cc-tweaked/CC-Tweaked/)
|
||||||
|
|
||||||
Do note you will need to download the mod after compiling to test.
|
Do note you will need to download the mod after compiling to test.
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ tests go inside `describe` blocks, and a single test goes inside `it`.
|
|||||||
Assertions are generally written using `expect` (inspired by Hamcrest and the like). For instance, `expect(foo):eq("bar")`
|
Assertions are generally written using `expect` (inspired by Hamcrest and the like). For instance, `expect(foo):eq("bar")`
|
||||||
asserts that your variable `foo` is equal to the expected value `"bar"`.
|
asserts that your variable `foo` is equal to the expected value `"bar"`.
|
||||||
|
|
||||||
[new-issue]: https://github.com/SquidDev-CC/CC-Tweaked/issues/new/choose "Create a new issue"
|
[new-issue]: https://github.com/cc-tweaked/CC-Tweaked/issues/new/choose "Create a new issue"
|
||||||
[community]: README.md#Community "Get in touch with the community."
|
[community]: README.md#Community "Get in touch with the community."
|
||||||
[checkstyle]: https://checkstyle.org/
|
[checkstyle]: https://checkstyle.org/
|
||||||
[illuaminate]: https://github.com/SquidDev/illuaminate/ "Illuaminate on GitHub"
|
[illuaminate]: https://github.com/SquidDev/illuaminate/ "Illuaminate on GitHub"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# ![CC: Tweaked](doc/logo.png)
|
# ![CC: Tweaked](doc/logo.png)
|
||||||
[![Current build status](https://github.com/SquidDev-CC/CC-Tweaked/workflows/Build/badge.svg)](https://github.com/SquidDev-CC/CC-Tweaked/actions "Current build status") [![Download CC: Tweaked on CurseForge](http://cf.way2muchnoise.eu/title/cc-tweaked.svg)][CurseForge]
|
[![Current build status](https://github.com/cc-tweaked/CC-Tweaked/workflows/Build/badge.svg)](https://github.com/cc-tweaked/CC-Tweaked/actions "Current build status") [![Download CC: Tweaked on CurseForge](http://cf.way2muchnoise.eu/title/cc-tweaked.svg)][CurseForge]
|
||||||
|
|
||||||
CC: Tweaked is a mod for Minecraft which adds programmable computers, turtles and more to the game. A fork of the
|
CC: Tweaked is a mod for Minecraft which adds programmable computers, turtles and more to the game. A fork of the
|
||||||
much-beloved [ComputerCraft], it continues its legacy with better performance, stability, and a wealth of new features.
|
much-beloved [ComputerCraft], it continues its legacy with better performance, stability, and a wealth of new features.
|
||||||
|
14
build.gradle
14
build.gradle
@ -493,7 +493,7 @@ curseforge {
|
|||||||
project {
|
project {
|
||||||
id = '282001'
|
id = '282001'
|
||||||
releaseType = isStable ? 'release' : 'alpha'
|
releaseType = isStable ? 'release' : 'alpha'
|
||||||
changelog = "Release notes can be found on the GitHub repository (https://github.com/SquidDev-CC/CC-Tweaked/releases/tag/v${mc_version}-${mod_version})."
|
changelog = "Release notes can be found on the GitHub repository (https://github.com/cc-tweaked/CC-Tweaked/releases/tag/v${mc_version}-${mod_version})."
|
||||||
|
|
||||||
addGameVersion "${mc_version}"
|
addGameVersion "${mc_version}"
|
||||||
}
|
}
|
||||||
@ -511,7 +511,7 @@ tasks.register('publishModrinth', TaskModrinthUpload.class).configure {
|
|||||||
uploadFile = jar
|
uploadFile = jar
|
||||||
versionType = isStable ? 'RELEASE' : 'ALPHA'
|
versionType = isStable ? 'RELEASE' : 'ALPHA'
|
||||||
addGameVersion(project.mc_version)
|
addGameVersion(project.mc_version)
|
||||||
changelog = "Release notes can be found on the [GitHub repository](https://github.com/SquidDev-CC/CC-Tweaked/releases/tag/v${mc_version}-${mod_version})."
|
changelog = "Release notes can be found on the [GitHub repository](https://github.com/cc-tweaked/CC-Tweaked/releases/tag/v${mc_version}-${mod_version})."
|
||||||
addLoader('forge')
|
addLoader('forge')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -528,21 +528,21 @@ publishing {
|
|||||||
pom {
|
pom {
|
||||||
name = 'CC: Tweaked'
|
name = 'CC: Tweaked'
|
||||||
description = 'CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles and more to Minecraft.'
|
description = 'CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles and more to Minecraft.'
|
||||||
url = 'https://github.com/SquidDev-CC/CC-Tweaked'
|
url = 'https://github.com/cc-tweaked/CC-Tweaked'
|
||||||
|
|
||||||
scm {
|
scm {
|
||||||
url = 'https://github.com/SquidDev-CC/CC-Tweaked.git'
|
url = 'https://github.com/cc-tweaked/CC-Tweaked.git'
|
||||||
}
|
}
|
||||||
|
|
||||||
issueManagement {
|
issueManagement {
|
||||||
system = 'github'
|
system = 'github'
|
||||||
url = 'https://github.com/SquidDev-CC/CC-Tweaked/issues'
|
url = 'https://github.com/cc-tweaked/CC-Tweaked/issues'
|
||||||
}
|
}
|
||||||
|
|
||||||
licenses {
|
licenses {
|
||||||
license {
|
license {
|
||||||
name = 'ComputerCraft Public License, Version 1.0'
|
name = 'ComputerCraft Public License, Version 1.0'
|
||||||
url = 'https://github.com/SquidDev-CC/CC-Tweaked/blob/mc-1.15.x/LICENSE'
|
url = 'https://github.com/cc-tweaked/CC-Tweaked/blob/mc-1.15.x/LICENSE'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,7 +567,7 @@ publishing {
|
|||||||
|
|
||||||
githubRelease {
|
githubRelease {
|
||||||
token project.hasProperty('githubApiKey') ? project.githubApiKey : ''
|
token project.hasProperty('githubApiKey') ? project.githubApiKey : ''
|
||||||
owner 'SquidDev-CC'
|
owner 'cc-tweaked'
|
||||||
repo 'CC-Tweaked'
|
repo 'CC-Tweaked'
|
||||||
targetCommitish.set(project.provider({
|
targetCommitish.set(project.provider({
|
||||||
def cmd = ["git", "rev-parse", "--abbrev-ref", "HEAD"]
|
def cmd = ["git", "rev-parse", "--abbrev-ref", "HEAD"]
|
||||||
|
@ -43,8 +43,8 @@ If you get stuck, do pop in to the [Minecraft Computer Mod Discord guild][discor
|
|||||||
## Get Involved
|
## Get Involved
|
||||||
CC: Tweaked lives on [GitHub]. If you've got any ideas, feedback or bugs please do [create an issue][bug].
|
CC: Tweaked lives on [GitHub]. If you've got any ideas, feedback or bugs please do [create an issue][bug].
|
||||||
|
|
||||||
[github]: https://github.com/SquidDev-CC/CC-Tweaked/ "CC: Tweaked on GitHub"
|
[github]: https://github.com/cc-tweaked/CC-Tweaked/ "CC: Tweaked on GitHub"
|
||||||
[bug]: https://github.com/SquidDev-CC/CC-Tweaked/issues/new/choose
|
[bug]: https://github.com/cc-tweaked/CC-Tweaked/issues/new/choose
|
||||||
[computercraft]: https://github.com/dan200/ComputerCraft "ComputerCraft on GitHub"
|
[computercraft]: https://github.com/dan200/ComputerCraft "ComputerCraft on GitHub"
|
||||||
[curseforge]: https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked from CurseForge"
|
[curseforge]: https://minecraft.curseforge.com/projects/cc-tweaked "Download CC: Tweaked from CurseForge"
|
||||||
[modrinth]: https://modrinth.com/mod/gu7yAYhd "Download CC: Tweaked from Modrinth"
|
[modrinth]: https://modrinth.com/mod/gu7yAYhd "Download CC: Tweaked from Modrinth"
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
2
gradlew
vendored
2
gradlew
vendored
@ -72,7 +72,7 @@ case "`uname`" in
|
|||||||
Darwin* )
|
Darwin* )
|
||||||
darwin=true
|
darwin=true
|
||||||
;;
|
;;
|
||||||
MINGW* )
|
MSYS* | MINGW* )
|
||||||
msys=true
|
msys=true
|
||||||
;;
|
;;
|
||||||
NONSTOP* )
|
NONSTOP* )
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
(title "CC: Tweaked")
|
(title "CC: Tweaked")
|
||||||
(logo src/main/resources/pack.png)
|
(logo src/main/resources/pack.png)
|
||||||
(url https://tweaked.cc/)
|
(url https://tweaked.cc/)
|
||||||
(source-link https://github.com/SquidDev-CC/CC-Tweaked/blob/${commit}/${path}#L${line})
|
(source-link https://github.com/cc-tweaked/CC-Tweaked/blob/${commit}/${path}#L${line})
|
||||||
|
|
||||||
(styles src/web/styles.css)
|
(styles src/web/styles.css)
|
||||||
(scripts build/rollup/index.js)
|
(scripts build/rollup/index.js)
|
||||||
@ -71,6 +71,7 @@
|
|||||||
:max
|
:max
|
||||||
_CC_DEFAULT_SETTINGS
|
_CC_DEFAULT_SETTINGS
|
||||||
_CC_DISABLE_LUA51_FEATURES
|
_CC_DISABLE_LUA51_FEATURES
|
||||||
|
_HOST
|
||||||
;; Ideally we'd pick these up from bios.lua, but illuaminate currently
|
;; Ideally we'd pick these up from bios.lua, but illuaminate currently
|
||||||
;; isn't smart enough.
|
;; isn't smart enough.
|
||||||
sleep write printError read rs)))
|
sleep write printError read rs)))
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
"conditions": {
|
"conditions": {
|
||||||
"items": [
|
"items": [
|
||||||
{
|
{
|
||||||
"tag": "computercraft:computer"
|
"tag": "computercraft:wired_modem"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,15 @@
|
|||||||
"P"
|
"P"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"P": {
|
||||||
"item": "computercraft:pocket_computer_advanced"
|
"item": "computercraft:pocket_computer_advanced"
|
||||||
},
|
},
|
||||||
"P": {
|
"#": {
|
||||||
"item": "computercraft:speaker"
|
"item": "computercraft:speaker"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "computercraft:pocket_computer_advanced"
|
"item": "computercraft:pocket_computer_advanced",
|
||||||
|
"nbt": "{Upgrade:\"computercraft:speaker\"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,14 +6,15 @@
|
|||||||
"P"
|
"P"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"P": {
|
||||||
"item": "computercraft:pocket_computer_advanced"
|
"item": "computercraft:pocket_computer_advanced"
|
||||||
},
|
},
|
||||||
"P": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_advanced"
|
"item": "computercraft:wireless_modem_advanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "computercraft:pocket_computer_advanced"
|
"item": "computercraft:pocket_computer_advanced",
|
||||||
|
"nbt": "{Upgrade:\"computercraft:wireless_modem_advanced\"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,14 +6,15 @@
|
|||||||
"P"
|
"P"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"P": {
|
||||||
"item": "computercraft:pocket_computer_advanced"
|
"item": "computercraft:pocket_computer_advanced"
|
||||||
},
|
},
|
||||||
"P": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_normal"
|
"item": "computercraft:wireless_modem_normal"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "computercraft:pocket_computer_advanced"
|
"item": "computercraft:pocket_computer_advanced",
|
||||||
|
"nbt": "{Upgrade:\"computercraft:wireless_modem_normal\"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,14 +6,15 @@
|
|||||||
"P"
|
"P"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"P": {
|
||||||
"item": "computercraft:pocket_computer_normal"
|
"item": "computercraft:pocket_computer_normal"
|
||||||
},
|
},
|
||||||
"P": {
|
"#": {
|
||||||
"item": "computercraft:speaker"
|
"item": "computercraft:speaker"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "computercraft:pocket_computer_normal"
|
"item": "computercraft:pocket_computer_normal",
|
||||||
|
"nbt": "{Upgrade:\"computercraft:speaker\"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,14 +6,15 @@
|
|||||||
"P"
|
"P"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"P": {
|
||||||
"item": "computercraft:pocket_computer_normal"
|
"item": "computercraft:pocket_computer_normal"
|
||||||
},
|
},
|
||||||
"P": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_advanced"
|
"item": "computercraft:wireless_modem_advanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "computercraft:pocket_computer_normal"
|
"item": "computercraft:pocket_computer_normal",
|
||||||
|
"nbt": "{Upgrade:\"computercraft:wireless_modem_advanced\"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,14 +6,15 @@
|
|||||||
"P"
|
"P"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"P": {
|
||||||
"item": "computercraft:pocket_computer_normal"
|
"item": "computercraft:pocket_computer_normal"
|
||||||
},
|
},
|
||||||
"P": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_normal"
|
"item": "computercraft:wireless_modem_normal"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"item": "computercraft:pocket_computer_normal"
|
"item": "computercraft:pocket_computer_normal",
|
||||||
|
"nbt": "{Upgrade:\"computercraft:wireless_modem_normal\"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "computercraft:speaker"
|
"item": "computercraft:speaker"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_advanced"
|
"item": "computercraft:wireless_modem_advanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_normal"
|
"item": "computercraft:wireless_modem_normal"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:crafting_table"
|
"item": "minecraft:crafting_table"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_axe"
|
"item": "minecraft:diamond_axe"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_hoe"
|
"item": "minecraft:diamond_hoe"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_pickaxe"
|
"item": "minecraft:diamond_pickaxe"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_shovel"
|
"item": "minecraft:diamond_shovel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_advanced"
|
"item": "computercraft:turtle_advanced"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_sword"
|
"item": "minecraft:diamond_sword"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "computercraft:speaker"
|
"item": "computercraft:speaker"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_advanced"
|
"item": "computercraft:wireless_modem_advanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "computercraft:wireless_modem_normal"
|
"item": "computercraft:wireless_modem_normal"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:crafting_table"
|
"item": "minecraft:crafting_table"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_axe"
|
"item": "minecraft:diamond_axe"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_hoe"
|
"item": "minecraft:diamond_hoe"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_pickaxe"
|
"item": "minecraft:diamond_pickaxe"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_shovel"
|
"item": "minecraft:diamond_shovel"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
"#T"
|
"#T"
|
||||||
],
|
],
|
||||||
"key": {
|
"key": {
|
||||||
"#": {
|
"T": {
|
||||||
"item": "computercraft:turtle_normal"
|
"item": "computercraft:turtle_normal"
|
||||||
},
|
},
|
||||||
"T": {
|
"#": {
|
||||||
"item": "minecraft:diamond_sword"
|
"item": "minecraft:diamond_sword"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
8
src/generated/resources/data/computercraft/tags/blocks/computer.json
generated
Normal file
8
src/generated/resources/data/computercraft/tags/blocks/computer.json
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"computercraft:computer_normal",
|
||||||
|
"computercraft:computer_advanced",
|
||||||
|
"computercraft:computer_command"
|
||||||
|
]
|
||||||
|
}
|
7
src/generated/resources/data/computercraft/tags/blocks/monitor.json
generated
Normal file
7
src/generated/resources/data/computercraft/tags/blocks/monitor.json
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"computercraft:monitor_normal",
|
||||||
|
"computercraft:monitor_advanced"
|
||||||
|
]
|
||||||
|
}
|
7
src/generated/resources/data/computercraft/tags/blocks/turtle.json
generated
Normal file
7
src/generated/resources/data/computercraft/tags/blocks/turtle.json
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"computercraft:turtle_normal",
|
||||||
|
"computercraft:turtle_advanced"
|
||||||
|
]
|
||||||
|
}
|
8
src/generated/resources/data/computercraft/tags/blocks/turtle_always_breakable.json
generated
Normal file
8
src/generated/resources/data/computercraft/tags/blocks/turtle_always_breakable.json
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#minecraft:leaves",
|
||||||
|
"minecraft:bamboo",
|
||||||
|
"minecraft:bamboo_sapling"
|
||||||
|
]
|
||||||
|
}
|
11
src/generated/resources/data/computercraft/tags/blocks/turtle_hoe_harvestable.json
generated
Normal file
11
src/generated/resources/data/computercraft/tags/blocks/turtle_hoe_harvestable.json
generated
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#minecraft:crops",
|
||||||
|
"minecraft:cactus",
|
||||||
|
"minecraft:melon",
|
||||||
|
"minecraft:pumpkin",
|
||||||
|
"minecraft:carved_pumpkin",
|
||||||
|
"minecraft:jack_o_lantern"
|
||||||
|
]
|
||||||
|
}
|
9
src/generated/resources/data/computercraft/tags/blocks/turtle_shovel_harvestable.json
generated
Normal file
9
src/generated/resources/data/computercraft/tags/blocks/turtle_shovel_harvestable.json
generated
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"minecraft:melon",
|
||||||
|
"minecraft:pumpkin",
|
||||||
|
"minecraft:carved_pumpkin",
|
||||||
|
"minecraft:jack_o_lantern"
|
||||||
|
]
|
||||||
|
}
|
7
src/generated/resources/data/computercraft/tags/blocks/turtle_sword_harvestable.json
generated
Normal file
7
src/generated/resources/data/computercraft/tags/blocks/turtle_sword_harvestable.json
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"#minecraft:wool",
|
||||||
|
"minecraft:cobweb"
|
||||||
|
]
|
||||||
|
}
|
7
src/generated/resources/data/computercraft/tags/blocks/wired_modem.json
generated
Normal file
7
src/generated/resources/data/computercraft/tags/blocks/wired_modem.json
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"computercraft:cable",
|
||||||
|
"computercraft:wired_modem_full"
|
||||||
|
]
|
||||||
|
}
|
@ -9,7 +9,7 @@ import net.minecraft.client.Minecraft;
|
|||||||
import net.minecraft.client.resources.sounds.AbstractSoundInstance;
|
import net.minecraft.client.resources.sounds.AbstractSoundInstance;
|
||||||
import net.minecraft.client.resources.sounds.SoundInstance;
|
import net.minecraft.client.resources.sounds.SoundInstance;
|
||||||
import net.minecraft.client.resources.sounds.TickableSoundInstance;
|
import net.minecraft.client.resources.sounds.TickableSoundInstance;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.sounds.SoundSource;
|
import net.minecraft.sounds.SoundSource;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ public class SoundManager
|
|||||||
{
|
{
|
||||||
private static final Map<UUID, MoveableSound> sounds = new HashMap<>();
|
private static final Map<UUID, MoveableSound> sounds = new HashMap<>();
|
||||||
|
|
||||||
public static void playSound( UUID source, Vec3 position, SoundEvent event, float volume, float pitch )
|
public static void playSound( UUID source, Vec3 position, ResourceLocation event, float volume, float pitch )
|
||||||
{
|
{
|
||||||
var soundManager = Minecraft.getInstance().getSoundManager();
|
var soundManager = Minecraft.getInstance().getSoundManager();
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class SoundManager
|
|||||||
|
|
||||||
private static class MoveableSound extends AbstractSoundInstance implements TickableSoundInstance
|
private static class MoveableSound extends AbstractSoundInstance implements TickableSoundInstance
|
||||||
{
|
{
|
||||||
protected MoveableSound( SoundEvent sound, Vec3 position, float volume, float pitch )
|
protected MoveableSound( ResourceLocation sound, Vec3 position, float volume, float pitch )
|
||||||
{
|
{
|
||||||
super( sound, SoundSource.RECORDS );
|
super( sound, SoundSource.RECORDS );
|
||||||
setPosition( position );
|
setPosition( position );
|
||||||
|
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
||||||
|
* Copyright Daniel Ratcliffe, 2011-2021. Do not distribute without permission.
|
||||||
|
* Send enquiries to dratcliffe@gmail.com
|
||||||
|
*/
|
||||||
|
package dan200.computercraft.data;
|
||||||
|
|
||||||
|
import dan200.computercraft.ComputerCraft;
|
||||||
|
import dan200.computercraft.shared.Registry;
|
||||||
|
import net.minecraft.data.DataGenerator;
|
||||||
|
import net.minecraft.data.tags.BlockTagsProvider;
|
||||||
|
import net.minecraft.tags.BlockTags;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||||
|
|
||||||
|
import static dan200.computercraft.shared.ComputerCraftTags.Blocks.*;
|
||||||
|
|
||||||
|
public class BlockTagsGenerator extends BlockTagsProvider
|
||||||
|
{
|
||||||
|
public BlockTagsGenerator( DataGenerator generator, ExistingFileHelper helper )
|
||||||
|
{
|
||||||
|
super( generator, ComputerCraft.MOD_ID, helper );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
|
protected void addTags()
|
||||||
|
{
|
||||||
|
// Items
|
||||||
|
tag( COMPUTER ).add(
|
||||||
|
Registry.ModBlocks.COMPUTER_NORMAL.get(),
|
||||||
|
Registry.ModBlocks.COMPUTER_ADVANCED.get(),
|
||||||
|
Registry.ModBlocks.COMPUTER_COMMAND.get()
|
||||||
|
);
|
||||||
|
tag( TURTLE ).add( Registry.ModBlocks.TURTLE_NORMAL.get(), Registry.ModBlocks.TURTLE_ADVANCED.get() );
|
||||||
|
tag( WIRED_MODEM ).add( Registry.ModBlocks.CABLE.get(), Registry.ModBlocks.WIRED_MODEM_FULL.get() );
|
||||||
|
tag( MONITOR ).add( Registry.ModBlocks.MONITOR_NORMAL.get(), Registry.ModBlocks.MONITOR_ADVANCED.get() );
|
||||||
|
|
||||||
|
tag( TURTLE_ALWAYS_BREAKABLE ).addTags( BlockTags.LEAVES ).add(
|
||||||
|
Blocks.BAMBOO, Blocks.BAMBOO_SAPLING // Bamboo isn't instabreak for some odd reason.
|
||||||
|
);
|
||||||
|
|
||||||
|
tag( TURTLE_SHOVEL_BREAKABLE ).addTag( BlockTags.MINEABLE_WITH_SHOVEL ).add(
|
||||||
|
Blocks.MELON,
|
||||||
|
Blocks.PUMPKIN,
|
||||||
|
Blocks.CARVED_PUMPKIN,
|
||||||
|
Blocks.JACK_O_LANTERN
|
||||||
|
);
|
||||||
|
|
||||||
|
tag( TURTLE_HOE_BREAKABLE ).addTags(
|
||||||
|
BlockTags.CROPS,
|
||||||
|
BlockTags.MINEABLE_WITH_HOE
|
||||||
|
).add(
|
||||||
|
Blocks.CACTUS,
|
||||||
|
Blocks.MELON,
|
||||||
|
Blocks.PUMPKIN,
|
||||||
|
Blocks.CARVED_PUMPKIN,
|
||||||
|
Blocks.JACK_O_LANTERN
|
||||||
|
);
|
||||||
|
|
||||||
|
tag( TURTLE_SWORD_BREAKABLE ).addTags( BlockTags.WOOL ).add( Blocks.COBWEB );
|
||||||
|
}
|
||||||
|
}
|
@ -7,6 +7,7 @@ package dan200.computercraft.data;
|
|||||||
|
|
||||||
import dan200.computercraft.shared.Registry;
|
import dan200.computercraft.shared.Registry;
|
||||||
import net.minecraft.data.DataGenerator;
|
import net.minecraft.data.DataGenerator;
|
||||||
|
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.Mod;
|
import net.minecraftforge.fml.common.Mod;
|
||||||
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;
|
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;
|
||||||
@ -20,9 +21,14 @@ public class Generators
|
|||||||
Registry.registerLoot();
|
Registry.registerLoot();
|
||||||
|
|
||||||
DataGenerator generator = event.getGenerator();
|
DataGenerator generator = event.getGenerator();
|
||||||
generator.addProvider( new Recipes( generator ) );
|
ExistingFileHelper existingFiles = event.getExistingFileHelper();
|
||||||
generator.addProvider( new LootTables( generator ) );
|
|
||||||
generator.addProvider( new Tags( generator, event.getExistingFileHelper() ) );
|
generator.addProvider( new RecipeGenerator( generator ) );
|
||||||
generator.addProvider( new BlockModelProvider( generator, event.getExistingFileHelper() ) );
|
generator.addProvider( new LootTableGenerator( generator ) );
|
||||||
|
generator.addProvider( new BlockModelProvider( generator, existingFiles ) );
|
||||||
|
|
||||||
|
BlockTagsGenerator blockTags = new BlockTagsGenerator( generator, existingFiles );
|
||||||
|
generator.addProvider( blockTags );
|
||||||
|
generator.addProvider( new ItemTagsGenerator( generator, blockTags, existingFiles ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
||||||
|
* Copyright Daniel Ratcliffe, 2011-2021. Do not distribute without permission.
|
||||||
|
* Send enquiries to dratcliffe@gmail.com
|
||||||
|
*/
|
||||||
|
package dan200.computercraft.data;
|
||||||
|
|
||||||
|
import dan200.computercraft.ComputerCraft;
|
||||||
|
import dan200.computercraft.shared.ComputerCraftTags.Blocks;
|
||||||
|
import dan200.computercraft.shared.Registry;
|
||||||
|
import net.minecraft.data.DataGenerator;
|
||||||
|
import net.minecraft.data.tags.ItemTagsProvider;
|
||||||
|
import net.minecraft.tags.ItemTags;
|
||||||
|
import net.minecraftforge.common.data.ExistingFileHelper;
|
||||||
|
|
||||||
|
import static dan200.computercraft.shared.ComputerCraftTags.Items.*;
|
||||||
|
|
||||||
|
public class ItemTagsGenerator extends ItemTagsProvider
|
||||||
|
{
|
||||||
|
public ItemTagsGenerator( DataGenerator generator, BlockTagsGenerator blockTags, ExistingFileHelper helper )
|
||||||
|
{
|
||||||
|
super( generator, blockTags, ComputerCraft.MOD_ID, helper );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addTags()
|
||||||
|
{
|
||||||
|
copy( Blocks.COMPUTER, COMPUTER );
|
||||||
|
copy( Blocks.TURTLE, TURTLE );
|
||||||
|
tag( WIRED_MODEM ).add( Registry.ModItems.WIRED_MODEM.get(), Registry.ModItems.WIRED_MODEM_FULL.get() );
|
||||||
|
copy( Blocks.MONITOR, MONITOR );
|
||||||
|
|
||||||
|
tag( ItemTags.PIGLIN_LOVED ).add(
|
||||||
|
Registry.ModItems.COMPUTER_ADVANCED.get(), Registry.ModItems.TURTLE_ADVANCED.get(),
|
||||||
|
Registry.ModItems.WIRELESS_MODEM_ADVANCED.get(), Registry.ModItems.POCKET_COMPUTER_ADVANCED.get(),
|
||||||
|
Registry.ModItems.MONITOR_ADVANCED.get()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -30,9 +30,9 @@ import net.minecraftforge.fmllegacy.RegistryObject;
|
|||||||
|
|
||||||
import java.util.function.BiConsumer;
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
public class LootTables extends LootTableProvider
|
public class LootTableGenerator extends LootTableProvider
|
||||||
{
|
{
|
||||||
public LootTables( DataGenerator generator )
|
public LootTableGenerator( DataGenerator generator )
|
||||||
{
|
{
|
||||||
super( generator );
|
super( generator );
|
||||||
}
|
}
|
@ -6,7 +6,6 @@
|
|||||||
package dan200.computercraft.data;
|
package dan200.computercraft.data;
|
||||||
|
|
||||||
import dan200.computercraft.ComputerCraft;
|
import dan200.computercraft.ComputerCraft;
|
||||||
import dan200.computercraft.data.Tags.CCTags;
|
|
||||||
import dan200.computercraft.shared.PocketUpgrades;
|
import dan200.computercraft.shared.PocketUpgrades;
|
||||||
import dan200.computercraft.shared.Registry;
|
import dan200.computercraft.shared.Registry;
|
||||||
import dan200.computercraft.shared.TurtleUpgrades;
|
import dan200.computercraft.shared.TurtleUpgrades;
|
||||||
@ -40,9 +39,12 @@ import javax.annotation.Nonnull;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
public class Recipes extends RecipeProvider
|
import static dan200.computercraft.shared.ComputerCraftTags.Items.COMPUTER;
|
||||||
|
import static dan200.computercraft.shared.ComputerCraftTags.Items.WIRED_MODEM;
|
||||||
|
|
||||||
|
public class RecipeGenerator extends RecipeProvider
|
||||||
{
|
{
|
||||||
public Recipes( DataGenerator generator )
|
public RecipeGenerator( DataGenerator generator )
|
||||||
{
|
{
|
||||||
super( generator );
|
super( generator );
|
||||||
}
|
}
|
||||||
@ -105,8 +107,8 @@ public class Recipes extends RecipeProvider
|
|||||||
.shaped( result.getItem() )
|
.shaped( result.getItem() )
|
||||||
.group( String.format( "%s:turtle_%s", ComputerCraft.MOD_ID, nameId ) )
|
.group( String.format( "%s:turtle_%s", ComputerCraft.MOD_ID, nameId ) )
|
||||||
.pattern( "#T" )
|
.pattern( "#T" )
|
||||||
.define( '#', base.getItem() )
|
.define( 'T', base.getItem() )
|
||||||
.define( 'T', upgrade.getCraftingItem().getItem() )
|
.define( '#', upgrade.getCraftingItem().getItem() )
|
||||||
.unlockedBy( "has_items",
|
.unlockedBy( "has_items",
|
||||||
inventoryChange( base.getItem(), upgrade.getCraftingItem().getItem() ) )
|
inventoryChange( base.getItem(), upgrade.getCraftingItem().getItem() ) )
|
||||||
.save(
|
.save(
|
||||||
@ -134,14 +136,14 @@ public class Recipes extends RecipeProvider
|
|||||||
String nameId = family.name().toLowerCase( Locale.ROOT );
|
String nameId = family.name().toLowerCase( Locale.ROOT );
|
||||||
|
|
||||||
PocketUpgrades.getVanillaUpgrades().forEach( upgrade -> {
|
PocketUpgrades.getVanillaUpgrades().forEach( upgrade -> {
|
||||||
ItemStack result = PocketComputerItemFactory.create( -1, null, -1, family, null );
|
ItemStack result = PocketComputerItemFactory.create( -1, null, -1, family, upgrade );
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
.shaped( result.getItem() )
|
.shaped( result.getItem() )
|
||||||
.group( String.format( "%s:pocket_%s", ComputerCraft.MOD_ID, nameId ) )
|
.group( String.format( "%s:pocket_%s", ComputerCraft.MOD_ID, nameId ) )
|
||||||
.pattern( "#" )
|
.pattern( "#" )
|
||||||
.pattern( "P" )
|
.pattern( "P" )
|
||||||
.define( '#', base.getItem() )
|
.define( 'P', base.getItem() )
|
||||||
.define( 'P', upgrade.getCraftingItem().getItem() )
|
.define( '#', upgrade.getCraftingItem().getItem() )
|
||||||
.unlockedBy( "has_items",
|
.unlockedBy( "has_items",
|
||||||
inventoryChange( base.getItem(), upgrade.getCraftingItem().getItem() ) )
|
inventoryChange( base.getItem(), upgrade.getCraftingItem().getItem() ) )
|
||||||
.save(
|
.save(
|
||||||
@ -163,8 +165,8 @@ public class Recipes extends RecipeProvider
|
|||||||
.pattern( " # " )
|
.pattern( " # " )
|
||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.unlockedBy( "has_modem", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_modem", inventoryChange( WIRED_MODEM ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -207,7 +209,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.pattern( "#R#" )
|
.pattern( "#R#" )
|
||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -217,7 +219,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.pattern( "###" )
|
.pattern( "###" )
|
||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'G', Tags.Items.GLASS_PANES )
|
.define( 'G', Tags.Items.GLASS_PANES )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -227,7 +229,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.pattern( "###" )
|
.pattern( "###" )
|
||||||
.define( '#', Tags.Items.INGOTS_GOLD )
|
.define( '#', Tags.Items.INGOTS_GOLD )
|
||||||
.define( 'G', Tags.Items.GLASS_PANES )
|
.define( 'G', Tags.Items.GLASS_PANES )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -238,7 +240,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'A', Items.GOLDEN_APPLE )
|
.define( 'A', Items.GOLDEN_APPLE )
|
||||||
.define( 'G', Tags.Items.GLASS_PANES )
|
.define( 'G', Tags.Items.GLASS_PANES )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.unlockedBy( "has_apple", inventoryChange( Items.GOLDEN_APPLE ) )
|
.unlockedBy( "has_apple", inventoryChange( Items.GOLDEN_APPLE ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
@ -250,7 +252,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.define( '#', Tags.Items.INGOTS_GOLD )
|
.define( '#', Tags.Items.INGOTS_GOLD )
|
||||||
.define( 'A', Items.GOLDEN_APPLE )
|
.define( 'A', Items.GOLDEN_APPLE )
|
||||||
.define( 'G', Tags.Items.GLASS_PANES )
|
.define( 'G', Tags.Items.GLASS_PANES )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.unlockedBy( "has_apple", inventoryChange( Items.GOLDEN_APPLE ) )
|
.unlockedBy( "has_apple", inventoryChange( Items.GOLDEN_APPLE ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
@ -262,7 +264,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
||||||
.define( 'D', Tags.Items.DYES )
|
.define( 'D', Tags.Items.DYES )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -273,7 +275,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'N', Blocks.NOTE_BLOCK )
|
.define( 'N', Blocks.NOTE_BLOCK )
|
||||||
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -283,19 +285,19 @@ public class Recipes extends RecipeProvider
|
|||||||
.pattern( "###" )
|
.pattern( "###" )
|
||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
.define( 'R', Tags.Items.DUSTS_REDSTONE )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.unlockedBy( "has_cable", inventoryChange( Registry.ModItems.CABLE.get() ) )
|
.unlockedBy( "has_cable", inventoryChange( Registry.ModItems.CABLE.get() ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapelessRecipeBuilder
|
ShapelessRecipeBuilder
|
||||||
.shapeless( Registry.ModBlocks.WIRED_MODEM_FULL.get() )
|
.shapeless( Registry.ModBlocks.WIRED_MODEM_FULL.get() )
|
||||||
.requires( Registry.ModItems.WIRED_MODEM.get() )
|
.requires( Registry.ModItems.WIRED_MODEM.get() )
|
||||||
.unlockedBy( "has_modem", inventoryChange( CCTags.WIRED_MODEM ) )
|
.unlockedBy( "has_modem", inventoryChange( WIRED_MODEM ) )
|
||||||
.save( add, new ResourceLocation( ComputerCraft.MOD_ID, "wired_modem_full_from" ) );
|
.save( add, new ResourceLocation( ComputerCraft.MOD_ID, "wired_modem_full_from" ) );
|
||||||
ShapelessRecipeBuilder
|
ShapelessRecipeBuilder
|
||||||
.shapeless( Registry.ModItems.WIRED_MODEM.get() )
|
.shapeless( Registry.ModItems.WIRED_MODEM.get() )
|
||||||
.requires( Registry.ModBlocks.WIRED_MODEM_FULL.get() )
|
.requires( Registry.ModBlocks.WIRED_MODEM_FULL.get() )
|
||||||
.unlockedBy( "has_modem", inventoryChange( CCTags.WIRED_MODEM ) )
|
.unlockedBy( "has_modem", inventoryChange( WIRED_MODEM ) )
|
||||||
.save( add, new ResourceLocation( ComputerCraft.MOD_ID, "wired_modem_full_to" ) );
|
.save( add, new ResourceLocation( ComputerCraft.MOD_ID, "wired_modem_full_to" ) );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -305,7 +307,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.pattern( "###" )
|
.pattern( "###" )
|
||||||
.define( '#', Tags.Items.STONE )
|
.define( '#', Tags.Items.STONE )
|
||||||
.define( 'E', Tags.Items.ENDER_PEARLS )
|
.define( 'E', Tags.Items.ENDER_PEARLS )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
||||||
ShapedRecipeBuilder
|
ShapedRecipeBuilder
|
||||||
@ -315,7 +317,7 @@ public class Recipes extends RecipeProvider
|
|||||||
.pattern( "###" )
|
.pattern( "###" )
|
||||||
.define( '#', Tags.Items.INGOTS_GOLD )
|
.define( '#', Tags.Items.INGOTS_GOLD )
|
||||||
.define( 'E', Items.ENDER_EYE )
|
.define( 'E', Items.ENDER_EYE )
|
||||||
.unlockedBy( "has_computer", inventoryChange( CCTags.COMPUTER ) )
|
.unlockedBy( "has_computer", inventoryChange( COMPUTER ) )
|
||||||
.unlockedBy( "has_wireless", inventoryChange( Registry.ModBlocks.WIRELESS_MODEM_NORMAL.get() ) )
|
.unlockedBy( "has_wireless", inventoryChange( Registry.ModBlocks.WIRELESS_MODEM_NORMAL.get() ) )
|
||||||
.save( add );
|
.save( add );
|
||||||
|
|
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of ComputerCraft - http://www.computercraft.info
|
|
||||||
* Copyright Daniel Ratcliffe, 2011-2021. Do not distribute without permission.
|
|
||||||
* Send enquiries to dratcliffe@gmail.com
|
|
||||||
*/
|
|
||||||
package dan200.computercraft.data;
|
|
||||||
|
|
||||||
import dan200.computercraft.ComputerCraft;
|
|
||||||
import dan200.computercraft.shared.Registry;
|
|
||||||
import net.minecraft.data.DataGenerator;
|
|
||||||
import net.minecraft.data.tags.BlockTagsProvider;
|
|
||||||
import net.minecraft.data.tags.ItemTagsProvider;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
|
||||||
import net.minecraft.tags.ItemTags;
|
|
||||||
import net.minecraft.tags.Tag;
|
|
||||||
import net.minecraft.world.item.Item;
|
|
||||||
import net.minecraftforge.common.data.ExistingFileHelper;
|
|
||||||
|
|
||||||
import static dan200.computercraft.data.Tags.CCTags.*;
|
|
||||||
|
|
||||||
public class Tags extends ItemTagsProvider
|
|
||||||
{
|
|
||||||
private static final Tag.Named<Item> PIGLIN_LOVED = ItemTags.PIGLIN_LOVED;
|
|
||||||
|
|
||||||
public static class CCTags
|
|
||||||
{
|
|
||||||
public static final Tag.Named<Item> COMPUTER = item( "computer" );
|
|
||||||
public static final Tag.Named<Item> TURTLE = item( "turtle" );
|
|
||||||
public static final Tag.Named<Item> WIRED_MODEM = item( "wired_modem" );
|
|
||||||
public static final Tag.Named<Item> MONITOR = item( "monitor" );
|
|
||||||
}
|
|
||||||
|
|
||||||
public Tags( DataGenerator generator, ExistingFileHelper helper )
|
|
||||||
{
|
|
||||||
super( generator, new BlockTagsProvider( generator, ComputerCraft.MOD_ID, helper ), ComputerCraft.MOD_ID, helper );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void addTags()
|
|
||||||
{
|
|
||||||
tag( COMPUTER ).add(
|
|
||||||
Registry.ModItems.COMPUTER_NORMAL.get(),
|
|
||||||
Registry.ModItems.COMPUTER_ADVANCED.get(),
|
|
||||||
Registry.ModItems.COMPUTER_COMMAND.get()
|
|
||||||
);
|
|
||||||
tag( TURTLE ).add( Registry.ModItems.TURTLE_NORMAL.get(), Registry.ModItems.TURTLE_ADVANCED.get() );
|
|
||||||
tag( WIRED_MODEM ).add( Registry.ModItems.WIRED_MODEM.get(), Registry.ModItems.WIRED_MODEM_FULL.get() );
|
|
||||||
tag( MONITOR ).add( Registry.ModItems.MONITOR_NORMAL.get(), Registry.ModItems.MONITOR_ADVANCED.get() );
|
|
||||||
|
|
||||||
tag( PIGLIN_LOVED ).add(
|
|
||||||
Registry.ModItems.COMPUTER_ADVANCED.get(), Registry.ModItems.TURTLE_ADVANCED.get(),
|
|
||||||
Registry.ModItems.WIRELESS_MODEM_ADVANCED.get(), Registry.ModItems.POCKET_COMPUTER_ADVANCED.get(),
|
|
||||||
Registry.ModItems.MONITOR_ADVANCED.get()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Tag.Named<Item> item( String name )
|
|
||||||
{
|
|
||||||
return ItemTags.bind( new ResourceLocation( ComputerCraft.MOD_ID, name ).toString() );
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
||||||
|
* Copyright Daniel Ratcliffe, 2011-2021. Do not distribute without permission.
|
||||||
|
* Send enquiries to dratcliffe@gmail.com
|
||||||
|
*/
|
||||||
|
package dan200.computercraft.shared;
|
||||||
|
|
||||||
|
import dan200.computercraft.ComputerCraft;
|
||||||
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.tags.BlockTags;
|
||||||
|
import net.minecraft.tags.ItemTags;
|
||||||
|
import net.minecraft.tags.Tag;
|
||||||
|
import net.minecraft.world.item.Item;
|
||||||
|
import net.minecraft.world.level.block.Block;
|
||||||
|
|
||||||
|
public class ComputerCraftTags
|
||||||
|
{
|
||||||
|
public static class Items
|
||||||
|
{
|
||||||
|
public static final Tag.Named<Item> COMPUTER = make( "computer" );
|
||||||
|
public static final Tag.Named<Item> TURTLE = make( "turtle" );
|
||||||
|
public static final Tag.Named<Item> WIRED_MODEM = make( "wired_modem" );
|
||||||
|
public static final Tag.Named<Item> MONITOR = make( "monitor" );
|
||||||
|
|
||||||
|
private static Tag.Named<Item> make( String name )
|
||||||
|
{
|
||||||
|
return ItemTags.bind( new ResourceLocation( ComputerCraft.MOD_ID, name ).toString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Blocks
|
||||||
|
{
|
||||||
|
public static final Tag.Named<Block> COMPUTER = make( "computer" );
|
||||||
|
public static final Tag.Named<Block> TURTLE = make( "turtle" );
|
||||||
|
public static final Tag.Named<Block> WIRED_MODEM = make( "wired_modem" );
|
||||||
|
public static final Tag.Named<Block> MONITOR = make( "monitor" );
|
||||||
|
|
||||||
|
public static final Tag.Named<Block> TURTLE_ALWAYS_BREAKABLE = make( "turtle_always_breakable" );
|
||||||
|
public static final Tag.Named<Block> TURTLE_SHOVEL_BREAKABLE = make( "turtle_shovel_harvestable" );
|
||||||
|
public static final Tag.Named<Block> TURTLE_SWORD_BREAKABLE = make( "turtle_sword_harvestable" );
|
||||||
|
public static final Tag.Named<Block> TURTLE_HOE_BREAKABLE = make( "turtle_hoe_harvestable" );
|
||||||
|
|
||||||
|
private static Tag.Named<Block> make( String name )
|
||||||
|
{
|
||||||
|
return BlockTags.bind( new ResourceLocation( ComputerCraft.MOD_ID, name ).toString() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -341,6 +341,7 @@ public final class Config
|
|||||||
ComputerCraft.httpMaxRequests = httpMaxRequests.get();
|
ComputerCraft.httpMaxRequests = httpMaxRequests.get();
|
||||||
ComputerCraft.httpMaxWebsockets = httpMaxWebsockets.get();
|
ComputerCraft.httpMaxWebsockets = httpMaxWebsockets.get();
|
||||||
ComputerCraft.httpDownloadBandwidth = httpDownloadBandwidth.get();
|
ComputerCraft.httpDownloadBandwidth = httpDownloadBandwidth.get();
|
||||||
|
ComputerCraft.httpUploadBandwidth = httpUploadBandwidth.get();
|
||||||
NetworkUtils.reloadConfig();
|
NetworkUtils.reloadConfig();
|
||||||
|
|
||||||
// Peripheral
|
// Peripheral
|
||||||
|
@ -9,12 +9,10 @@ import dan200.computercraft.client.SoundManager;
|
|||||||
import dan200.computercraft.shared.network.NetworkMessage;
|
import dan200.computercraft.shared.network.NetworkMessage;
|
||||||
import net.minecraft.network.FriendlyByteBuf;
|
import net.minecraft.network.FriendlyByteBuf;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.fmllegacy.network.NetworkEvent;
|
import net.minecraftforge.fmllegacy.network.NetworkEvent;
|
||||||
import net.minecraftforge.registries.ForgeRegistries;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -68,7 +66,6 @@ public class SpeakerPlayClientMessage implements NetworkMessage
|
|||||||
@OnlyIn( Dist.CLIENT )
|
@OnlyIn( Dist.CLIENT )
|
||||||
public void handle( NetworkEvent.Context context )
|
public void handle( NetworkEvent.Context context )
|
||||||
{
|
{
|
||||||
SoundEvent sound = ForgeRegistries.SOUND_EVENTS.getValue( this.sound );
|
SoundManager.playSound( source, pos, sound, volume, pitch );
|
||||||
if( sound != null ) SoundManager.playSound( source, pos, sound, volume, pitch );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,8 @@ import javax.annotation.Nonnull;
|
|||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
|
|
||||||
import static dan200.computercraft.shared.util.WaterloggableHelpers.*;
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.WATERLOGGED;
|
||||||
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.getFluidStateForPlacement;
|
||||||
|
|
||||||
public class BlockCable extends BlockGeneric implements SimpleWaterloggedBlock
|
public class BlockCable extends BlockGeneric implements SimpleWaterloggedBlock
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,8 @@ import net.minecraftforge.fmllegacy.RegistryObject;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import static dan200.computercraft.shared.util.WaterloggableHelpers.*;
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.WATERLOGGED;
|
||||||
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.getFluidStateForPlacement;
|
||||||
|
|
||||||
public class BlockWirelessModem extends BlockGeneric implements SimpleWaterloggedBlock
|
public class BlockWirelessModem extends BlockGeneric implements SimpleWaterloggedBlock
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,8 @@ import net.minecraftforge.fmllegacy.RegistryObject;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import static dan200.computercraft.shared.util.WaterloggableHelpers.*;
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.WATERLOGGED;
|
||||||
|
import static dan200.computercraft.shared.util.WaterloggableHelpers.getFluidStateForPlacement;
|
||||||
|
|
||||||
public class BlockTurtle extends BlockComputerBase<TileTurtle> implements SimpleWaterloggedBlock
|
public class BlockTurtle extends BlockComputerBase<TileTurtle> implements SimpleWaterloggedBlock
|
||||||
{
|
{
|
||||||
|
@ -9,6 +9,7 @@ import dan200.computercraft.api.turtle.ITurtleAccess;
|
|||||||
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||||
import dan200.computercraft.api.turtle.TurtleSide;
|
import dan200.computercraft.api.turtle.TurtleSide;
|
||||||
import dan200.computercraft.api.turtle.TurtleVerb;
|
import dan200.computercraft.api.turtle.TurtleVerb;
|
||||||
|
import dan200.computercraft.shared.ComputerCraftTags;
|
||||||
import dan200.computercraft.shared.turtle.core.TurtlePlaceCommand;
|
import dan200.computercraft.shared.turtle.core.TurtlePlaceCommand;
|
||||||
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@ -18,7 +19,6 @@ import net.minecraft.world.item.Item;
|
|||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.Material;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@ -40,17 +40,14 @@ public class TurtleHoe extends TurtleTool
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canBreakBlock( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
protected TurtleCommandResult checkBlockBreakable( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
||||||
{
|
{
|
||||||
if( !super.canBreakBlock( state, world, pos, player ) ) return false;
|
TurtleCommandResult result = super.checkBlockBreakable( state, world, pos, player );
|
||||||
|
if( !result.isSuccess() ) return result;
|
||||||
|
|
||||||
Material material = state.getMaterial();
|
return state.is( ComputerCraftTags.Blocks.TURTLE_HOE_BREAKABLE )
|
||||||
return material == Material.PLANT ||
|
|| isTriviallyBreakable( world, pos, state )
|
||||||
material == Material.CACTUS ||
|
? result : INEFFECTIVE;
|
||||||
material == Material.VEGETABLE ||
|
|
||||||
material == Material.LEAVES ||
|
|
||||||
material == Material.WATER_PLANT ||
|
|
||||||
material == Material.REPLACEABLE_PLANT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -9,6 +9,7 @@ import dan200.computercraft.api.turtle.ITurtleAccess;
|
|||||||
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||||
import dan200.computercraft.api.turtle.TurtleSide;
|
import dan200.computercraft.api.turtle.TurtleSide;
|
||||||
import dan200.computercraft.api.turtle.TurtleVerb;
|
import dan200.computercraft.api.turtle.TurtleVerb;
|
||||||
|
import dan200.computercraft.shared.ComputerCraftTags;
|
||||||
import dan200.computercraft.shared.turtle.core.TurtlePlaceCommand;
|
import dan200.computercraft.shared.turtle.core.TurtlePlaceCommand;
|
||||||
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
@ -18,7 +19,6 @@ import net.minecraft.world.item.Item;
|
|||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.Material;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
@ -40,21 +40,14 @@ public class TurtleShovel extends TurtleTool
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canBreakBlock( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
protected TurtleCommandResult checkBlockBreakable( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
||||||
{
|
{
|
||||||
if( !super.canBreakBlock( state, world, pos, player ) ) return false;
|
TurtleCommandResult result = super.checkBlockBreakable( state, world, pos, player );
|
||||||
|
if( !result.isSuccess() ) return result;
|
||||||
|
|
||||||
Material material = state.getMaterial();
|
return state.is( ComputerCraftTags.Blocks.TURTLE_SHOVEL_BREAKABLE )
|
||||||
return material == Material.DIRT ||
|
|| isTriviallyBreakable( world, pos, state )
|
||||||
material == Material.SAND ||
|
? result : INEFFECTIVE;
|
||||||
material == Material.TOP_SNOW ||
|
|
||||||
material == Material.CLAY ||
|
|
||||||
material == Material.SNOW ||
|
|
||||||
material == Material.PLANT ||
|
|
||||||
material == Material.CACTUS ||
|
|
||||||
material == Material.VEGETABLE ||
|
|
||||||
material == Material.LEAVES ||
|
|
||||||
material == Material.REPLACEABLE_PLANT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
package dan200.computercraft.shared.turtle.upgrades;
|
package dan200.computercraft.shared.turtle.upgrades;
|
||||||
|
|
||||||
|
import dan200.computercraft.api.turtle.TurtleCommandResult;
|
||||||
|
import dan200.computercraft.shared.ComputerCraftTags;
|
||||||
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@ -12,7 +14,6 @@ import net.minecraft.world.item.Item;
|
|||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.material.Material;
|
|
||||||
|
|
||||||
public class TurtleSword extends TurtleTool
|
public class TurtleSword extends TurtleTool
|
||||||
{
|
{
|
||||||
@ -32,16 +33,14 @@ public class TurtleSword extends TurtleTool
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canBreakBlock( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
protected TurtleCommandResult checkBlockBreakable( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
||||||
{
|
{
|
||||||
if( !super.canBreakBlock( state, world, pos, player ) ) return false;
|
TurtleCommandResult result = super.checkBlockBreakable( state, world, pos, player );
|
||||||
|
if( !result.isSuccess() ) return result;
|
||||||
|
|
||||||
Material material = state.getMaterial();
|
return state.is( ComputerCraftTags.Blocks.TURTLE_SWORD_BREAKABLE )
|
||||||
return material == Material.PLANT ||
|
|| isTriviallyBreakable( world, pos, state )
|
||||||
material == Material.LEAVES ||
|
? result : INEFFECTIVE;
|
||||||
material == Material.REPLACEABLE_PLANT ||
|
|
||||||
material == Material.WOOL ||
|
|
||||||
material == Material.WEB;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -10,6 +10,7 @@ import com.mojang.math.Transformation;
|
|||||||
import dan200.computercraft.ComputerCraft;
|
import dan200.computercraft.ComputerCraft;
|
||||||
import dan200.computercraft.api.client.TransformedModel;
|
import dan200.computercraft.api.client.TransformedModel;
|
||||||
import dan200.computercraft.api.turtle.*;
|
import dan200.computercraft.api.turtle.*;
|
||||||
|
import dan200.computercraft.shared.ComputerCraftTags;
|
||||||
import dan200.computercraft.shared.TurtlePermissions;
|
import dan200.computercraft.shared.TurtlePermissions;
|
||||||
import dan200.computercraft.shared.turtle.core.TurtleBrain;
|
import dan200.computercraft.shared.turtle.core.TurtleBrain;
|
||||||
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
import dan200.computercraft.shared.turtle.core.TurtlePlayer;
|
||||||
@ -27,6 +28,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;
|
|||||||
import net.minecraft.world.entity.decoration.ArmorStand;
|
import net.minecraft.world.entity.decoration.ArmorStand;
|
||||||
import net.minecraft.world.item.Item;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
|
import net.minecraft.world.level.BlockGetter;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
import net.minecraft.world.level.block.Blocks;
|
||||||
@ -46,6 +48,9 @@ import java.util.function.Function;
|
|||||||
|
|
||||||
public class TurtleTool extends AbstractTurtleUpgrade
|
public class TurtleTool extends AbstractTurtleUpgrade
|
||||||
{
|
{
|
||||||
|
protected static final TurtleCommandResult UNBREAKABLE = TurtleCommandResult.failure( "Unbreakable block detected" );
|
||||||
|
protected static final TurtleCommandResult INEFFECTIVE = TurtleCommandResult.failure( "Cannot break block with this tool" );
|
||||||
|
|
||||||
protected final ItemStack item;
|
protected final ItemStack item;
|
||||||
|
|
||||||
public TurtleTool( ResourceLocation id, String adjective, Item item )
|
public TurtleTool( ResourceLocation id, String adjective, Item item )
|
||||||
@ -107,13 +112,14 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean canBreakBlock( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
protected TurtleCommandResult checkBlockBreakable( BlockState state, Level world, BlockPos pos, TurtlePlayer player )
|
||||||
{
|
{
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
return !state.isAir()
|
return !state.isAir()
|
||||||
&& block != Blocks.BEDROCK
|
&& block != Blocks.BEDROCK
|
||||||
&& state.getDestroyProgress( player, world, pos ) > 0
|
&& state.getDestroyProgress( player, world, pos ) > 0
|
||||||
&& block.canEntityDestroy( state, world, pos, player );
|
&& block.canEntityDestroy( state, world, pos, player )
|
||||||
|
? TurtleCommandResult.success() : UNBREAKABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getDamageMultiplier()
|
protected float getDamageMultiplier()
|
||||||
@ -158,6 +164,7 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
|||||||
{
|
{
|
||||||
float damage = (float) turtlePlayer.getAttributeValue( Attributes.ATTACK_DAMAGE );
|
float damage = (float) turtlePlayer.getAttributeValue( Attributes.ATTACK_DAMAGE );
|
||||||
damage *= getDamageMultiplier();
|
damage *= getDamageMultiplier();
|
||||||
|
ComputerCraft.log.info( "Dealing {} damage", damage );
|
||||||
if( damage > 0.0f )
|
if( damage > 0.0f )
|
||||||
{
|
{
|
||||||
DamageSource source = DamageSource.playerAttack( turtlePlayer );
|
DamageSource source = DamageSource.playerAttack( turtlePlayer );
|
||||||
@ -224,10 +231,8 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if we can break the block
|
// Check if we can break the block
|
||||||
if( !canBreakBlock( state, world, blockPosition, turtlePlayer ) )
|
TurtleCommandResult breakable = checkBlockBreakable( state, world, blockPosition, turtlePlayer );
|
||||||
{
|
if( !breakable.isSuccess() ) return breakable;
|
||||||
return TurtleCommandResult.failure( "Unbreakable block detected" );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Consume the items the block drops
|
// Consume the items the block drops
|
||||||
DropConsumer.set( world, blockPosition, turtleDropConsumer( turtleTile, turtle ) );
|
DropConsumer.set( world, blockPosition, turtleDropConsumer( turtleTile, turtle ) );
|
||||||
@ -281,4 +286,11 @@ public class TurtleTool extends AbstractTurtleUpgrade
|
|||||||
} ) );
|
} ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isTriviallyBreakable( BlockGetter reader, BlockPos pos, BlockState state )
|
||||||
|
{
|
||||||
|
return state.is( ComputerCraftTags.Blocks.TURTLE_ALWAYS_BREAKABLE )
|
||||||
|
// Allow breaking any "instabreak" block.
|
||||||
|
|| state.getDestroySpeed( reader, pos ) == 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,6 +97,7 @@ public final class DropConsumer
|
|||||||
if( dropEntity == null || drops.getEntity() != dropEntity ) return;
|
if( dropEntity == null || drops.getEntity() != dropEntity ) return;
|
||||||
|
|
||||||
for( ItemEntity drop : drops.getDrops() ) handleDrops( drop.getItem() );
|
for( ItemEntity drop : drops.getDrops() ) handleDrops( drop.getItem() );
|
||||||
|
drops.getDrops().clear();
|
||||||
drops.setCanceled( true );
|
drops.setCanceled( true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[37,38)"
|
loaderVersion="[37,38)"
|
||||||
|
|
||||||
issueTrackerURL="https://github.com/SquidDev-CC/CC-Tweaked/issues"
|
issueTrackerURL="https://github.com/cc-tweaked/CC-Tweaked/issues"
|
||||||
displayURL="https://github.com/SquidDev-CC/CC-Tweaked"
|
displayURL="https://github.com/cc-tweaked/CC-Tweaked"
|
||||||
logoFile="pack.png"
|
logoFile="pack.png"
|
||||||
|
|
||||||
credits="Created by Daniel Ratcliffe (@DanTwoHundred)"
|
credits="Created by Daniel Ratcliffe (@DanTwoHundred)"
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
"chat.computercraft.wired_modem.peripheral_connected": "Peripheral \"%s\" connected to network",
|
"chat.computercraft.wired_modem.peripheral_connected": "Peripheral \"%s\" connected to network",
|
||||||
"chat.computercraft.wired_modem.peripheral_disconnected": "Peripheral \"%s\" disconnected from network",
|
"chat.computercraft.wired_modem.peripheral_disconnected": "Peripheral \"%s\" disconnected from network",
|
||||||
"commands.computercraft.synopsis": "Various commands for controlling computers.",
|
"commands.computercraft.synopsis": "Various commands for controlling computers.",
|
||||||
"commands.computercraft.desc": "The /computercraft command provides various debugging and administrator tools for controlling and interacting with computers.",
|
"commands.computercraft.desc": "The /computercraft command provides various debugging and administrator tools for controlling and interacting with computers.",
|
||||||
"commands.computercraft.help.synopsis": "Provide help for a specific command",
|
"commands.computercraft.help.synopsis": "Provide help for a specific command",
|
||||||
"commands.computercraft.help.desc": "Displays this help message",
|
"commands.computercraft.help.desc": "Displays this help message",
|
||||||
"commands.computercraft.help.no_children": "%s has no sub-commands",
|
"commands.computercraft.help.no_children": "%s has no sub-commands",
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
"gui.computercraft.tooltip.terminate": "Arrêter le programme en cours d'éxecution",
|
"gui.computercraft.tooltip.terminate": "Arrêter le programme en cours d'éxecution",
|
||||||
"gui.computercraft.tooltip.terminate.key": "Tenir Ctrl+T",
|
"gui.computercraft.tooltip.terminate.key": "Tenir Ctrl+T",
|
||||||
"gui.computercraft.upload.overwrite": "Les fichiers seraient écrasés",
|
"gui.computercraft.upload.overwrite": "Les fichiers seraient écrasés",
|
||||||
"gui.computercraft.upload.overwrite.detail": "Les fichiers suivants seront écrasés lors de l'envoie. Continuer ?%s",
|
"gui.computercraft.upload.overwrite.detail": "Les fichiers suivants seront écrasés lors de l'envoie. Continuer?%s",
|
||||||
"gui.computercraft.upload.overwrite_button": "Écraser",
|
"gui.computercraft.upload.overwrite_button": "Écraser",
|
||||||
"gui.computercraft.upload.success": "Envoie avec succès",
|
"gui.computercraft.upload.success": "Envoie avec succès",
|
||||||
"gui.computercraft.upload.success.msg": "Le fichier %d est envoyé.",
|
"gui.computercraft.upload.success.msg": "Le fichier %d est envoyé.",
|
||||||
@ -125,7 +125,7 @@
|
|||||||
"gui.computercraft.upload.failed.computer_off": "Vous devez allumer cet ordinateur avant d'envoyer ce fichier.",
|
"gui.computercraft.upload.failed.computer_off": "Vous devez allumer cet ordinateur avant d'envoyer ce fichier.",
|
||||||
"gui.computercraft.upload.failed.too_much": "Votre fichier est trop lourd pour être envoyé.",
|
"gui.computercraft.upload.failed.too_much": "Votre fichier est trop lourd pour être envoyé.",
|
||||||
"gui.computercraft.upload.failed.overwrite_dir": "%s ne peut pas être envoyé, il y a déjà un dossier avec le même nom.",
|
"gui.computercraft.upload.failed.overwrite_dir": "%s ne peut pas être envoyé, il y a déjà un dossier avec le même nom.",
|
||||||
"gui.computercraft.upload.failed.generic": "Echec de l'envoie des fichiers(%s)",
|
"gui.computercraft.upload.failed.generic": "Echec de l'envoie des fichiers (%s)",
|
||||||
"commands.computercraft.dump.open_path": "Voir les fichiers de cet ordinateur",
|
"commands.computercraft.dump.open_path": "Voir les fichiers de cet ordinateur",
|
||||||
"gui.computercraft.tooltip.turn_on": "Allumer cet ordinateur"
|
"gui.computercraft.tooltip.turn_on": "Allumer cet ordinateur"
|
||||||
}
|
}
|
||||||
|
@ -127,5 +127,8 @@
|
|||||||
"gui.computercraft.upload.failed.generic": "Загрузка файлов не удалась (%s)",
|
"gui.computercraft.upload.failed.generic": "Загрузка файлов не удалась (%s)",
|
||||||
"gui.computercraft.upload.overwrite": "Файлы будут перезаписаны",
|
"gui.computercraft.upload.overwrite": "Файлы будут перезаписаны",
|
||||||
"gui.computercraft.upload.overwrite.detail": "При загрузке следующие файлы будут перезаписаны. Продолжить?%s",
|
"gui.computercraft.upload.overwrite.detail": "При загрузке следующие файлы будут перезаписаны. Продолжить?%s",
|
||||||
"gui.computercraft.upload.overwrite_button": "Перезаписать"
|
"gui.computercraft.upload.overwrite_button": "Перезаписать",
|
||||||
|
"gui.computercraft.upload.failed.name_too_long": "Названия файлов слишком длинны для загрузки.",
|
||||||
|
"gui.computercraft.upload.failed.too_many_files": "Нельзя загрузить столько файлов.",
|
||||||
|
"gui.computercraft.upload.failed.corrupted": "Файлы повреждены при загрузки. Попробуй снова."
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Please report bugs at https://github.com/SquidDev-CC/CC-Tweaked. Thanks!
|
Please report bugs at https://github.com/cc-tweaked/CC-Tweaked. Thanks!
|
||||||
View the documentation at https://tweaked.cc
|
View the documentation at https://tweaked.cc
|
||||||
Show off your programs or ask for help at our forum: https://forums.computercraft.cc
|
Show off your programs or ask for help at our forum: https://forums.computercraft.cc
|
||||||
You can disable these messages by running "set motd.enable false".
|
You can disable these messages by running "set motd.enable false".
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
-- Prints information about CraftOS
|
||||||
|
term.setTextColor(colors.yellow)
|
||||||
|
print(os.version() .. " on " .. _HOST)
|
||||||
|
term.setTextColor(colors.white)
|
@ -5,6 +5,8 @@ elseif date.month == 12 and date.day == 24 then
|
|||||||
print("Merry X-mas!")
|
print("Merry X-mas!")
|
||||||
elseif date.month == 10 and date.day == 31 then
|
elseif date.month == 10 and date.day == 31 then
|
||||||
print("OOoooOOOoooo! Spooky!")
|
print("OOoooOOOoooo! Spooky!")
|
||||||
|
elseif date.month == 4 and date.day == 28 then
|
||||||
|
print("Ed Balls")
|
||||||
else
|
else
|
||||||
local tMotd = {}
|
local tMotd = {}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
local capture = require "test_helpers".capture_program
|
local capture = require "test_helpers".capture_program
|
||||||
|
|
||||||
describe("The motd program", function()
|
describe("The motd program", function()
|
||||||
local function setup_date(month, day)
|
local function setup_date(day, month)
|
||||||
stub(os, "date", function() return { month = month, day = day } end)
|
stub(os, "date", function() return { day = day, month = month } end)
|
||||||
end
|
end
|
||||||
|
|
||||||
it("displays MOTD", function()
|
it("displays MOTD", function()
|
||||||
@ -16,20 +16,26 @@ describe("The motd program", function()
|
|||||||
:matches { ok = true, output = "Hello World!\n", error = "" }
|
:matches { ok = true, output = "Hello World!\n", error = "" }
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("displays date-specific MOTD (1/1)", function()
|
it("displays date-specific MOTD (1 Jan)", function()
|
||||||
setup_date(1, 1)
|
setup_date(1, 1)
|
||||||
expect(capture(stub, "motd"))
|
expect(capture(stub, "motd"))
|
||||||
:matches { ok = true, output = "Happy new year!\n", error = "" }
|
:matches { ok = true, output = "Happy new year!\n", error = "" }
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("displays date-specific MOTD (10/31)", function()
|
it("displays date-specific MOTD (28 Apr)", function()
|
||||||
setup_date(10, 31)
|
setup_date(28, 4)
|
||||||
|
expect(capture(stub, "motd"))
|
||||||
|
:matches { ok = true, output = "Ed Balls\n", error = "" }
|
||||||
|
end)
|
||||||
|
|
||||||
|
it("displays date-specific MOTD (31 Oct)", function()
|
||||||
|
setup_date(31, 10)
|
||||||
expect(capture(stub, "motd"))
|
expect(capture(stub, "motd"))
|
||||||
:matches { ok = true, output = "OOoooOOOoooo! Spooky!\n", error = "" }
|
:matches { ok = true, output = "OOoooOOOoooo! Spooky!\n", error = "" }
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("displays date-specific MOTD (12/24)", function()
|
it("displays date-specific MOTD (24 Dec)", function()
|
||||||
setup_date(12, 24)
|
setup_date(24, 12)
|
||||||
expect(capture(stub, "motd"))
|
expect(capture(stub, "motd"))
|
||||||
:matches { ok = true, output = "Merry X-mas!\n", error = "" }
|
:matches { ok = true, output = "Merry X-mas!\n", error = "" }
|
||||||
end)
|
end)
|
||||||
|
@ -11,7 +11,7 @@ class Computer_Test {
|
|||||||
/**
|
/**
|
||||||
* Ensures redstone signals do not travel through computers.
|
* Ensures redstone signals do not travel through computers.
|
||||||
*
|
*
|
||||||
* @see [#548](https://github.com/SquidDev-CC/CC-Tweaked/issues/548)
|
* @see [#548](https://github.com/cc-tweaked/CC-Tweaked/issues/548)
|
||||||
*/
|
*/
|
||||||
@GameTest
|
@GameTest
|
||||||
fun No_through_signal(context: GameTestHelper) = context.sequence {
|
fun No_through_signal(context: GameTestHelper) = context.sequence {
|
||||||
|
@ -11,7 +11,7 @@ class Disk_Drive_Test {
|
|||||||
/**
|
/**
|
||||||
* Ensure audio disks exist and we can play them.
|
* Ensure audio disks exist and we can play them.
|
||||||
*
|
*
|
||||||
* @see [#688](https://github.com/SquidDev-CC/CC-Tweaked/issues/688)
|
* @see [#688](https://github.com/cc-tweaked/CC-Tweaked/issues/688)
|
||||||
*/
|
*/
|
||||||
@GameTest
|
@GameTest
|
||||||
fun Audio_disk(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
fun Audio_disk(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
||||||
|
@ -13,7 +13,7 @@ class Turtle_Test {
|
|||||||
/**
|
/**
|
||||||
* Checks turtles can sheer sheep (and drop items)
|
* Checks turtles can sheer sheep (and drop items)
|
||||||
*
|
*
|
||||||
* @see [#537](https://github.com/SquidDev-CC/CC-Tweaked/issues/537)
|
* @see [#537](https://github.com/cc-tweaked/CC-Tweaked/issues/537)
|
||||||
*/
|
*/
|
||||||
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
||||||
fun Shears_sheep(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
fun Shears_sheep(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
||||||
@ -21,7 +21,7 @@ class Turtle_Test {
|
|||||||
/**
|
/**
|
||||||
* Checks turtles can place lava.
|
* Checks turtles can place lava.
|
||||||
*
|
*
|
||||||
* @see [#518](https://github.com/SquidDev-CC/CC-Tweaked/issues/518)
|
* @see [#518](https://github.com/cc-tweaked/CC-Tweaked/issues/518)
|
||||||
*/
|
*/
|
||||||
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
||||||
fun Place_lava(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
fun Place_lava(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
||||||
@ -29,7 +29,7 @@ class Turtle_Test {
|
|||||||
/**
|
/**
|
||||||
* Checks turtles can place when waterlogged.
|
* Checks turtles can place when waterlogged.
|
||||||
*
|
*
|
||||||
* @see [#385](https://github.com/SquidDev-CC/CC-Tweaked/issues/385)
|
* @see [#385](https://github.com/cc-tweaked/CC-Tweaked/issues/385)
|
||||||
*/
|
*/
|
||||||
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
||||||
fun Place_waterlogged(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
fun Place_waterlogged(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
||||||
@ -37,7 +37,7 @@ class Turtle_Test {
|
|||||||
/**
|
/**
|
||||||
* Checks turtles can pick up lava
|
* Checks turtles can pick up lava
|
||||||
*
|
*
|
||||||
* @see [#297](https://github.com/SquidDev-CC/CC-Tweaked/issues/297)
|
* @see [#297](https://github.com/cc-tweaked/CC-Tweaked/issues/297)
|
||||||
*/
|
*/
|
||||||
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
||||||
fun Gather_lava(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
fun Gather_lava(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
||||||
@ -45,7 +45,7 @@ class Turtle_Test {
|
|||||||
/**
|
/**
|
||||||
* Checks turtles can hoe dirt.
|
* Checks turtles can hoe dirt.
|
||||||
*
|
*
|
||||||
* @see [#258](https://github.com/SquidDev-CC/CC-Tweaked/issues/258)
|
* @see [#258](https://github.com/cc-tweaked/CC-Tweaked/issues/258)
|
||||||
*/
|
*/
|
||||||
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
||||||
fun Hoe_dirt(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
fun Hoe_dirt(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
||||||
@ -53,7 +53,7 @@ class Turtle_Test {
|
|||||||
/**
|
/**
|
||||||
* Checks turtles can place monitors
|
* Checks turtles can place monitors
|
||||||
*
|
*
|
||||||
* @see [#691](https://github.com/SquidDev-CC/CC-Tweaked/issues/691)
|
* @see [#691](https://github.com/cc-tweaked/CC-Tweaked/issues/691)
|
||||||
*/
|
*/
|
||||||
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
@GameTest(timeoutTicks = COMPUTER_TIMEOUT)
|
||||||
fun Place_monitor(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
fun Place_monitor(helper: GameTestHelper) = helper.sequence { thenComputerOk() }
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[30,)"
|
loaderVersion="[30,)"
|
||||||
|
|
||||||
issueTrackerURL="https://github.com/SquidDev-CC/CC-Tweaked/issues"
|
issueTrackerURL="https://github.com/cc-tweaked/CC-Tweaked/issues"
|
||||||
displayURL="https://github.com/SquidDev-CC/CC-Tweaked"
|
displayURL="https://github.com/cc-tweaked/CC-Tweaked"
|
||||||
logoFile="pack.png"
|
logoFile="pack.png"
|
||||||
|
|
||||||
credits="Created by Daniel Ratcliffe (@DanTwoHundred)"
|
credits="Created by Daniel Ratcliffe (@DanTwoHundred)"
|
||||||
|
Loading…
Reference in New Issue
Block a user