Merge branch 'mc1.18/0.5.1-repolish' into mc1.18/0.5.1-copycat-variants
This commit is contained in:
commit
a5e19ee0e5
1038 changed files with 40423 additions and 67610 deletions
3
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
3
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
@ -49,6 +49,9 @@ body:
|
|||
label: Mod Version
|
||||
description: The version of the mod you were using when the bug occured
|
||||
options:
|
||||
- "0.5.0i"
|
||||
- "0.5.0h"
|
||||
- "0.5.0g"
|
||||
- "0.5.0f"
|
||||
- "0.5.0e"
|
||||
- "0.5.0d"
|
||||
|
|
46
.github/workflows/localization.yml
vendored
Normal file
46
.github/workflows/localization.yml
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
# This workflow will run Crowdin Action that will upload new texts to Crowdin, download the newest translations and create a PR
|
||||
# For more information see: https://github.com/crowdin/github-action
|
||||
|
||||
name: Crowdin Action
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
# Only run when started manually
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
uploadTranslations:
|
||||
description: "Set to true to upload (changed) translations to Crowdin"
|
||||
type: boolean
|
||||
required: true
|
||||
default: false
|
||||
#schedule:
|
||||
#- cron: '0 */6 * * *' # Every 6 hours - https://crontab.guru/#0_*/6_*_*_*
|
||||
|
||||
jobs:
|
||||
synchronize-with-crowdin:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: crowdin action
|
||||
uses: crowdin/github-action@1.4.9
|
||||
with:
|
||||
# Upload sources to Crowdin
|
||||
upload_sources: true
|
||||
# Upload translations to Crowdin, only use true at initial run
|
||||
upload_translations: ${{ github.event.inputs.uploadTranslations }}
|
||||
# Make pull request of Crowdin translations
|
||||
download_translations: true
|
||||
# To download translations to the specified version branch
|
||||
localization_branch_name: l10n_crowdin_translations
|
||||
# Create pull request after pushing to branch
|
||||
create_pull_request: true
|
||||
pull_request_title: 'New Crowdin translations'
|
||||
pull_request_body: 'New Crowdin pull request with translations'
|
||||
pull_request_base_branch_name: 'mc1.18/dev'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
@ -5,7 +5,7 @@
|
|||
<a href="https://github.com/Creators-of-Create/Create/blob/master/LICENSE"><img src="https://img.shields.io/github/license/Creators-of-Create/Create?style=flat&color=900c3f" alt="License"></a>
|
||||
<a href="https://discord.gg/hmaD7Se"><img src="https://img.shields.io/discord/620934202875183104?color=5865f2&label=Discord&style=flat" alt="Discord"></a>
|
||||
<a href="https://www.curseforge.com/minecraft/mc-mods/create"><img src="http://cf.way2muchnoise.eu/328085.svg" alt="CF"></a>
|
||||
<a href="https://modrinth.com/mod/create"><img src="https://img.shields.io/badge/dynamic/json?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+Cjxzdmcgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDUxMiA1MTQiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM6c2VyaWY9Imh0dHA6Ly93d3cuc2VyaWYuY29tLyIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkO2NsaXAtcnVsZTpldmVub2RkO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoyOyI+CiAgICA8Zz4KICAgICAgICA8ZyBpZD0ibW9kcmludGgiPgogICAgICAgICAgICA8cGF0aCBkPSJNNTAzLjE2LDMyMy41NkM1MTQuNTUsMjgxLjQ3IDUxNS4zMiwyMzUuOTEgNTAzLjIsMTkwLjc2QzQ2Ni41Nyw1NC4yMyAzMjYuMDQsLTI2LjggMTg5LjMzLDkuNzhDODMuODEsMzguMDIgMTEuMzksMTI4LjA3IDAuNjksMjMwLjQ3TDQzLjk5LDIzMC40N0M1NC4yOSwxNDcuMzMgMTEzLjc0LDc0LjczIDE5OS43NSw1MS43MUMzMDYuMDUsMjMuMjYgNDE1LjEzLDgwLjY3IDQ1My4xNywxODEuMzhMNDExLjAzLDE5Mi42NUMzOTEuNjQsMTQ1LjggMzUyLjU3LDExMS40NSAzMDYuMyw5Ni44MkwyOTguNTYsMTQwLjY2QzMzNS4wOSwxNTQuMTMgMzY0LjcyLDE4NC41IDM3NS41NiwyMjQuOTFDMzkxLjM2LDI4My44IDM2MS45NCwzNDQuMTQgMzA4LjU2LDM2OS4xN0wzMjAuMDksNDEyLjE2QzM5MC4yNSwzODMuMjEgNDMyLjQsMzEwLjMgNDIyLjQzLDIzNS4xNEw0NjQuNDEsMjIzLjkxQzQ2OC45MSwyNTIuNjIgNDY3LjM1LDI4MS4xNiA0NjAuNTUsMzA4LjA3TDUwMy4xNiwzMjMuNTZaIiBzdHlsZT0iZmlsbDpyZ2IoMjMsMjMsMjUpOyIvPgogICAgICAgICAgICA8cGF0aCBkPSJNMzIxLjk5LDUwNC4yMkMxODUuMjcsNTQwLjggNDQuNzUsNDU5Ljc3IDguMTEsMzIzLjI0QzMuODQsMzA3LjMxIDEuMTcsMjkxLjMzIDAsMjc1LjQ2TDQzLjI3LDI3NS40NkM0NC4zNiwyODcuMzcgNDYuNDcsMjk5LjM1IDQ5LjY4LDMxMS4yOUM1My4wNCwzMjMuOCA1Ny40NSwzMzUuNzUgNjIuNzksMzQ3LjA3TDEwMS4zOCwzMjMuOTJDOTguMTMsMzE2LjQyIDk1LjM5LDMwOC42IDkzLjIxLDMwMC40N0M2OS4xNywyMTAuODcgMTIyLjQxLDExOC43NyAyMTIuMTMsOTQuNzZDMjI5LjEzLDkwLjIxIDI0Ni4yMyw4OC40NCAyNjIuOTMsODkuMTVMMjU1LjE5LDEzM0MyNDQuNzMsMTMzLjA1IDIzNC4xMSwxMzQuNDIgMjIzLjUzLDEzNy4yNUMxNTcuMzEsMTU0Ljk4IDExOC4wMSwyMjIuOTUgMTM1Ljc1LDI4OS4wOUMxMzYuODUsMjkzLjE2IDEzOC4xMywyOTcuMTMgMTM5LjU5LDMwMC45OUwxODguOTQsMjcxLjM4TDE3NC4wNywyMzEuOTVMMjIwLjY3LDE4NC4wOEwyNzkuNTcsMTcxLjM5TDI5Ni42MiwxOTIuMzhMMjY5LjQ3LDIxOS44OEwyNDUuNzksMjI3LjMzTDIyOC44NywyNDQuNzJMMjM3LjE2LDI2Ny43OUMyMzcuMTYsMjY3Ljc5IDI1My45NSwyODUuNjMgMjUzLjk4LDI4NS42NEwyNzcuNywyNzkuMzNMMjk0LjU4LDI2MC43OUwzMzEuNDQsMjQ5LjEyTDM0Mi40MiwyNzMuODJMMzA0LjM5LDMyMC40NUwyNDAuNjYsMzQwLjYzTDIxMi4wOCwzMDguODFMMTYyLjI2LDMzOC43QzE4Ny44LDM2Ny43OCAyMjYuMiwzODMuOTMgMjY2LjAxLDM4MC41NkwyNzcuNTQsNDIzLjU1QzIxOC4xMyw0MzEuNDEgMTYwLjEsNDA2LjgyIDEyNC4wNSwzNjEuNjRMODUuNjQsMzg0LjY4QzEzNi4yNSw0NTEuMTcgMjIzLjg0LDQ4NC4xMSAzMDkuNjEsNDYxLjE2QzM3MS4zNSw0NDQuNjQgNDE5LjQsNDAyLjU2IDQ0NS40MiwzNDkuMzhMNDg4LjA2LDM2NC44OEM0NTcuMTcsNDMxLjE2IDM5OC4yMiw0ODMuODIgMzIxLjk5LDUwNC4yMloiIHN0eWxlPSJmaWxsOnJnYigyMywyMywyNSk7ZmlsbC1ydWxlOm5vbnplcm87Ii8+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K&label=&suffix=%20&query=downloads&url=https://api.modrinth.com/api/v1/mod/LNytGWDc&style=flat&color=242629&labelColor=5ca424" alt="Modrinth"></a>
|
||||
<a href="https://modrinth.com/mod/create"><img src="https://img.shields.io/modrinth/dt/create?logo=modrinth&label=&suffix=%20&style=flat&color=242629&labelColor=5ca424&logoColor=1c1c1c" alt="Modrinth"></a>
|
||||
<br><br>
|
||||
</h1>
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ dependencies {
|
|||
jarJar.pin(it, project.registrate_version)
|
||||
}
|
||||
// Uncomment once Forge fixes mixins for included jars
|
||||
//jarJar(group: 'com.jozufozu.flywheel', name: "flywheel-forge-${flywheel_minecraft_version}", version: '[0.6.4,0.6.5)') {
|
||||
//jarJar(group: 'com.jozufozu.flywheel', name: "flywheel-forge-${flywheel_minecraft_version}", version: '[0.6.8,0.6.9)') {
|
||||
// jarJar.pin(it, project.flywheel_version)
|
||||
//}
|
||||
|
||||
|
|
39
crowdin.yml
Normal file
39
crowdin.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
"project_id_env": "CROWDIN_PROJECT_ID"
|
||||
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
|
||||
"base_path": "."
|
||||
|
||||
"preserve_hierarchy": true
|
||||
|
||||
"files": [
|
||||
{
|
||||
"source": "src/generated/resources/assets/create/lang/en_us.json",
|
||||
"translation": "src/main/resources/assets/create/lang/%locale_with_underscore%.json",
|
||||
"languages_mapping": {
|
||||
"locale_with_underscore": {
|
||||
"cs": "cs_cz",
|
||||
"da": "da_dk",
|
||||
"de": "de_de",
|
||||
"es-CL": "es_cl",
|
||||
"es-ES": "es_es",
|
||||
"es-MX": "es_mx",
|
||||
"fr": "fr_fr",
|
||||
"hu": "hu_hu",
|
||||
"it": "it_it",
|
||||
"ja": "ja_jp",
|
||||
"ko": "ko_kr",
|
||||
"nl": "nl_nl",
|
||||
"no": "no_no",
|
||||
"pl": "pl_pl",
|
||||
"pt-BR": "pt_br",
|
||||
"pt-PT": "pt_pt",
|
||||
"ro": "ro_ro",
|
||||
"ru": "ru_ru",
|
||||
"sv-SE": "sv_se",
|
||||
"th": "th_th",
|
||||
"uk": "uk_ua",
|
||||
"zh-CN": "zh_cn",
|
||||
"zh-TW": "zh_tw",
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
|
@ -8,7 +8,7 @@ mod_version = 0.5.1
|
|||
artifact_minecraft_version = 1.18.2
|
||||
|
||||
minecraft_version = 1.18.2
|
||||
forge_version = 40.1.60
|
||||
forge_version = 40.2.1
|
||||
|
||||
# build dependency versions
|
||||
forgegradle_version = 5.1.53
|
||||
|
@ -16,12 +16,12 @@ mixingradle_version = 0.7-SNAPSHOT
|
|||
mixin_version = 0.8.5
|
||||
librarian_version = 1.+
|
||||
cursegradle_version = 1.4.0
|
||||
parchment_version = 2022.07.10
|
||||
parchment_version = 2022.11.06
|
||||
|
||||
# dependency versions
|
||||
registrate_version = MC1.18.2-1.1.3
|
||||
flywheel_minecraft_version = 1.18.2
|
||||
flywheel_version = 0.6.5-91
|
||||
flywheel_version = 0.6.8.a-99
|
||||
jei_minecraft_version = 1.18.2
|
||||
jei_version = 9.7.0.209
|
||||
curios_minecraft_version = 1.18.2
|
||||
|
|
|
@ -81,7 +81,7 @@ f0031f5e970b3d5695472ed384950b8631b015ed assets/create/blockstates/creative_moto
|
|||
f7c283460879e70ed0fa112a24caa06a7122358f assets/create/blockstates/crimsite_pillar.json
|
||||
24ee16e3dadb3e0221afce7af37643494f471fb0 assets/create/blockstates/crimson_window.json
|
||||
3e6cd0945390b390b963474f7cf708e2dcba631c assets/create/blockstates/crimson_window_pane.json
|
||||
fe2f78b94c20944399101e7369e2d43324297fb6 assets/create/blockstates/crushing_wheel.json
|
||||
644cc650c49602e654e85b3b05073748c6cd42e5 assets/create/blockstates/crushing_wheel.json
|
||||
a1dd6cb3daa97ea871290ef7b178d28b564ee2a2 assets/create/blockstates/crushing_wheel_controller.json
|
||||
b1126c191877cff86b4e2de83e1fcbd151451cb7 assets/create/blockstates/cuckoo_clock.json
|
||||
7b4147b215d676a528ee8782a4528d42dac02198 assets/create/blockstates/cut_andesite.json
|
||||
|
@ -260,6 +260,7 @@ be3bef7e091d8b50bfc1c6b7275946d1f636aefd assets/create/blockstates/horizontal_fr
|
|||
b15bea757ef981e0ca60f740ca234ee2014eb7b7 assets/create/blockstates/jungle_window_pane.json
|
||||
a922b31bc4a91f5825b643ba5fa2c9a836d612cd assets/create/blockstates/large_bogey.json
|
||||
f651091db216b009b3379b2f48d56d03481c8675 assets/create/blockstates/large_cogwheel.json
|
||||
9554c8d14271a2b85df7eadeceaa8b31849415e4 assets/create/blockstates/large_water_wheel.json
|
||||
a38184e035c2ebca7471e1714494fea213af259e assets/create/blockstates/layered_andesite.json
|
||||
2409f04042380a8ad086f9c4f98032e85771c3f3 assets/create/blockstates/layered_asurine.json
|
||||
ca1648840d9f5786f85e4214a0951306c1247c73 assets/create/blockstates/layered_calcite.json
|
||||
|
@ -529,6 +530,7 @@ c4db76b9d36cfb098df0d158cb6f8b82768ebe14 assets/create/blockstates/vertical_fram
|
|||
3a5da54d9763e9512cfaa47b25226b79738b25f3 assets/create/blockstates/warped_window.json
|
||||
19ef7a16c82f07d304fb60d121845185d189aecf assets/create/blockstates/warped_window_pane.json
|
||||
d31fce8315c8715521d66b5dcc166c84e949dd1d assets/create/blockstates/water_wheel.json
|
||||
f4d185b9eb086e5024a9818bad57d524267d6e13 assets/create/blockstates/water_wheel_structure.json
|
||||
97a8f4cf45776b1fb5249fe1a9314b5c615fb130 assets/create/blockstates/waxed_copper_shingle_slab.json
|
||||
d31a8ad9ffa09cbabfb284d44c9c44d036072083 assets/create/blockstates/waxed_copper_shingle_stairs.json
|
||||
e7be350dd2fd80357c56a0fbad3e000818b822c9 assets/create/blockstates/waxed_copper_shingles.json
|
||||
|
@ -574,24 +576,8 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
|
|||
5616dda664dd106d576848124fc0fc1de18d0fd3 assets/create/blockstates/yellow_valve_handle.json
|
||||
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
|
||||
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
|
||||
a324cc6f69f18468a1c3ed50c21711484500591a assets/create/lang/en_ud.json
|
||||
5c73b27a53e2a8dfd366d361210038608c125045 assets/create/lang/en_us.json
|
||||
8b6554a2f4d0b983a12bd36485c12adba26702e8 assets/create/lang/unfinished/de_de.json
|
||||
dc224328d3190b1bea6bc530989ee483b710e3b7 assets/create/lang/unfinished/es_cl.json
|
||||
925ffd51d03ea8d5386a633aa4cf5cfb4376e7e6 assets/create/lang/unfinished/es_es.json
|
||||
46169bb7d036a05fac6e1b4820bc0bb20d791f75 assets/create/lang/unfinished/fr_fr.json
|
||||
ebee781d82a8fd3e5dad9cc5baf5b31441248eeb assets/create/lang/unfinished/it_it.json
|
||||
9e34d02c23bea2696b6fa1bc668441e8117a4265 assets/create/lang/unfinished/ja_jp.json
|
||||
9be7ef90e75483623be47ae1eec4cce95c435a47 assets/create/lang/unfinished/ko_kr.json
|
||||
4f08990a33f0244dd7e9c5068bd1c568c0669406 assets/create/lang/unfinished/nl_nl.json
|
||||
97ffa4a6ba3fec2c69e7baf1bf7135b27b19e885 assets/create/lang/unfinished/pl_pl.json
|
||||
127e21f422d18fc16cf4e283d24bd7a27fb0b9e4 assets/create/lang/unfinished/pt_br.json
|
||||
78894f191d0ba41a943e3acfd44f543abf155394 assets/create/lang/unfinished/pt_pt.json
|
||||
ea03700faee15c069a043d58874e3d7ddbf7f855 assets/create/lang/unfinished/ro_ro.json
|
||||
39ce8e1c539a54af3f3a5443e933dac0502c78a0 assets/create/lang/unfinished/ru_ru.json
|
||||
ba6f4342a731631b46783bf65275fba2d420852f assets/create/lang/unfinished/uk_ua.json
|
||||
efb4c02a3116f0ac94afc15d7258c8f61b2e47cb assets/create/lang/unfinished/zh_cn.json
|
||||
fd37eb841193b5935cd8f388250ad246ab25915b assets/create/lang/unfinished/zh_tw.json
|
||||
30815cc68ddf59924be78b1c37a0e374fafe552a assets/create/lang/en_ud.json
|
||||
c1aabd0f4dfd58bbbb2618a367fc9b6b02bfb1b6 assets/create/lang/en_us.json
|
||||
487a511a01b2a4531fb672f917922312db78f958 assets/create/models/block/acacia_window.json
|
||||
b48060cba1a382f373a05bf0039054053eccf076 assets/create/models/block/acacia_window_pane_noside.json
|
||||
3066db1bf03cffa1a9c7fbacf47ae586632f4eb3 assets/create/models/block/acacia_window_pane_noside_alt.json
|
||||
|
@ -1767,7 +1753,7 @@ cecee6daf2619dcf035c7aea5fff1bd892f6ff06 assets/create/models/item/crushed_silve
|
|||
a8d3f330d312f82b0de59940581910090b2bd012 assets/create/models/item/crushed_tin_ore.json
|
||||
b359064405d189e2802969715cd5f682ddbf0bb1 assets/create/models/item/crushed_uranium_ore.json
|
||||
2bb791db62dce6bf2e2227f9b607c131828471fd assets/create/models/item/crushed_zinc_ore.json
|
||||
823c91f63565db54ec3944a1e90e7aee18e41062 assets/create/models/item/crushing_wheel.json
|
||||
f9a158bd5bbbf60310e8f3d4f10911e8baf03579 assets/create/models/item/crushing_wheel.json
|
||||
dae5cffa4e1263d6a113469f79fba8695fa8232a assets/create/models/item/cuckoo_clock.json
|
||||
120cb6f4fc6b28d86117dbe059b990c1303c46ee assets/create/models/item/cut_andesite.json
|
||||
9c94151d18e0201e1e1967713f2ab86ebc9c647b assets/create/models/item/cut_andesite_brick_slab.json
|
||||
|
@ -1949,6 +1935,7 @@ d4883a5c777abb6c5235563eadb70e2b1b3de17b assets/create/models/item/incomplete_tr
|
|||
83fa8699318e51f838b483b40b3e897c34ed53d1 assets/create/models/item/jungle_window.json
|
||||
766323f6026c3505a75db2dee2996d342370d9c2 assets/create/models/item/jungle_window_pane.json
|
||||
bcaaf60d9a853cce90169dabcb36d29a3ce19e18 assets/create/models/item/large_cogwheel.json
|
||||
7418fb83e9b4ad6cab8e0a28aff7f615fbfb20b4 assets/create/models/item/large_water_wheel.json
|
||||
281e2b055c6eb6994ca306c8957fc80a98fb5473 assets/create/models/item/layered_andesite.json
|
||||
ad814f2eef3415c44e1df73a84011fbe801a0de3 assets/create/models/item/layered_asurine.json
|
||||
d188923db1e37aeac3b24ee2e6f0a4a13a794da9 assets/create/models/item/layered_calcite.json
|
||||
|
@ -2479,6 +2466,7 @@ a9f2c8a0b0b322741575ef833a461006ef2f0421 data/create/advancements/recipes/create
|
|||
2ccfaf572456e8642a0070ea6928a082f98c63af data/create/advancements/recipes/create.base/crafting/kinetics/item_vault.json
|
||||
73433a5cd400ed392796a4e543f15c42dd499fe8 data/create/advancements/recipes/create.base/crafting/kinetics/large_cogwheel.json
|
||||
1c9e9888ccc51ddf76b9df0c186e74efaefb1256 data/create/advancements/recipes/create.base/crafting/kinetics/large_cogwheelfrom_little.json
|
||||
5a1df5831fe5d2e2a6cbedcbc67216dd566e7fa0 data/create/advancements/recipes/create.base/crafting/kinetics/large_water_wheel.json
|
||||
eb007bb079bbe6b6aaad2ca90f5af84261e3f8ea data/create/advancements/recipes/create.base/crafting/kinetics/light_blue_seat.json
|
||||
571da50fbf5f2fcd3363b3dab91e7233e0ebffa0 data/create/advancements/recipes/create.base/crafting/kinetics/light_blue_seat_from_other_seat.json
|
||||
ddd80e84a7d595bbb3cf405a902ebbfd4ea5263c data/create/advancements/recipes/create.base/crafting/kinetics/light_blue_valve_handle_from_other_valve_handle.json
|
||||
|
@ -3699,6 +3687,7 @@ db23fee08abdb61fe2f200a5016e41523159feef data/create/loot_tables/blocks/jungle_w
|
|||
67f7d9162d3b86e198ab7faa1ddcfdfce605d10c data/create/loot_tables/blocks/jungle_window_pane.json
|
||||
7ed68e33a8c488242a2d9039797498068797c5a6 data/create/loot_tables/blocks/large_bogey.json
|
||||
a70fcfe474ba023adc9c326218c5664fbd7b58f8 data/create/loot_tables/blocks/large_cogwheel.json
|
||||
9edccdfed011fdbac3a8911684b73fd029df87b4 data/create/loot_tables/blocks/large_water_wheel.json
|
||||
81013913c3cc88e2390608420a2911d57414bd2c data/create/loot_tables/blocks/layered_andesite.json
|
||||
a89d357d3b8d7633bffe12a4197ab19cba891005 data/create/loot_tables/blocks/layered_asurine.json
|
||||
93950e03d141e59948c4aadca09ecd8b898a5276 data/create/loot_tables/blocks/layered_calcite.json
|
||||
|
@ -3968,6 +3957,7 @@ f74bc454bda585bc5ab0b5b3e0b4d345a6ff039b data/create/loot_tables/blocks/train_tr
|
|||
183444f27542a3a7ab933243b61c2714357f7361 data/create/loot_tables/blocks/warped_window.json
|
||||
2fa711af9d00bd47f256fe6b0cc83a303644b1c0 data/create/loot_tables/blocks/warped_window_pane.json
|
||||
e6c1f19127a3fcf010ed6fb004a40a69458c54e3 data/create/loot_tables/blocks/water_wheel.json
|
||||
5c1df8443043b3fe3b665dba348e2ff188bcbe31 data/create/loot_tables/blocks/water_wheel_structure.json
|
||||
815cddd9fb217a69b3a0ac4554d830c04d0ef173 data/create/loot_tables/blocks/waxed_copper_shingle_slab.json
|
||||
b28ea9be9de982b6561839c61f4a7264c8ba4171 data/create/loot_tables/blocks/waxed_copper_shingle_stairs.json
|
||||
b26f12b81e4f801cc107b5c6316ad9006c5ea391 data/create/loot_tables/blocks/waxed_copper_shingles.json
|
||||
|
@ -4167,6 +4157,7 @@ f4fbb11ef55f3431bd387f3f6f258513bfbc8011 data/create/recipes/crafting/kinetics/i
|
|||
8f7110447f039f80a6f5b1d854bc760c3d77da82 data/create/recipes/crafting/kinetics/item_vault.json
|
||||
7f105694e02d4ce69a02740edfa4a0d0bc4f4eac data/create/recipes/crafting/kinetics/large_cogwheel.json
|
||||
197c174c28f294b23ae6496b7a31c35e7e8b4771 data/create/recipes/crafting/kinetics/large_cogwheelfrom_little.json
|
||||
5609b12dde7127965c70da2760038c456ba3cfd6 data/create/recipes/crafting/kinetics/large_water_wheel.json
|
||||
0397b107ab380cd23390c96f298971a70e9bceef data/create/recipes/crafting/kinetics/light_blue_seat.json
|
||||
aa06f0594e1b2d31aa41bace309ed95a16529498 data/create/recipes/crafting/kinetics/light_blue_seat_from_other_seat.json
|
||||
bb8759b51aef768fa841962b9ad49676a6096a1c data/create/recipes/crafting/kinetics/light_blue_valve_handle_from_other_valve_handle.json
|
||||
|
@ -4244,7 +4235,7 @@ c38984c432bd410261aaf6a6f30744c58481b325 data/create/recipes/crafting/kinetics/t
|
|||
5e2af5ce3957d5ce4f54ceb667dcfed5cffafb32 data/create/recipes/crafting/kinetics/train_trapdoor.json
|
||||
8494f5fcd85a740fa0f0384e3522d8cdd905ce49 data/create/recipes/crafting/kinetics/turntable.json
|
||||
057c889b0a306f44b8835c896663154ccd9ff12f data/create/recipes/crafting/kinetics/vertical_gearboxfrom_conversion.json
|
||||
4fb009b86a51b2e259bd1f73848803f6276dd820 data/create/recipes/crafting/kinetics/water_wheel.json
|
||||
152e63ade2759d01a07b9e71a3c60dfe5ea15ba8 data/create/recipes/crafting/kinetics/water_wheel.json
|
||||
06b5b371ae9dd81df8fd3dee6d3559b1ed0db35c data/create/recipes/crafting/kinetics/weighted_ejector.json
|
||||
f508d510576c93712e7f5265345a32e8818bbf0d data/create/recipes/crafting/kinetics/whisk.json
|
||||
98546e5e5f1fe111e84c4a17569c8e7b57f8cc8d data/create/recipes/crafting/kinetics/white_sail.json
|
||||
|
@ -5711,22 +5702,22 @@ d79c82bc6cf59b073b2f51f5fea9c98e81d14b68 data/create/recipes/weathered_copper_ti
|
|||
452d480dd50b97fce72e0c89429cf68db534c6b2 data/create/recipes/weathered_copper_tile_slab_from_weathered_copper_tiles_stonecutting.json
|
||||
ac265a674626e0e832330086fd18fe0be37fc327 data/create/recipes/weathered_copper_tile_stairs.json
|
||||
5942a571f79c40524bbf408775cf91de4715f2b6 data/create/recipes/weathered_copper_tile_stairs_from_weathered_copper_tiles_stonecutting.json
|
||||
2d549ea56fb226c0e31e66c0391996093f8bece9 data/create/tags/blocks/brittle.json
|
||||
2a2700b43614f86d3294726595cb28ed7dca4387 data/create/tags/blocks/brittle.json
|
||||
d99d5c67bdffff60789a19bd51a5c5267c75e0a4 data/create/tags/blocks/casing.json
|
||||
bc203f09dd7f48965d146d0bd035fb904cb75e7d data/create/tags/blocks/copycat_allow.json
|
||||
d4a3b66f4b763b9a2dcdea74b7273f0ae85cb335 data/create/tags/blocks/copycat_deny.json
|
||||
443f75adbf3d2f6fb0aad4b344372669470065b8 data/create/tags/blocks/fan_transparent.json
|
||||
2b4c93e5a752ebf54217594766f30d8d60cb4343 data/create/tags/blocks/fan_transparent.json
|
||||
ee6d2b53d81f2bed492662b6c06f46c4f2b9ef9b data/create/tags/blocks/movable_empty_collider.json
|
||||
6e5d3b2123fbb00e7f439c091623619502551bca data/create/tags/blocks/non_movable.json
|
||||
10781e8cfcbb3486327aace3aa00e437fb44b331 data/create/tags/blocks/ore_override_stone.json
|
||||
418c6da531d6206e3cbe4049dce3db23c4270bed data/create/tags/blocks/passive_boiler_heaters.json
|
||||
3492722cffa53b96d7a91f8c04d792329d902c85 data/create/tags/blocks/safe_nbt.json
|
||||
760adb521c2e475a6414f97291f46c02d294fa74 data/create/tags/blocks/passive_boiler_heaters.json
|
||||
9751aa15c651a076024eb52fcffa8ce6aa7a405e data/create/tags/blocks/safe_nbt.json
|
||||
6cdeeac1689f7b5bfd9bc40b462143d8eaf3ad0b data/create/tags/blocks/seats.json
|
||||
d063e12c9ef75f39518c6d129ea35d833464d547 data/create/tags/blocks/toolboxes.json
|
||||
8861f982c335a1f17796df4af53a7d5dc91fc85a data/create/tags/blocks/tree_attachments.json
|
||||
9460e92c8e483446318b849abe7e6f52dcd4a269 data/create/tags/blocks/tree_attachments.json
|
||||
50936b211d94167a35ec78c89954082a336b6269 data/create/tags/blocks/valve_handles.json
|
||||
eac71740fb12bdb38b5dfaa2268613d7ba82b809 data/create/tags/blocks/windmill_sails.json
|
||||
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/blocks/windowable.json
|
||||
0cdd36ef9dca0cb73bd79adadfe71288031a98b8 data/create/tags/blocks/wrench_pickup.json
|
||||
84b63dd3da12f34248474941d961b1e71837917e data/create/tags/blocks/wrench_pickup.json
|
||||
a8bdc387cfa6296ebcc4af14323e2ddb632234dc data/create/tags/fluids/bottomless/allow.json
|
||||
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/fluids/bottomless/deny.json
|
||||
74700d556ca80c7a1db5fd4efb09c3ddb26cad66 data/create/tags/items/blaze_burner_fuel/regular.json
|
||||
|
@ -5734,6 +5725,7 @@ a8bdc387cfa6296ebcc4af14323e2ddb632234dc data/create/tags/fluids/bottomless/allo
|
|||
d99d5c67bdffff60789a19bd51a5c5267c75e0a4 data/create/tags/items/casing.json
|
||||
c98ffdc2780c2a7690c590f46f014aeee7b0b504 data/create/tags/items/create_ingots.json
|
||||
4480f211f4a37bfee193eba945bc9f5a8d2c6e34 data/create/tags/items/crushed_ores.json
|
||||
49847bfbea11808b5101c972023a7f5833fe5a14 data/create/tags/items/deployable_drink.json
|
||||
67385d5198d0796ec8f0d2c6ae144c672f4317a1 data/create/tags/items/modded_stripped_logs.json
|
||||
27a1074a88a7b939c811341086afece325ed724c data/create/tags/items/modded_stripped_wood.json
|
||||
8c8f6658ee72bdea2fcef77bade7bfa48de784c8 data/create/tags/items/pressurized_air_sources.json
|
||||
|
@ -5774,7 +5766,6 @@ ff1900963bc4cd8ceffa78d58ef1952ceacb2fb7 data/forge/tags/blocks/storage_blocks/b
|
|||
6b73c57912934d09233ad2966110968a6109f2c9 data/forge/tags/fluids/chocolate.json
|
||||
391c9b2be5740aea943a8a5fe27eb327e2d973b0 data/forge/tags/fluids/honey.json
|
||||
d6a4e4fe1204b718010543a28a9b9ec4e0977bd7 data/forge/tags/fluids/tea.json
|
||||
d9ffc62a496946fc4848934e7c0a6e917337f8be data/forge/tags/items/beacon_payment.json
|
||||
5af3164b14c92d2d6e235b5d4eebd93cbee37c0a data/forge/tags/items/buckets/honey.json
|
||||
2f7cf5a2d485f25d451da9771ed466591cfa5204 data/forge/tags/items/dough.json
|
||||
2f7cf5a2d485f25d451da9771ed466591cfa5204 data/forge/tags/items/dough/wheat.json
|
||||
|
@ -5816,8 +5807,8 @@ e16d74571ae10007f06f3b86ddf05d3ca9b73559 data/minecraft/tags/blocks/doors.json
|
|||
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/dripstone_replaceable_blocks.json
|
||||
69f596fcb065e26b02ce246760432b5174191b76 data/minecraft/tags/blocks/impermeable.json
|
||||
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/lush_ground_replaceable.json
|
||||
a8662d145a8b1b5faa263c2aac9d12e7727c8c3f data/minecraft/tags/blocks/mineable/axe.json
|
||||
8d1b001e56bf81a9b314200a43bafa5210d2594d data/minecraft/tags/blocks/mineable/pickaxe.json
|
||||
f4a1cdc4ffe7dd8412e8be369a48d19cf31a7f77 data/minecraft/tags/blocks/mineable/axe.json
|
||||
a7eb0e379696c39c6f5a4603e29d3d8cc4fbf50c data/minecraft/tags/blocks/mineable/pickaxe.json
|
||||
2db7759fe036160c14c6ed19a68604ca16f4de60 data/minecraft/tags/blocks/moss_replaceable.json
|
||||
e157c1d3af30e409e34bbefbe15a037e6e1c8daa data/minecraft/tags/blocks/needs_iron_tool.json
|
||||
a08f67865337f62601c5e333b4011382d10020e4 data/minecraft/tags/blocks/needs_stone_tool.json
|
||||
|
@ -5828,6 +5819,7 @@ d622e97373b1e96632ffb0a312ef04696da0ed4d data/minecraft/tags/blocks/trapdoors.js
|
|||
0ec220675cbf8a6eeb47d42b7409395a0cb6ae6e data/minecraft/tags/blocks/walls.json
|
||||
e16d74571ae10007f06f3b86ddf05d3ca9b73559 data/minecraft/tags/blocks/wooden_doors.json
|
||||
09d26bcd0f94459f945219997277c4fbf14adeb7 data/minecraft/tags/fluids/water.json
|
||||
d9ffc62a496946fc4848934e7c0a6e917337f8be data/minecraft/tags/items/beacon_payment_items.json
|
||||
e16d74571ae10007f06f3b86ddf05d3ca9b73559 data/minecraft/tags/items/doors.json
|
||||
49cadea86f6b63d5065b859a0d0e7ad772cf51d6 data/minecraft/tags/items/piglin_loved.json
|
||||
49a043b38ca8d4e2fa8cba9ceee3b69715a8476e data/minecraft/tags/items/slabs.json
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
"variants": {
|
||||
"axis=x": {
|
||||
"model": "create:block/crushing_wheel",
|
||||
"model": "create:block/crushing_wheel/block",
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"axis=y": {
|
||||
"model": "create:block/crushing_wheel"
|
||||
"model": "create:block/crushing_wheel/block"
|
||||
},
|
||||
"axis=z": {
|
||||
"model": "create:block/crushing_wheel",
|
||||
"model": "create:block/crushing_wheel/block",
|
||||
"x": 90,
|
||||
"y": 180
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"variants": {
|
||||
"axis=x,extension=false": {
|
||||
"model": "create:block/large_water_wheel/block",
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"axis=y,extension=false": {
|
||||
"model": "create:block/large_water_wheel/block"
|
||||
},
|
||||
"axis=z,extension=false": {
|
||||
"model": "create:block/large_water_wheel/block",
|
||||
"x": 90,
|
||||
"y": 180
|
||||
},
|
||||
"axis=x,extension=true": {
|
||||
"model": "create:block/large_water_wheel/block_extension",
|
||||
"x": 90,
|
||||
"y": 90
|
||||
},
|
||||
"axis=y,extension=true": {
|
||||
"model": "create:block/large_water_wheel/block_extension"
|
||||
},
|
||||
"axis=z,extension=true": {
|
||||
"model": "create:block/large_water_wheel/block_extension",
|
||||
"x": 90,
|
||||
"y": 180
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "minecraft:block/air"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -261,6 +261,7 @@
|
|||
"block.create.jungle_window_pane": "\u01DDu\u0250\u0500 \u028Dopu\u0131M \u01DD\u05DFbun\u017F",
|
||||
"block.create.large_bogey": "\u028E\u01DDbo\u15FA \u01DDb\u0279\u0250\uA780",
|
||||
"block.create.large_cogwheel": "\u05DF\u01DD\u01DD\u0265\u028Dbo\u0186 \u01DDb\u0279\u0250\uA780",
|
||||
"block.create.large_water_wheel": "\u05DF\u01DD\u01DD\u0265M \u0279\u01DD\u0287\u0250M \u01DDb\u0279\u0250\uA780",
|
||||
"block.create.layered_andesite": "\u01DD\u0287\u0131s\u01DDpu\u2C6F p\u01DD\u0279\u01DD\u028E\u0250\uA780",
|
||||
"block.create.layered_asurine": "\u01DDu\u0131\u0279ns\u2C6F p\u01DD\u0279\u01DD\u028E\u0250\uA780",
|
||||
"block.create.layered_calcite": "\u01DD\u0287\u0131\u0254\u05DF\u0250\u0186 p\u01DD\u0279\u01DD\u028E\u0250\uA780",
|
||||
|
@ -530,6 +531,7 @@
|
|||
"block.create.warped_window": "\u028Dopu\u0131M p\u01DDd\u0279\u0250M",
|
||||
"block.create.warped_window_pane": "\u01DDu\u0250\u0500 \u028Dopu\u0131M p\u01DDd\u0279\u0250M",
|
||||
"block.create.water_wheel": "\u05DF\u01DD\u01DD\u0265M \u0279\u01DD\u0287\u0250M",
|
||||
"block.create.water_wheel_structure": "\u05DF\u01DD\u01DD\u0265M \u0279\u01DD\u0287\u0250M \u01DDb\u0279\u0250\uA780",
|
||||
"block.create.waxed_copper_shingle_slab": "q\u0250\u05DFS \u01DD\u05DFbu\u0131\u0265S \u0279\u01DDddo\u0186 p\u01DDx\u0250M",
|
||||
"block.create.waxed_copper_shingle_stairs": "s\u0279\u0131\u0250\u0287S \u01DD\u05DFbu\u0131\u0265S \u0279\u01DDddo\u0186 p\u01DDx\u0250M",
|
||||
"block.create.waxed_copper_shingles": "s\u01DD\u05DFbu\u0131\u0265S \u0279\u01DDddo\u0186 p\u01DDx\u0250M",
|
||||
|
|
|
@ -264,6 +264,7 @@
|
|||
"block.create.jungle_window_pane": "Jungle Window Pane",
|
||||
"block.create.large_bogey": "Large Bogey",
|
||||
"block.create.large_cogwheel": "Large Cogwheel",
|
||||
"block.create.large_water_wheel": "Large Water Wheel",
|
||||
"block.create.layered_andesite": "Layered Andesite",
|
||||
"block.create.layered_asurine": "Layered Asurine",
|
||||
"block.create.layered_calcite": "Layered Calcite",
|
||||
|
@ -533,6 +534,7 @@
|
|||
"block.create.warped_window": "Warped Window",
|
||||
"block.create.warped_window_pane": "Warped Window Pane",
|
||||
"block.create.water_wheel": "Water Wheel",
|
||||
"block.create.water_wheel_structure": "Large Water Wheel",
|
||||
"block.create.waxed_copper_shingle_slab": "Waxed Copper Shingle Slab",
|
||||
"block.create.waxed_copper_shingle_stairs": "Waxed Copper Shingle Stairs",
|
||||
"block.create.waxed_copper_shingles": "Waxed Copper Shingles",
|
||||
|
@ -1048,6 +1050,8 @@
|
|||
"create.terrainzapper.usingBlock": "Using: %1$s",
|
||||
"create.terrainzapper.leftClickToSet": "Left-Click a Block to set Material",
|
||||
|
||||
"create.large_water_wheel.not_enough_space": "Clear Blocks for Placement",
|
||||
|
||||
"create.minecart_coupling.two_couplings_max": "Minecarts cannot have more than two couplings each",
|
||||
"create.minecart_coupling.unloaded": "Parts of your train seem to be in unloaded chunks",
|
||||
"create.minecart_coupling.no_loops": "Couplings cannot form a loop",
|
||||
|
@ -1142,6 +1146,7 @@
|
|||
"create.schematicAndQuill.saved": "Saved as %1$s",
|
||||
|
||||
"create.schematic.invalid": "[!] Invalid Item - Use the Schematic Table instead",
|
||||
"create.schematic.error": "Schematic failed to Load - Check Game Logs",
|
||||
"create.schematic.position": "Position",
|
||||
"create.schematic.rotation": "Rotation",
|
||||
"create.schematic.rotation.none": "None",
|
||||
|
@ -1207,12 +1212,12 @@
|
|||
"create.gui.schematicannon.option.replaceWithAny": "Replace Solid with Any",
|
||||
"create.gui.schematicannon.option.replaceWithEmpty": "Replace Solid with Empty",
|
||||
"create.gui.schematicannon.option.skipMissing": "Skip missing Blocks",
|
||||
"create.gui.schematicannon.option.skipTileEntities": "Protect Tile Entities",
|
||||
"create.gui.schematicannon.option.skipBlockEntities": "Protect Block Entities",
|
||||
"create.gui.schematicannon.slot.gunpowder": "Add gunpowder to fuel the cannon",
|
||||
"create.gui.schematicannon.slot.listPrinter": "Place books here to print a Checklist for your Schematic",
|
||||
"create.gui.schematicannon.slot.schematic": "Add your Schematic here. Make sure it is deployed at a specific location.",
|
||||
"create.gui.schematicannon.option.skipMissing.description": "If the cannon cannot find a required Block for placement, it will continue at the next Location.",
|
||||
"create.gui.schematicannon.option.skipTileEntities.description": "The cannon will avoid replacing data holding blocks such as Chests.",
|
||||
"create.gui.schematicannon.option.skipBlockEntities.description": "The cannon will avoid replacing data holding blocks such as Chests.",
|
||||
"create.gui.schematicannon.option.dontReplaceSolid.description": "The cannon will never replace any Solid blocks in its working area, only non-Solid and Air.",
|
||||
"create.gui.schematicannon.option.replaceWithSolid.description": "The cannon will only replace Solid blocks in its working area if the Schematic contains a solid Block at the Location.",
|
||||
"create.gui.schematicannon.option.replaceWithAny.description": "The cannon will replace Solid blocks in its working area if the Schematic contains any Block at the Location.",
|
||||
|
@ -1235,6 +1240,8 @@
|
|||
"create.schematicannon.status.schematicInvalid": "Schematic Invalid",
|
||||
"create.schematicannon.status.schematicNotPlaced": "Schematic not Positioned",
|
||||
"create.schematicannon.status.schematicExpired": "Schematic File Expired",
|
||||
"create.schematicannon.status.schematicErrored": "Incompatible Blocks",
|
||||
"create.schematicannon.status.schematicErroredCheckLogs": "Check Server Logs",
|
||||
|
||||
"create.materialChecklist": "Material Checklist",
|
||||
"create.materialChecklist.blocksNotLoaded": "* Disclaimer *\n\nMaterial List may be inaccurate due to relevant chunks not being loaded.",
|
||||
|
@ -1781,6 +1788,9 @@
|
|||
"create.contraption.minecart_contraption_too_big": "This Cart Contraption seems too big to pick up",
|
||||
"create.contraption.minecart_contraption_illegal_pickup": "A mystical force is binding this Cart Contraption to the world",
|
||||
|
||||
"enchantment.create.capacity.desc": "Increases Backtank air capacity.",
|
||||
"enchantment.create.potato_recovery.desc": "Potato Cannon projectiles have a chance to be reused.",
|
||||
|
||||
|
||||
"_": "->------------------------] Subtitles [------------------------<-",
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/crushing_wheel"
|
||||
"parent": "create:block/crushing_wheel/item"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "create:block/large_water_wheel/item"
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"create:crafting/kinetics/large_water_wheel"
|
||||
]
|
||||
},
|
||||
"criteria": {
|
||||
"has_item": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"items": [
|
||||
"create:water_wheel"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"trigger": "minecraft:recipe_unlocked",
|
||||
"conditions": {
|
||||
"recipe": "create:crafting/kinetics/large_water_wheel"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_item",
|
||||
"has_the_recipe"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1.0,
|
||||
"bonus_rolls": 0.0,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "create:large_water_wheel"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"type": "minecraft:block",
|
||||
"pools": [
|
||||
{
|
||||
"rolls": 1.0,
|
||||
"bonus_rolls": 0.0,
|
||||
"entries": [
|
||||
{
|
||||
"type": "minecraft:item",
|
||||
"name": "minecraft:air"
|
||||
}
|
||||
],
|
||||
"conditions": [
|
||||
{
|
||||
"condition": "minecraft:survives_explosion"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"SSS",
|
||||
"SCS",
|
||||
"SSS"
|
||||
],
|
||||
"key": {
|
||||
"S": {
|
||||
"tag": "minecraft:planks"
|
||||
},
|
||||
"C": {
|
||||
"item": "create:water_wheel"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "create:large_water_wheel"
|
||||
}
|
||||
}
|
|
@ -7,10 +7,10 @@
|
|||
],
|
||||
"key": {
|
||||
"S": {
|
||||
"tag": "minecraft:wooden_slabs"
|
||||
"tag": "minecraft:planks"
|
||||
},
|
||||
"C": {
|
||||
"item": "create:large_cogwheel"
|
||||
"item": "create:shaft"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
"create:redstone_link",
|
||||
"create:peculiar_bell",
|
||||
"create:haunted_bell",
|
||||
"#minecraft:doors",
|
||||
"#minecraft:beds",
|
||||
"minecraft:flower_pot",
|
||||
"minecraft:bell",
|
||||
"minecraft:cocoa"
|
||||
"minecraft:cocoa",
|
||||
"minecraft:flower_pot",
|
||||
"#minecraft:beds",
|
||||
"#minecraft:doors"
|
||||
]
|
||||
}
|
|
@ -4,8 +4,9 @@
|
|||
"create:blaze_burner",
|
||||
"create:lit_blaze_burner",
|
||||
"create:sail_frame",
|
||||
"#minecraft:fences",
|
||||
"minecraft:iron_bars",
|
||||
"#minecraft:campfires",
|
||||
"minecraft:iron_bars"
|
||||
"#minecraft:fences",
|
||||
"#minecraft:leaves"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:cobweb",
|
||||
"minecraft:powder_snow",
|
||||
"#minecraft:fence_gates"
|
||||
]
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
"values": [
|
||||
"create:blaze_burner",
|
||||
"create:lit_blaze_burner",
|
||||
"#minecraft:fire",
|
||||
"#minecraft:campfires",
|
||||
"minecraft:magma_block",
|
||||
"minecraft:lava"
|
||||
"minecraft:lava",
|
||||
"#minecraft:campfires",
|
||||
"#minecraft:fire"
|
||||
]
|
||||
}
|
|
@ -27,7 +27,7 @@
|
|||
"create:placard",
|
||||
"create:pulse_repeater",
|
||||
"create:pulse_extender",
|
||||
"#minecraft:signs",
|
||||
"#minecraft:banners"
|
||||
"#minecraft:banners",
|
||||
"#minecraft:signs"
|
||||
]
|
||||
}
|
|
@ -2,9 +2,9 @@
|
|||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:bee_nest",
|
||||
"minecraft:vine",
|
||||
"minecraft:cocoa",
|
||||
"minecraft:moss_carpet",
|
||||
"minecraft:shroomlight",
|
||||
"minecraft:cocoa"
|
||||
"minecraft:vine"
|
||||
]
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": []
|
||||
}
|
|
@ -4,9 +4,6 @@
|
|||
"create:andesite_bars",
|
||||
"create:brass_bars",
|
||||
"create:copper_bars",
|
||||
"#minecraft:rails",
|
||||
"#minecraft:buttons",
|
||||
"#minecraft:pressure_plates",
|
||||
"minecraft:redstone_wire",
|
||||
"minecraft:redstone_torch",
|
||||
"minecraft:repeater",
|
||||
|
@ -20,6 +17,9 @@
|
|||
"minecraft:tripwire_hook",
|
||||
"minecraft:daylight_detector",
|
||||
"minecraft:target",
|
||||
"minecraft:hopper"
|
||||
"minecraft:hopper",
|
||||
"#minecraft:buttons",
|
||||
"#minecraft:pressure_plates",
|
||||
"#minecraft:rails"
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:milk_bucket",
|
||||
"minecraft:potion"
|
||||
]
|
||||
}
|
|
@ -17,6 +17,8 @@
|
|||
"create:adjustable_chain_gearshift",
|
||||
"create:belt",
|
||||
"create:water_wheel",
|
||||
"create:large_water_wheel",
|
||||
"create:water_wheel_structure",
|
||||
"create:encased_fan",
|
||||
"create:nozzle",
|
||||
"create:turntable",
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
"create:belt",
|
||||
"create:creative_motor",
|
||||
"create:water_wheel",
|
||||
"create:large_water_wheel",
|
||||
"create:water_wheel_structure",
|
||||
"create:encased_fan",
|
||||
"create:nozzle",
|
||||
"create:turntable",
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,20 +2,19 @@ package com.simibubi.create;
|
|||
|
||||
import static com.simibubi.create.AllInteractionBehaviours.interactionBehaviour;
|
||||
import static com.simibubi.create.AllMovementBehaviours.movementBehaviour;
|
||||
import static com.simibubi.create.AllTags.axeOnly;
|
||||
import static com.simibubi.create.AllTags.axeOrPickaxe;
|
||||
import static com.simibubi.create.AllTags.pickaxeOnly;
|
||||
import static com.simibubi.create.AllTags.tagBlockAndItem;
|
||||
import static com.simibubi.create.content.AllSections.SCHEMATICS;
|
||||
import static com.simibubi.create.Create.REGISTRATE;
|
||||
import static com.simibubi.create.content.logistics.block.display.AllDisplayBehaviours.assignDataBehaviour;
|
||||
import static com.simibubi.create.foundation.data.BlockStateGen.axisBlock;
|
||||
import static com.simibubi.create.foundation.data.BlockStateGen.simpleCubeAll;
|
||||
import static com.simibubi.create.foundation.data.CreateRegistrate.connectedTextures;
|
||||
import static com.simibubi.create.foundation.data.ModelGen.customItemModel;
|
||||
import static com.simibubi.create.foundation.data.TagGen.axeOnly;
|
||||
import static com.simibubi.create.foundation.data.TagGen.axeOrPickaxe;
|
||||
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;
|
||||
import static com.simibubi.create.foundation.data.TagGen.tagBlockAndItem;
|
||||
|
||||
import com.simibubi.create.AllTags.AllBlockTags;
|
||||
import com.simibubi.create.AllTags.AllItemTags;
|
||||
import com.simibubi.create.content.AllSections;
|
||||
import com.simibubi.create.content.contraptions.base.CasingBlock;
|
||||
import com.simibubi.create.content.contraptions.components.AssemblyOperatorBlockItem;
|
||||
import com.simibubi.create.content.contraptions.components.actors.BellMovementBehaviour;
|
||||
|
@ -85,7 +84,10 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pul
|
|||
import com.simibubi.create.content.contraptions.components.tracks.ControllerRailBlock;
|
||||
import com.simibubi.create.content.contraptions.components.tracks.ControllerRailGenerator;
|
||||
import com.simibubi.create.content.contraptions.components.turntable.TurntableBlock;
|
||||
import com.simibubi.create.content.contraptions.components.waterwheel.LargeWaterWheelBlock;
|
||||
import com.simibubi.create.content.contraptions.components.waterwheel.LargeWaterWheelBlockItem;
|
||||
import com.simibubi.create.content.contraptions.components.waterwheel.WaterWheelBlock;
|
||||
import com.simibubi.create.content.contraptions.components.waterwheel.WaterWheelStructuralBlock;
|
||||
import com.simibubi.create.content.contraptions.fluids.PipeAttachmentModel;
|
||||
import com.simibubi.create.content.contraptions.fluids.PumpBlock;
|
||||
import com.simibubi.create.content.contraptions.fluids.actors.HosePulleyBlock;
|
||||
|
@ -122,6 +124,7 @@ import com.simibubi.create.content.contraptions.relays.belt.BeltModel;
|
|||
import com.simibubi.create.content.contraptions.relays.elementary.BracketedKineticBlockModel;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.CogwheelBlockItem;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.EncasingRegistry;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.encased.AdjustablePulleyBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.encased.ClutchBlock;
|
||||
|
@ -244,7 +247,7 @@ import com.simibubi.create.foundation.data.CreateRegistrate;
|
|||
import com.simibubi.create.foundation.data.MetalBarsGen;
|
||||
import com.simibubi.create.foundation.data.ModelGen;
|
||||
import com.simibubi.create.foundation.data.SharedProperties;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.simibubi.create.foundation.item.ItemDescription;
|
||||
import com.simibubi.create.foundation.item.UncontainableBlockItem;
|
||||
import com.simibubi.create.foundation.utility.ColorHandlers;
|
||||
import com.simibubi.create.foundation.utility.Couple;
|
||||
|
@ -292,15 +295,12 @@ import net.minecraftforge.common.Tags;
|
|||
|
||||
public class AllBlocks {
|
||||
|
||||
private static final CreateRegistrate REGISTRATE = Create.registrate()
|
||||
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
|
||||
static {
|
||||
REGISTRATE.creativeModeTab(() -> AllCreativeModeTabs.BASE_CREATIVE_TAB);
|
||||
}
|
||||
|
||||
// Schematics
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(SCHEMATICS);
|
||||
}
|
||||
|
||||
public static final BlockEntry<SchematicannonBlock> SCHEMATICANNON =
|
||||
REGISTRATE.block("schematicannon", SchematicannonBlock::new)
|
||||
.initialProperties(() -> Blocks.DISPENSER)
|
||||
|
@ -334,10 +334,6 @@ public class AllBlocks {
|
|||
|
||||
// Kinetics
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(AllSections.KINETICS);
|
||||
}
|
||||
|
||||
public static final BlockEntry<ShaftBlock> SHAFT = REGISTRATE.block("shaft", ShaftBlock::new)
|
||||
.initialProperties(SharedProperties::stone)
|
||||
.properties(p -> p.color(MaterialColor.METAL))
|
||||
|
@ -374,23 +370,26 @@ public class AllBlocks {
|
|||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedShaftBlock> ANDESITE_ENCASED_SHAFT =
|
||||
REGISTRATE.block("andesite_encased_shaft", EncasedShaftBlock::andesite)
|
||||
REGISTRATE.block("andesite_encased_shaft", p -> new EncasedShaftBlock(p, AllBlocks.ANDESITE_CASING::get))
|
||||
.properties(p -> p.color(MaterialColor.PODZOL))
|
||||
.transform(BuilderTransformers.encasedShaft("andesite", () -> AllSpriteShifts.ANDESITE_CASING))
|
||||
.transform(EncasingRegistry.addVariantTo(AllBlocks.SHAFT))
|
||||
.transform(axeOrPickaxe())
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedShaftBlock> BRASS_ENCASED_SHAFT =
|
||||
REGISTRATE.block("brass_encased_shaft", EncasedShaftBlock::brass)
|
||||
REGISTRATE.block("brass_encased_shaft", p -> new EncasedShaftBlock(p, AllBlocks.BRASS_CASING::get))
|
||||
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN))
|
||||
.transform(BuilderTransformers.encasedShaft("brass", () -> AllSpriteShifts.BRASS_CASING))
|
||||
.transform(EncasingRegistry.addVariantTo(AllBlocks.SHAFT))
|
||||
.transform(axeOrPickaxe())
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedCogwheelBlock> ANDESITE_ENCASED_COGWHEEL = REGISTRATE
|
||||
.block("andesite_encased_cogwheel", p -> EncasedCogwheelBlock.andesite(false, p))
|
||||
.block("andesite_encased_cogwheel", p -> new EncasedCogwheelBlock(p, false, AllBlocks.ANDESITE_CASING::get))
|
||||
.properties(p -> p.color(MaterialColor.PODZOL))
|
||||
.transform(BuilderTransformers.encasedCogwheel("andesite", () -> AllSpriteShifts.ANDESITE_CASING))
|
||||
.transform(EncasingRegistry.addVariantTo(AllBlocks.COGWHEEL))
|
||||
.onRegister(CreateRegistrate.connectedTextures(() -> new EncasedCogCTBehaviour(AllSpriteShifts.ANDESITE_CASING,
|
||||
Couple.create(AllSpriteShifts.ANDESITE_ENCASED_COGWHEEL_SIDE,
|
||||
AllSpriteShifts.ANDESITE_ENCASED_COGWHEEL_OTHERSIDE))))
|
||||
|
@ -398,9 +397,10 @@ public class AllBlocks {
|
|||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedCogwheelBlock> BRASS_ENCASED_COGWHEEL =
|
||||
REGISTRATE.block("brass_encased_cogwheel", p -> EncasedCogwheelBlock.brass(false, p))
|
||||
REGISTRATE.block("brass_encased_cogwheel", p -> new EncasedCogwheelBlock(p, false, AllBlocks.BRASS_CASING::get))
|
||||
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN))
|
||||
.transform(BuilderTransformers.encasedCogwheel("brass", () -> AllSpriteShifts.BRASS_CASING))
|
||||
.transform(EncasingRegistry.addVariantTo(AllBlocks.COGWHEEL))
|
||||
.onRegister(CreateRegistrate.connectedTextures(() -> new EncasedCogCTBehaviour(AllSpriteShifts.BRASS_CASING,
|
||||
Couple.create(AllSpriteShifts.BRASS_ENCASED_COGWHEEL_SIDE,
|
||||
AllSpriteShifts.BRASS_ENCASED_COGWHEEL_OTHERSIDE))))
|
||||
|
@ -408,16 +408,18 @@ public class AllBlocks {
|
|||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedCogwheelBlock> ANDESITE_ENCASED_LARGE_COGWHEEL =
|
||||
REGISTRATE.block("andesite_encased_large_cogwheel", p -> EncasedCogwheelBlock.andesite(true, p))
|
||||
REGISTRATE.block("andesite_encased_large_cogwheel", p -> new EncasedCogwheelBlock(p, true, AllBlocks.ANDESITE_CASING::get))
|
||||
.properties(p -> p.color(MaterialColor.PODZOL))
|
||||
.transform(BuilderTransformers.encasedLargeCogwheel("andesite", () -> AllSpriteShifts.ANDESITE_CASING))
|
||||
.transform(EncasingRegistry.addVariantTo(AllBlocks.LARGE_COGWHEEL))
|
||||
.transform(axeOrPickaxe())
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedCogwheelBlock> BRASS_ENCASED_LARGE_COGWHEEL =
|
||||
REGISTRATE.block("brass_encased_large_cogwheel", p -> EncasedCogwheelBlock.brass(true, p))
|
||||
REGISTRATE.block("brass_encased_large_cogwheel", p -> new EncasedCogwheelBlock(p, true, AllBlocks.BRASS_CASING::get))
|
||||
.properties(p -> p.color(MaterialColor.TERRACOTTA_BROWN))
|
||||
.transform(BuilderTransformers.encasedLargeCogwheel("brass", () -> AllSpriteShifts.BRASS_CASING))
|
||||
.transform(EncasingRegistry.addVariantTo(AllBlocks.LARGE_COGWHEEL))
|
||||
.transform(axeOrPickaxe())
|
||||
.register();
|
||||
|
||||
|
@ -531,6 +533,32 @@ public class AllBlocks {
|
|||
.simpleItem()
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<LargeWaterWheelBlock> LARGE_WATER_WHEEL =
|
||||
REGISTRATE.block("large_water_wheel", LargeWaterWheelBlock::new)
|
||||
.initialProperties(SharedProperties::wooden)
|
||||
.properties(p -> p.color(MaterialColor.DIRT))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(axeOrPickaxe())
|
||||
.blockstate((c, p) -> axisBlock(c, p,
|
||||
s -> s.getValue(LargeWaterWheelBlock.EXTENSION) ? AssetLookup.partialBaseModel(c, p, "extension")
|
||||
: AssetLookup.partialBaseModel(c, p)))
|
||||
.transform(BlockStressDefaults.setCapacity(64.0))
|
||||
.transform(BlockStressDefaults.setGeneratorSpeed(WaterWheelBlock::getSpeedRange))
|
||||
.item(LargeWaterWheelBlockItem::new)
|
||||
.transform(customItemModel())
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<WaterWheelStructuralBlock> WATER_WHEEL_STRUCTURAL =
|
||||
REGISTRATE.block("water_wheel_structure", WaterWheelStructuralBlock::new)
|
||||
.initialProperties(SharedProperties::wooden)
|
||||
.blockstate((c, p) -> p.getVariantBuilder(c.get())
|
||||
.forAllStatesExcept(BlockStateGen.mapToAir(p), WaterWheelStructuralBlock.FACING))
|
||||
.properties(p -> p.color(MaterialColor.DIRT))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(axeOrPickaxe())
|
||||
.lang("Large Water Wheel")
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedFanBlock> ENCASED_FAN = REGISTRATE.block("encased_fan", EncasedFanBlock::new)
|
||||
.initialProperties(SharedProperties::stone)
|
||||
.properties(p -> p.color(MaterialColor.PODZOL))
|
||||
|
@ -590,7 +618,7 @@ public class AllBlocks {
|
|||
.transform(axeOrPickaxe())
|
||||
.transform(BuilderTransformers.cuckooClock())
|
||||
.lang("Cuckoo Clock")
|
||||
.onRegisterAfter(Registry.ITEM_REGISTRY, c -> TooltipHelper.referTo(c, CUCKOO_CLOCK))
|
||||
.onRegisterAfter(Registry.ITEM_REGISTRY, c -> ItemDescription.referKey(c, CUCKOO_CLOCK))
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<MillstoneBlock> MILLSTONE = REGISTRATE.block("millstone", MillstoneBlock::new)
|
||||
|
@ -609,10 +637,11 @@ public class AllBlocks {
|
|||
.initialProperties(SharedProperties::stone)
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
.transform(pickaxeOnly())
|
||||
.blockstate(BlockStateGen.axisBlockProvider(false))
|
||||
.blockstate((c, p) -> BlockStateGen.axisBlock(c, p, s -> AssetLookup.partialBaseModel(c, p)))
|
||||
.addLayer(() -> RenderType::cutoutMipped)
|
||||
.transform(BlockStressDefaults.setImpact(8.0))
|
||||
.simpleItem()
|
||||
.item()
|
||||
.transform(customItemModel())
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<CrushingWheelControllerBlock> CRUSHING_WHEEL_CONTROLLER =
|
||||
|
@ -623,10 +652,7 @@ public class AllBlocks {
|
|||
.noDrops()
|
||||
.air())
|
||||
.blockstate((c, p) -> p.getVariantBuilder(c.get())
|
||||
.forAllStatesExcept(state -> ConfiguredModel.builder()
|
||||
.modelFile(p.models()
|
||||
.getExistingFile(p.mcLoc("block/air")))
|
||||
.build(), CrushingWheelControllerBlock.FACING))
|
||||
.forAllStatesExcept(BlockStateGen.mapToAir(p), CrushingWheelControllerBlock.FACING))
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<MechanicalPressBlock> MECHANICAL_PRESS =
|
||||
|
@ -867,7 +893,7 @@ public class AllBlocks {
|
|||
.register();
|
||||
|
||||
public static final BlockEntry<EncasedPipeBlock> ENCASED_FLUID_PIPE =
|
||||
REGISTRATE.block("encased_fluid_pipe", EncasedPipeBlock::new)
|
||||
REGISTRATE.block("encased_fluid_pipe", p -> new EncasedPipeBlock(p, AllBlocks.COPPER_CASING::get))
|
||||
.initialProperties(SharedProperties::copperMetal)
|
||||
.properties(p -> p.color(MaterialColor.TERRACOTTA_LIGHT_GRAY))
|
||||
.properties(BlockBehaviour.Properties::noOcclusion)
|
||||
|
@ -878,6 +904,7 @@ public class AllBlocks {
|
|||
(s, f) -> !s.getValue(EncasedPipeBlock.FACING_TO_PROPERTY_MAP.get(f)))))
|
||||
.onRegister(CreateRegistrate.blockModel(() -> PipeAttachmentModel::new))
|
||||
.loot((p, b) -> p.dropOther(b, FLUID_PIPE.get()))
|
||||
.transform(EncasingRegistry.addVariantTo(AllBlocks.FLUID_PIPE))
|
||||
.register();
|
||||
|
||||
public static final BlockEntry<GlassFluidPipeBlock> GLASS_FLUID_PIPE =
|
||||
|
@ -1430,7 +1457,7 @@ public class AllBlocks {
|
|||
.unlockedBy("has_seat", RegistrateRecipeProvider.has(AllItemTags.SEATS.tag))
|
||||
.save(p, Create.asResource("crafting/kinetics/" + c.getName() + "_from_other_seat"));
|
||||
})
|
||||
.onRegisterAfter(Registry.ITEM_REGISTRY, v -> TooltipHelper.referTo(v, "block.create.brown_seat"))
|
||||
.onRegisterAfter(Registry.ITEM_REGISTRY, v -> ItemDescription.useKey(v, "block.create.seat"))
|
||||
.tag(AllBlockTags.SEATS.tag)
|
||||
.item()
|
||||
.tag(AllItemTags.SEATS.tag)
|
||||
|
@ -1565,10 +1592,6 @@ public class AllBlocks {
|
|||
|
||||
// Logistics
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(AllSections.LOGISTICS);
|
||||
}
|
||||
|
||||
public static final BlockEntry<ArmBlock> MECHANICAL_ARM = REGISTRATE.block("mechanical_arm", ArmBlock::new)
|
||||
.initialProperties(SharedProperties::softMetal)
|
||||
.properties(p -> p.color(MaterialColor.TERRACOTTA_YELLOW))
|
||||
|
@ -2016,10 +2039,6 @@ public class AllBlocks {
|
|||
|
||||
// Curiosities
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(AllSections.CURIOSITIES);
|
||||
}
|
||||
|
||||
public static final BlockEntry<BacktankBlock> COPPER_BACKTANK =
|
||||
REGISTRATE.block("copper_backtank", BacktankBlock::new)
|
||||
.initialProperties(SharedProperties::copperMetal)
|
||||
|
@ -2071,7 +2090,7 @@ public class AllBlocks {
|
|||
.withExistingParent(colourName + "_toolbox", p.modLoc("block/toolbox/block"))
|
||||
.texture("0", p.modLoc("block/toolbox/" + colourName)));
|
||||
})
|
||||
.onRegisterAfter(Registry.ITEM_REGISTRY, v -> TooltipHelper.referTo(v, "block.create.toolbox"))
|
||||
.onRegisterAfter(Registry.ITEM_REGISTRY, v -> ItemDescription.useKey(v, "block.create.toolbox"))
|
||||
.tag(AllBlockTags.TOOLBOXES.tag)
|
||||
.item(UncontainableBlockItem::new)
|
||||
.model((c, p) -> p.withExistingParent(colourName + "_toolbox", p.modLoc("block/toolbox/item"))
|
||||
|
@ -2083,10 +2102,6 @@ public class AllBlocks {
|
|||
|
||||
// Materials
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(AllSections.PALETTES);
|
||||
}
|
||||
|
||||
public static final BlockEntry<Block> ZINC_ORE = REGISTRATE.block("zinc_ore", Block::new)
|
||||
.initialProperties(() -> Blocks.GOLD_ORE)
|
||||
.properties(p -> p.color(MaterialColor.METAL))
|
||||
|
|
14
src/main/java/com/simibubi/create/AllCreativeModeTabs.java
Normal file
14
src/main/java/com/simibubi/create/AllCreativeModeTabs.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.simibubi.create.content.palettes.PalettesCreativeModeTab;
|
||||
import com.simibubi.create.foundation.item.BaseCreativeModeTab;
|
||||
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
|
||||
public class AllCreativeModeTabs {
|
||||
public static final CreativeModeTab BASE_CREATIVE_TAB = new BaseCreativeModeTab();
|
||||
public static final CreativeModeTab PALETTES_CREATIVE_TAB = new PalettesCreativeModeTab();
|
||||
|
||||
public static void init() {
|
||||
}
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import static com.simibubi.create.Create.REGISTRATE;
|
||||
|
||||
import com.simibubi.create.content.curiosities.armor.CapacityEnchantment;
|
||||
import com.simibubi.create.content.curiosities.weapons.PotatoRecoveryEnchantment;
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.tterrag.registrate.util.entry.RegistryEntry;
|
||||
|
||||
import net.minecraft.world.entity.EquipmentSlot;
|
||||
|
@ -11,8 +12,6 @@ import net.minecraft.world.item.enchantment.EnchantmentCategory;
|
|||
|
||||
public class AllEnchantments {
|
||||
|
||||
private static final CreateRegistrate REGISTRATE = Create.registrate();
|
||||
|
||||
public static final RegistryEntry<PotatoRecoveryEnchantment> POTATO_RECOVERY = REGISTRATE.object("potato_recovery")
|
||||
.enchantment(EnchantmentCategory.BOW, PotatoRecoveryEnchantment::new)
|
||||
.addSlots(EquipmentSlot.MAINHAND, EquipmentSlot.OFFHAND)
|
||||
|
|
|
@ -73,7 +73,7 @@ public class AllEntityTypes {
|
|||
MobCategory group, int range, int updateFrequency, boolean sendVelocity, boolean immuneToFire,
|
||||
NonNullConsumer<EntityType.Builder<T>> propertyBuilder) {
|
||||
String id = Lang.asId(name);
|
||||
return (CreateEntityBuilder<T, ?>) Create.registrate()
|
||||
return (CreateEntityBuilder<T, ?>) Create.REGISTRATE
|
||||
.entity(id, factory, group)
|
||||
.properties(b -> b.setTrackingRange(range)
|
||||
.setUpdateInterval(updateFrequency)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import static com.simibubi.create.Create.REGISTRATE;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.simibubi.create.AllTags.AllFluidTags;
|
||||
|
@ -7,7 +9,6 @@ import com.simibubi.create.content.contraptions.fluids.VirtualFluid;
|
|||
import com.simibubi.create.content.contraptions.fluids.potion.PotionFluid;
|
||||
import com.simibubi.create.content.contraptions.fluids.potion.PotionFluid.PotionFluidAttributes;
|
||||
import com.simibubi.create.content.palettes.AllPaletteStoneTypes;
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.tterrag.registrate.util.entry.FluidEntry;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
@ -20,8 +21,6 @@ import net.minecraftforge.fluids.ForgeFlowingFluid;
|
|||
|
||||
public class AllFluids {
|
||||
|
||||
private static final CreateRegistrate REGISTRATE = Create.registrate();
|
||||
|
||||
public static final FluidEntry<PotionFluid> POTION =
|
||||
REGISTRATE.virtualFluid("potion", PotionFluidAttributes::new, PotionFluid::new)
|
||||
.lang("Potion")
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Mov
|
|||
import com.simibubi.create.content.contraptions.components.structureMovement.interaction.DoorMovingInteraction;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.interaction.LeverMovingInteraction;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.interaction.TrapdoorMovingInteraction;
|
||||
import com.simibubi.create.foundation.utility.CreateRegistry;
|
||||
import com.simibubi.create.foundation.utility.AttachedRegistry;
|
||||
import com.tterrag.registrate.util.nullness.NonNullConsumer;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -18,10 +18,9 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.IRegistryDelegate;
|
||||
|
||||
public class AllInteractionBehaviours {
|
||||
private static final CreateRegistry<Block, MovingInteractionBehaviour> BLOCK_BEHAVIOURS = new CreateRegistry<>(ForgeRegistries.BLOCKS);
|
||||
private static final AttachedRegistry<Block, MovingInteractionBehaviour> BLOCK_BEHAVIOURS = new AttachedRegistry<>(ForgeRegistries.BLOCKS);
|
||||
private static final List<BehaviourProvider> GLOBAL_BEHAVIOURS = new ArrayList<>();
|
||||
|
||||
public static void registerBehaviour(ResourceLocation block, MovingInteractionBehaviour provider) {
|
||||
|
@ -32,11 +31,6 @@ public class AllInteractionBehaviours {
|
|||
BLOCK_BEHAVIOURS.register(block, provider);
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void registerBehaviour(IRegistryDelegate<Block> block, MovingInteractionBehaviour provider) {
|
||||
registerBehaviour(block.name(), provider);
|
||||
}
|
||||
|
||||
public static void registerBehaviourProvider(BehaviourProvider provider) {
|
||||
GLOBAL_BEHAVIOURS.add(provider);
|
||||
}
|
||||
|
|
|
@ -4,11 +4,7 @@ import static com.simibubi.create.AllTags.forgeItemTag;
|
|||
import static com.simibubi.create.AllTags.AllItemTags.CREATE_INGOTS;
|
||||
import static com.simibubi.create.AllTags.AllItemTags.CRUSHED_ORES;
|
||||
import static com.simibubi.create.AllTags.AllItemTags.PLATES;
|
||||
import static com.simibubi.create.content.AllSections.CURIOSITIES;
|
||||
import static com.simibubi.create.content.AllSections.KINETICS;
|
||||
import static com.simibubi.create.content.AllSections.LOGISTICS;
|
||||
import static com.simibubi.create.content.AllSections.MATERIALS;
|
||||
import static com.simibubi.create.content.AllSections.SCHEMATICS;
|
||||
import static com.simibubi.create.Create.REGISTRATE;
|
||||
import static com.simibubi.create.foundation.data.recipe.CompatMetals.ALUMINUM;
|
||||
import static com.simibubi.create.foundation.data.recipe.CompatMetals.LEAD;
|
||||
import static com.simibubi.create.foundation.data.recipe.CompatMetals.NICKEL;
|
||||
|
@ -58,8 +54,8 @@ import com.simibubi.create.foundation.data.AssetLookup;
|
|||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.simibubi.create.foundation.data.recipe.CompatMetals;
|
||||
import com.simibubi.create.foundation.item.HiddenIngredientItem;
|
||||
import com.simibubi.create.foundation.item.ItemDescription;
|
||||
import com.simibubi.create.foundation.item.TagDependentIngredientItem;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.tterrag.registrate.util.entry.ItemEntry;
|
||||
|
||||
import net.minecraft.tags.ItemTags;
|
||||
|
@ -72,15 +68,12 @@ import net.minecraftforge.common.Tags;
|
|||
|
||||
public class AllItems {
|
||||
|
||||
private static final CreateRegistrate REGISTRATE = Create.registrate()
|
||||
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
|
||||
|
||||
// Schematics
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(MATERIALS);
|
||||
REGISTRATE.creativeModeTab(() -> AllCreativeModeTabs.BASE_CREATIVE_TAB);
|
||||
}
|
||||
|
||||
// Materials
|
||||
|
||||
public static final ItemEntry<Item> WHEAT_FLOUR =
|
||||
taggedIngredient("wheat_flour", forgeItemTag("flour/wheat"), forgeItemTag("flour")),
|
||||
DOUGH = taggedIngredient("dough", forgeItemTag("dough"), forgeItemTag("dough/wheat")),
|
||||
|
@ -200,10 +193,6 @@ public class AllItems {
|
|||
|
||||
// Kinetics
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(KINETICS);
|
||||
}
|
||||
|
||||
public static final ItemEntry<BeltConnectorItem> BELT_CONNECTOR =
|
||||
REGISTRATE.item("belt_connector", BeltConnectorItem::new)
|
||||
.lang("Mechanical Belt")
|
||||
|
@ -259,7 +248,7 @@ public class AllItems {
|
|||
.tag(AllItemTags.PRESSURIZED_AIR_SOURCES.tag)
|
||||
.register(),
|
||||
|
||||
NETHERITE_BACKTANK = REGISTRATE.item("netherite_backtank", p -> new BacktankItem.MultiLayered(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving"), NETHERITE_BACKTANK_PLACEABLE))
|
||||
NETHERITE_BACKTANK = REGISTRATE.item("netherite_backtank", p -> new BacktankItem.Layered(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving"), NETHERITE_BACKTANK_PLACEABLE))
|
||||
.model(AssetLookup.customGenericItemModel("_", "item"))
|
||||
.tag(AllItemTags.PRESSURIZED_AIR_SOURCES.tag)
|
||||
.register();
|
||||
|
@ -269,7 +258,7 @@ public class AllItems {
|
|||
COPPER_DIVING_HELMET = REGISTRATE.item("copper_diving_helmet", p -> new DivingHelmetItem(AllArmorMaterials.COPPER, p, Create.asResource("copper_diving")))
|
||||
.register(),
|
||||
|
||||
NETHERITE_DIVING_HELMET = REGISTRATE.item("netherite_diving_helmet", p -> new DivingHelmetItem.MultiLayered(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving")))
|
||||
NETHERITE_DIVING_HELMET = REGISTRATE.item("netherite_diving_helmet", p -> new DivingHelmetItem(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving")))
|
||||
.register();
|
||||
|
||||
public static final ItemEntry<? extends DivingBootsItem>
|
||||
|
@ -277,7 +266,7 @@ public class AllItems {
|
|||
COPPER_DIVING_BOOTS = REGISTRATE.item("copper_diving_boots", p -> new DivingBootsItem(AllArmorMaterials.COPPER, p, Create.asResource("copper_diving")))
|
||||
.register(),
|
||||
|
||||
NETHERITE_DIVING_BOOTS = REGISTRATE.item("netherite_diving_boots", p -> new DivingBootsItem.MultiLayered(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving")))
|
||||
NETHERITE_DIVING_BOOTS = REGISTRATE.item("netherite_diving_boots", p -> new DivingBootsItem(ArmorMaterials.NETHERITE, p, Create.asResource("netherite_diving")))
|
||||
.register();
|
||||
|
||||
public static final ItemEntry<SandPaperItem> SAND_PAPER = REGISTRATE.item("sand_paper", SandPaperItem::new)
|
||||
|
@ -286,7 +275,7 @@ public class AllItems {
|
|||
|
||||
public static final ItemEntry<SandPaperItem> RED_SAND_PAPER = REGISTRATE.item("red_sand_paper", SandPaperItem::new)
|
||||
.tag(AllTags.AllItemTags.SANDPAPER.tag)
|
||||
.onRegister(s -> TooltipHelper.referTo(s, SAND_PAPER))
|
||||
.onRegister(s -> ItemDescription.referKey(s, SAND_PAPER))
|
||||
.register();
|
||||
|
||||
public static final ItemEntry<WrenchItem> WRENCH = REGISTRATE.item("wrench", WrenchItem::new)
|
||||
|
@ -309,10 +298,6 @@ public class AllItems {
|
|||
|
||||
// Curiosities
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(CURIOSITIES);
|
||||
}
|
||||
|
||||
public static final ItemEntry<LinkedControllerItem> LINKED_CONTROLLER =
|
||||
REGISTRATE.item("linked_controller", LinkedControllerItem::new)
|
||||
.properties(p -> p.stacksTo(1))
|
||||
|
@ -349,10 +334,6 @@ public class AllItems {
|
|||
|
||||
// Logistics
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(LOGISTICS);
|
||||
}
|
||||
|
||||
public static final ItemEntry<FilterItem> FILTER = REGISTRATE.item("filter", FilterItem::regular)
|
||||
.model(AssetLookup.existingItemModel())
|
||||
.register();
|
||||
|
@ -368,10 +349,6 @@ public class AllItems {
|
|||
|
||||
// Schematics
|
||||
|
||||
static {
|
||||
REGISTRATE.startSection(SCHEMATICS);
|
||||
}
|
||||
|
||||
public static final ItemEntry<Item> EMPTY_SCHEMATIC = REGISTRATE.item("empty_schematic", Item::new)
|
||||
.properties(p -> p.stacksTo(1))
|
||||
.register();
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.simibubi.create.content.curiosities.toolbox.ToolboxContainer;
|
||||
import com.simibubi.create.content.curiosities.toolbox.ToolboxMenu;
|
||||
import com.simibubi.create.content.curiosities.toolbox.ToolboxScreen;
|
||||
import com.simibubi.create.content.curiosities.tools.BlueprintContainer;
|
||||
import com.simibubi.create.content.curiosities.tools.BlueprintMenu;
|
||||
import com.simibubi.create.content.curiosities.tools.BlueprintScreen;
|
||||
import com.simibubi.create.content.logistics.item.LinkedControllerContainer;
|
||||
import com.simibubi.create.content.logistics.item.LinkedControllerMenu;
|
||||
import com.simibubi.create.content.logistics.item.LinkedControllerScreen;
|
||||
import com.simibubi.create.content.logistics.item.filter.AttributeFilterContainer;
|
||||
import com.simibubi.create.content.logistics.item.filter.AttributeFilterMenu;
|
||||
import com.simibubi.create.content.logistics.item.filter.AttributeFilterScreen;
|
||||
import com.simibubi.create.content.logistics.item.filter.FilterContainer;
|
||||
import com.simibubi.create.content.logistics.item.filter.FilterMenu;
|
||||
import com.simibubi.create.content.logistics.item.filter.FilterScreen;
|
||||
import com.simibubi.create.content.logistics.trains.management.schedule.ScheduleContainer;
|
||||
import com.simibubi.create.content.logistics.trains.management.schedule.ScheduleMenu;
|
||||
import com.simibubi.create.content.logistics.trains.management.schedule.ScheduleScreen;
|
||||
import com.simibubi.create.content.schematics.block.SchematicTableContainer;
|
||||
import com.simibubi.create.content.schematics.block.SchematicTableMenu;
|
||||
import com.simibubi.create.content.schematics.block.SchematicTableScreen;
|
||||
import com.simibubi.create.content.schematics.block.SchematicannonContainer;
|
||||
import com.simibubi.create.content.schematics.block.SchematicannonMenu;
|
||||
import com.simibubi.create.content.schematics.block.SchematicannonScreen;
|
||||
import com.tterrag.registrate.builders.MenuBuilder.ForgeMenuFactory;
|
||||
import com.tterrag.registrate.builders.MenuBuilder.ScreenFactory;
|
||||
|
@ -25,35 +25,35 @@ import net.minecraft.client.gui.screens.Screen;
|
|||
import net.minecraft.client.gui.screens.inventory.MenuAccess;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
|
||||
public class AllContainerTypes {
|
||||
public class AllMenuTypes {
|
||||
|
||||
public static final MenuEntry<SchematicTableContainer> SCHEMATIC_TABLE =
|
||||
register("schematic_table", SchematicTableContainer::new, () -> SchematicTableScreen::new);
|
||||
public static final MenuEntry<SchematicTableMenu> SCHEMATIC_TABLE =
|
||||
register("schematic_table", SchematicTableMenu::new, () -> SchematicTableScreen::new);
|
||||
|
||||
public static final MenuEntry<SchematicannonContainer> SCHEMATICANNON =
|
||||
register("schematicannon", SchematicannonContainer::new, () -> SchematicannonScreen::new);
|
||||
public static final MenuEntry<SchematicannonMenu> SCHEMATICANNON =
|
||||
register("schematicannon", SchematicannonMenu::new, () -> SchematicannonScreen::new);
|
||||
|
||||
public static final MenuEntry<FilterContainer> FILTER =
|
||||
register("filter", FilterContainer::new, () -> FilterScreen::new);
|
||||
public static final MenuEntry<FilterMenu> FILTER =
|
||||
register("filter", FilterMenu::new, () -> FilterScreen::new);
|
||||
|
||||
public static final MenuEntry<AttributeFilterContainer> ATTRIBUTE_FILTER =
|
||||
register("attribute_filter", AttributeFilterContainer::new, () -> AttributeFilterScreen::new);
|
||||
public static final MenuEntry<AttributeFilterMenu> ATTRIBUTE_FILTER =
|
||||
register("attribute_filter", AttributeFilterMenu::new, () -> AttributeFilterScreen::new);
|
||||
|
||||
public static final MenuEntry<BlueprintContainer> CRAFTING_BLUEPRINT =
|
||||
register("crafting_blueprint", BlueprintContainer::new, () -> BlueprintScreen::new);
|
||||
public static final MenuEntry<BlueprintMenu> CRAFTING_BLUEPRINT =
|
||||
register("crafting_blueprint", BlueprintMenu::new, () -> BlueprintScreen::new);
|
||||
|
||||
public static final MenuEntry<LinkedControllerContainer> LINKED_CONTROLLER =
|
||||
register("linked_controller", LinkedControllerContainer::new, () -> LinkedControllerScreen::new);
|
||||
public static final MenuEntry<LinkedControllerMenu> LINKED_CONTROLLER =
|
||||
register("linked_controller", LinkedControllerMenu::new, () -> LinkedControllerScreen::new);
|
||||
|
||||
public static final MenuEntry<ToolboxContainer> TOOLBOX =
|
||||
register("toolbox", ToolboxContainer::new, () -> ToolboxScreen::new);
|
||||
public static final MenuEntry<ToolboxMenu> TOOLBOX =
|
||||
register("toolbox", ToolboxMenu::new, () -> ToolboxScreen::new);
|
||||
|
||||
public static final MenuEntry<ScheduleContainer> SCHEDULE =
|
||||
register("schedule", ScheduleContainer::new, () -> ScheduleScreen::new);
|
||||
public static final MenuEntry<ScheduleMenu> SCHEDULE =
|
||||
register("schedule", ScheduleMenu::new, () -> ScheduleScreen::new);
|
||||
|
||||
private static <C extends AbstractContainerMenu, S extends Screen & MenuAccess<C>> MenuEntry<C> register(
|
||||
String name, ForgeMenuFactory<C> factory, NonNullSupplier<ScreenFactory<C, S>> screenFactory) {
|
||||
return Create.registrate()
|
||||
return Create.REGISTRATE
|
||||
.menu(name, factory, screenFactory)
|
||||
.register();
|
||||
}
|
|
@ -10,7 +10,7 @@ import com.simibubi.create.content.contraptions.components.actors.CampfireMoveme
|
|||
import com.simibubi.create.content.contraptions.components.actors.dispenser.DispenserMovementBehaviour;
|
||||
import com.simibubi.create.content.contraptions.components.actors.dispenser.DropperMovementBehaviour;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour;
|
||||
import com.simibubi.create.foundation.utility.CreateRegistry;
|
||||
import com.simibubi.create.foundation.utility.AttachedRegistry;
|
||||
import com.tterrag.registrate.util.nullness.NonNullConsumer;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -18,10 +18,9 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.IRegistryDelegate;
|
||||
|
||||
public class AllMovementBehaviours {
|
||||
private static final CreateRegistry<Block, MovementBehaviour> BLOCK_BEHAVIOURS = new CreateRegistry<>(ForgeRegistries.BLOCKS);
|
||||
private static final AttachedRegistry<Block, MovementBehaviour> BLOCK_BEHAVIOURS = new AttachedRegistry<>(ForgeRegistries.BLOCKS);
|
||||
private static final List<BehaviourProvider> GLOBAL_BEHAVIOURS = new ArrayList<>();
|
||||
|
||||
public static void registerBehaviour(ResourceLocation block, MovementBehaviour behaviour) {
|
||||
|
@ -32,11 +31,6 @@ public class AllMovementBehaviours {
|
|||
BLOCK_BEHAVIOURS.register(block, behaviour);
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void registerBehaviour(IRegistryDelegate<Block> block, MovementBehaviour behaviour) {
|
||||
registerBehaviour(block.name(), behaviour);
|
||||
}
|
||||
|
||||
public static void registerBehaviourProvider(BehaviourProvider provider) {
|
||||
GLOBAL_BEHAVIOURS.add(provider);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import com.simibubi.create.foundation.utility.Lang;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.item.DyeColor;
|
||||
|
||||
public class AllBlockPartials {
|
||||
public class AllPartialModels {
|
||||
|
||||
public static final PartialModel
|
||||
|
|
@ -2,44 +2,29 @@ package com.simibubi.create;
|
|||
|
||||
import static com.simibubi.create.AllTags.NameSpace.FORGE;
|
||||
import static com.simibubi.create.AllTags.NameSpace.MOD;
|
||||
import static com.simibubi.create.AllTags.NameSpace.QUARK;
|
||||
import static com.simibubi.create.AllTags.NameSpace.TIC;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.simibubi.create.foundation.data.recipe.Mods;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
import com.tterrag.registrate.builders.BlockBuilder;
|
||||
import com.tterrag.registrate.builders.ItemBuilder;
|
||||
import com.tterrag.registrate.providers.ProviderType;
|
||||
import com.tterrag.registrate.util.nullness.NonNullFunction;
|
||||
|
||||
import net.minecraft.data.tags.TagsProvider.TagAppender;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.tags.FluidTags;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import net.minecraft.world.level.material.Fluids;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
|
||||
public class AllTags {
|
||||
|
||||
private static final CreateRegistrate REGISTRATE = Create.registrate()
|
||||
.creativeModeTab(() -> Create.BASE_CREATIVE_TAB);
|
||||
|
||||
public static <T extends IForgeRegistryEntry<T>> TagKey<T> optionalTag(IForgeRegistry<T> registry,
|
||||
ResourceLocation id) {
|
||||
return registry.tags()
|
||||
|
@ -62,34 +47,11 @@ public class AllTags {
|
|||
return forgeTag(ForgeRegistries.FLUIDS, path);
|
||||
}
|
||||
|
||||
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> axeOrPickaxe() {
|
||||
return b -> b.tag(BlockTags.MINEABLE_WITH_AXE)
|
||||
.tag(BlockTags.MINEABLE_WITH_PICKAXE);
|
||||
}
|
||||
|
||||
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> axeOnly() {
|
||||
return b -> b.tag(BlockTags.MINEABLE_WITH_AXE);
|
||||
}
|
||||
|
||||
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, BlockBuilder<T, P>> pickaxeOnly() {
|
||||
return b -> b.tag(BlockTags.MINEABLE_WITH_PICKAXE);
|
||||
}
|
||||
|
||||
public static <T extends Block, P> NonNullFunction<BlockBuilder<T, P>, ItemBuilder<BlockItem, BlockBuilder<T, P>>> tagBlockAndItem(
|
||||
String... path) {
|
||||
return b -> {
|
||||
for (String p : path)
|
||||
b.tag(forgeBlockTag(p));
|
||||
ItemBuilder<BlockItem, BlockBuilder<T, P>> item = b.item();
|
||||
for (String p : path)
|
||||
item.tag(forgeItemTag(p));
|
||||
return item;
|
||||
};
|
||||
}
|
||||
|
||||
public enum NameSpace {
|
||||
|
||||
MOD(Create.ID, false, true), FORGE("forge"), TIC("tconstruct"), QUARK("quark")
|
||||
MOD(Create.ID, false, true),
|
||||
FORGE("forge"),
|
||||
TIC("tconstruct"),
|
||||
QUARK("quark")
|
||||
|
||||
;
|
||||
|
||||
|
@ -106,25 +68,23 @@ public class AllTags {
|
|||
this.optionalDefault = optionalDefault;
|
||||
this.alwaysDatagenDefault = alwaysDatagenDefault;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum AllBlockTags {
|
||||
|
||||
BRITTLE,
|
||||
CASING,
|
||||
FAN_TRANSPARENT,
|
||||
NON_MOVABLE,
|
||||
MOVABLE_EMPTY_COLLIDER,
|
||||
ORE_OVERRIDE_STONE,
|
||||
PASSIVE_BOILER_HEATERS,
|
||||
SAFE_NBT,
|
||||
SEATS,
|
||||
TOOLBOXES,
|
||||
TREE_ATTACHMENTS,
|
||||
VALVE_HANDLES,
|
||||
WINDMILL_SAILS,
|
||||
WINDOWABLE,
|
||||
WRENCH_PICKUP,
|
||||
TREE_ATTACHMENTS,
|
||||
COPYCAT_ALLOW,
|
||||
COPYCAT_DENY,
|
||||
|
||||
|
@ -132,11 +92,12 @@ public class AllTags {
|
|||
WG_STONE(FORGE),
|
||||
|
||||
SLIMY_LOGS(TIC),
|
||||
NON_DOUBLE_DOOR(NameSpace.QUARK),
|
||||
NON_DOUBLE_DOOR(QUARK),
|
||||
|
||||
;
|
||||
|
||||
public final TagKey<Block> tag;
|
||||
public final boolean alwaysDatagen;
|
||||
|
||||
AllBlockTags() {
|
||||
this(MOD);
|
||||
|
@ -161,9 +122,7 @@ public class AllTags {
|
|||
} else {
|
||||
tag = BlockTags.create(id);
|
||||
}
|
||||
if (alwaysDatagen) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag));
|
||||
}
|
||||
this.alwaysDatagen = alwaysDatagen;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -176,42 +135,18 @@ public class AllTags {
|
|||
return state.is(tag);
|
||||
}
|
||||
|
||||
public void add(Block... values) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag)
|
||||
.add(values));
|
||||
private static void init() {
|
||||
}
|
||||
|
||||
public void addOptional(Mods mod, String... ids) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> {
|
||||
TagAppender<Block> builder = prov.tag(tag);
|
||||
for (String id : ids)
|
||||
builder.addOptional(mod.asResource(id));
|
||||
});
|
||||
}
|
||||
|
||||
public void includeIn(TagKey<Block> parent) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(parent)
|
||||
.addTag(tag));
|
||||
}
|
||||
|
||||
public void includeIn(AllBlockTags parent) {
|
||||
includeIn(parent.tag);
|
||||
}
|
||||
|
||||
public void includeAll(TagKey<Block> child) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.BLOCK_TAGS, prov -> prov.tag(tag)
|
||||
.addTag(child));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum AllItemTags {
|
||||
|
||||
BLAZE_BURNER_FUEL_REGULAR(MOD, "blaze_burner_fuel/regular"),
|
||||
BLAZE_BURNER_FUEL_SPECIAL(MOD, "blaze_burner_fuel/special"),
|
||||
CASING,
|
||||
CREATE_INGOTS,
|
||||
CRUSHED_ORES,
|
||||
MODDED_STRIPPED_LOGS,
|
||||
MODDED_STRIPPED_WOOD,
|
||||
PRESSURIZED_AIR_SOURCES,
|
||||
SANDPAPER,
|
||||
SEATS,
|
||||
|
@ -221,18 +156,17 @@ public class AllTags {
|
|||
VALVE_HANDLES,
|
||||
VANILLA_STRIPPED_LOGS,
|
||||
VANILLA_STRIPPED_WOOD,
|
||||
MODDED_STRIPPED_LOGS,
|
||||
MODDED_STRIPPED_WOOD,
|
||||
DEPLOYABLE_DRINK,
|
||||
|
||||
STRIPPED_LOGS(FORGE),
|
||||
STRIPPED_WOOD(FORGE),
|
||||
BEACON_PAYMENT(FORGE),
|
||||
PLATES(FORGE),
|
||||
WRENCH(FORGE, "tools/wrench")
|
||||
|
||||
;
|
||||
|
||||
public final TagKey<Item> tag;
|
||||
public final boolean alwaysDatagen;
|
||||
|
||||
AllItemTags() {
|
||||
this(MOD);
|
||||
|
@ -257,9 +191,7 @@ public class AllTags {
|
|||
} else {
|
||||
tag = ItemTags.create(id);
|
||||
}
|
||||
if (alwaysDatagen) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag));
|
||||
}
|
||||
this.alwaysDatagen = alwaysDatagen;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -272,37 +204,11 @@ public class AllTags {
|
|||
return stack.is(tag);
|
||||
}
|
||||
|
||||
public void add(Item... values) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)
|
||||
.add(values));
|
||||
private static void init() {
|
||||
}
|
||||
|
||||
public void addOptional(Mods mod, String... ids) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> {
|
||||
TagAppender<Item> builder = prov.tag(tag);
|
||||
for (String id : ids)
|
||||
builder.addOptional(mod.asResource(id));
|
||||
});
|
||||
}
|
||||
|
||||
public void includeIn(TagKey<Item> parent) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(parent)
|
||||
.addTag(tag));
|
||||
}
|
||||
|
||||
public void includeIn(AllItemTags parent) {
|
||||
includeIn(parent.tag);
|
||||
}
|
||||
|
||||
public void includeAll(TagKey<Item> child) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.ITEM_TAGS, prov -> prov.tag(tag)
|
||||
.addTag(child));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum AllFluidTags {
|
||||
|
||||
BOTTOMLESS_ALLOW(MOD, "bottomless/allow"),
|
||||
BOTTOMLESS_DENY(MOD, "bottomless/deny"),
|
||||
|
||||
|
@ -311,6 +217,7 @@ public class AllTags {
|
|||
;
|
||||
|
||||
public final TagKey<Fluid> tag;
|
||||
public final boolean alwaysDatagen;
|
||||
|
||||
AllFluidTags() {
|
||||
this(MOD);
|
||||
|
@ -335,9 +242,7 @@ public class AllTags {
|
|||
} else {
|
||||
tag = FluidTags.create(id);
|
||||
}
|
||||
if (alwaysDatagen) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag));
|
||||
}
|
||||
this.alwaysDatagen = alwaysDatagen;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
@ -349,128 +254,13 @@ public class AllTags {
|
|||
return state.is(tag);
|
||||
}
|
||||
|
||||
public void add(Fluid... values) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag)
|
||||
.add(values));
|
||||
}
|
||||
|
||||
public void includeIn(TagKey<Fluid> parent) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(parent)
|
||||
.addTag(tag));
|
||||
}
|
||||
|
||||
public void includeIn(AllFluidTags parent) {
|
||||
includeIn(parent.tag);
|
||||
}
|
||||
|
||||
public void includeAll(TagKey<Fluid> child) {
|
||||
REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, prov -> prov.tag(tag)
|
||||
.addTag(child));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
AllFluidTags.BOTTOMLESS_ALLOW.add(Fluids.WATER, Fluids.LAVA);
|
||||
|
||||
AllItemTags.VANILLA_STRIPPED_LOGS.add(Items.STRIPPED_ACACIA_LOG, Items.STRIPPED_BIRCH_LOG,
|
||||
Items.STRIPPED_CRIMSON_STEM, Items.STRIPPED_DARK_OAK_LOG, Items.STRIPPED_JUNGLE_LOG, Items.STRIPPED_OAK_LOG,
|
||||
Items.STRIPPED_SPRUCE_LOG, Items.STRIPPED_WARPED_STEM);
|
||||
|
||||
AllItemTags.VANILLA_STRIPPED_LOGS.includeIn(AllItemTags.STRIPPED_LOGS);
|
||||
|
||||
AllItemTags.VANILLA_STRIPPED_WOOD.add(Items.STRIPPED_ACACIA_WOOD, Items.STRIPPED_BIRCH_WOOD,
|
||||
Items.STRIPPED_CRIMSON_HYPHAE, Items.STRIPPED_DARK_OAK_WOOD, Items.STRIPPED_JUNGLE_WOOD,
|
||||
Items.STRIPPED_OAK_WOOD, Items.STRIPPED_SPRUCE_WOOD, Items.STRIPPED_WARPED_HYPHAE);
|
||||
|
||||
AllItemTags.VANILLA_STRIPPED_WOOD.includeIn(AllItemTags.STRIPPED_WOOD);
|
||||
|
||||
AllItemTags.CREATE_INGOTS.includeIn(AllItemTags.BEACON_PAYMENT);
|
||||
AllItemTags.CREATE_INGOTS.includeIn(Tags.Items.INGOTS);
|
||||
|
||||
AllItemTags.UPRIGHT_ON_BELT.add(Items.GLASS_BOTTLE, Items.POTION, Items.SPLASH_POTION, Items.LINGERING_POTION,
|
||||
Items.HONEY_BOTTLE, Items.CAKE);
|
||||
|
||||
AllItemTags.SLEEPERS.add(Items.STONE_SLAB, Items.SMOOTH_STONE_SLAB, Items.ANDESITE_SLAB);
|
||||
|
||||
AllBlockTags.WINDMILL_SAILS.includeAll(BlockTags.WOOL);
|
||||
|
||||
AllBlockTags.BRITTLE.includeAll(BlockTags.DOORS);
|
||||
AllBlockTags.BRITTLE.includeAll(BlockTags.BEDS);
|
||||
AllBlockTags.BRITTLE.add(Blocks.FLOWER_POT, Blocks.BELL, Blocks.COCOA);
|
||||
|
||||
AllBlockTags.FAN_TRANSPARENT.includeAll(BlockTags.FENCES);
|
||||
AllBlockTags.FAN_TRANSPARENT.includeAll(BlockTags.CAMPFIRES);
|
||||
AllBlockTags.FAN_TRANSPARENT.add(Blocks.IRON_BARS);
|
||||
|
||||
AllBlockTags.PASSIVE_BOILER_HEATERS.includeAll(BlockTags.FIRE);
|
||||
AllBlockTags.PASSIVE_BOILER_HEATERS.includeAll(BlockTags.CAMPFIRES);
|
||||
AllBlockTags.PASSIVE_BOILER_HEATERS.add(Blocks.MAGMA_BLOCK, Blocks.LAVA);
|
||||
|
||||
AllBlockTags.SAFE_NBT.includeAll(BlockTags.SIGNS);
|
||||
AllBlockTags.SAFE_NBT.includeAll(BlockTags.BANNERS);
|
||||
|
||||
AllBlockTags.COPYCAT_ALLOW.add(Blocks.BARREL);
|
||||
AllBlockTags.COPYCAT_DENY.includeAll(BlockTags.CAULDRONS);
|
||||
AllBlockTags.COPYCAT_DENY.includeAll(BlockTags.SAPLINGS);
|
||||
AllBlockTags.COPYCAT_DENY.includeAll(BlockTags.CLIMBABLE);
|
||||
|
||||
AllBlockTags.WRENCH_PICKUP.includeAll(BlockTags.RAILS);
|
||||
AllBlockTags.WRENCH_PICKUP.includeAll(BlockTags.BUTTONS);
|
||||
AllBlockTags.WRENCH_PICKUP.includeAll(BlockTags.PRESSURE_PLATES);
|
||||
AllBlockTags.WRENCH_PICKUP.add(Blocks.REDSTONE_WIRE, Blocks.REDSTONE_TORCH, Blocks.REPEATER, Blocks.LEVER,
|
||||
Blocks.COMPARATOR, Blocks.OBSERVER, Blocks.REDSTONE_WALL_TORCH, Blocks.PISTON, Blocks.STICKY_PISTON,
|
||||
Blocks.TRIPWIRE, Blocks.TRIPWIRE_HOOK, Blocks.DAYLIGHT_DETECTOR, Blocks.TARGET, Blocks.HOPPER);
|
||||
|
||||
AllBlockTags.TREE_ATTACHMENTS.add(Blocks.BEE_NEST, Blocks.VINE, Blocks.MOSS_CARPET, Blocks.SHROOMLIGHT,
|
||||
Blocks.COCOA);
|
||||
|
||||
AllBlockTags.ORE_OVERRIDE_STONE.includeAll(BlockTags.STONE_ORE_REPLACEABLES);
|
||||
|
||||
registerCompat();
|
||||
}
|
||||
|
||||
private static void registerCompat() {
|
||||
AllBlockTags.NON_MOVABLE.addOptional(Mods.IE, "connector_lv", "connector_lv_relay", "connector_mv",
|
||||
"connector_mv_relay", "connector_hv", "connector_hv_relay", "connector_bundled", "connector_structural",
|
||||
"connector_redstone", "connector_probe", "breaker_switch");
|
||||
|
||||
strippedWoodCompat(Mods.ARS_N, "blue_archwood", "purple_archwood", "green_archwood", "red_archwood");
|
||||
strippedWoodCompat(Mods.BTN, "livingwood", "dreamwood");
|
||||
strippedWoodCompat(Mods.FA, "cherrywood", "mysterywood");
|
||||
strippedWoodCompat(Mods.HEX, "akashic");
|
||||
strippedWoodCompat(Mods.ID, "menril");
|
||||
strippedWoodCompat(Mods.BYG, "aspen", "baobab", "enchanted", "cherry", "cika", "cypress", "ebony", "ether",
|
||||
"fir", "green_enchanted", "holly", "jacaranda", "lament", "mahogany", "mangrove", "maple", "nightshade",
|
||||
"palm", "palo_verde", "pine", "rainbow_eucalyptus", "redwood", "skyris", "willow", "witch_hazel",
|
||||
"zelkova");
|
||||
strippedWoodCompat(Mods.SG, "netherwood");
|
||||
strippedWoodCompat(Mods.TF, "twilight_oak", "canopy", "mangrove", "dark", "time", "transformation", "mining",
|
||||
"sorting");
|
||||
strippedWoodCompat(Mods.TIC, "greenheart", "skyroot", "bloodshroom");
|
||||
strippedWoodCompat(Mods.AP, "twisted");
|
||||
strippedWoodCompat(Mods.Q, "azalea", "blossom");
|
||||
strippedWoodCompat(Mods.ECO, "coconut", "walnut", "azalea");
|
||||
strippedWoodCompat(Mods.BOP, "fir", "redwood", "cherry", "mahogany", "jacaranda", "palm", "willow", "dead",
|
||||
"magic", "umbran", "hellbark");
|
||||
strippedWoodCompat(Mods.BSK, "bluebright", "starlit", "frostbright", "lunar", "dusk", "maple", "cherry");
|
||||
|
||||
AllItemTags.MODDED_STRIPPED_LOGS.addOptional(Mods.BYG, "stripped_bulbis_stem");
|
||||
AllItemTags.MODDED_STRIPPED_WOOD.addOptional(Mods.BYG, "stripped_bulbis_wood");
|
||||
|
||||
AllItemTags.MODDED_STRIPPED_LOGS.includeIn(AllItemTags.STRIPPED_LOGS);
|
||||
AllItemTags.MODDED_STRIPPED_WOOD.includeIn(AllItemTags.STRIPPED_WOOD);
|
||||
}
|
||||
|
||||
private static void strippedWoodCompat(Mods mod, String... woodtypes) {
|
||||
for (int i = 0; i < woodtypes.length; i++) {
|
||||
String type = woodtypes[i];
|
||||
String strippedPre = mod.strippedIsSuffix ? "" : "stripped_";
|
||||
String strippedPost = mod.strippedIsSuffix ? "_stripped" : "";
|
||||
AllItemTags.MODDED_STRIPPED_LOGS.addOptional(mod, strippedPre + type + "_log" + strippedPost);
|
||||
AllItemTags.MODDED_STRIPPED_WOOD.addOptional(mod,
|
||||
strippedPre + type + (mod.omitWoodSuffix ? "" : "_wood") + strippedPost);
|
||||
private static void init() {
|
||||
}
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
AllBlockTags.init();
|
||||
AllItemTags.init();
|
||||
AllFluidTags.init();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,15 +2,14 @@ package com.simibubi.create;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.mojang.logging.LogUtils;
|
||||
import com.simibubi.create.api.behaviour.BlockSpoutingBehaviour;
|
||||
import com.simibubi.create.compat.Mods;
|
||||
import com.simibubi.create.compat.curios.Curios;
|
||||
import com.simibubi.create.content.CreateItemGroup;
|
||||
import com.simibubi.create.content.contraptions.TorquePropagator;
|
||||
import com.simibubi.create.content.contraptions.fluids.tank.BoilerHeaters;
|
||||
import com.simibubi.create.content.curiosities.deco.SlidingDoorBlock;
|
||||
|
@ -20,7 +19,6 @@ import com.simibubi.create.content.logistics.block.display.AllDisplayBehaviours;
|
|||
import com.simibubi.create.content.logistics.block.mechanicalArm.AllArmInteractionPointTypes;
|
||||
import com.simibubi.create.content.logistics.trains.GlobalRailwayManager;
|
||||
import com.simibubi.create.content.palettes.AllPaletteBlocks;
|
||||
import com.simibubi.create.content.palettes.PalettesItemGroup;
|
||||
import com.simibubi.create.content.schematics.ServerSchematicLoader;
|
||||
import com.simibubi.create.content.schematics.filtering.SchematicInstances;
|
||||
import com.simibubi.create.foundation.advancement.AllAdvancements;
|
||||
|
@ -29,25 +27,29 @@ import com.simibubi.create.foundation.block.CopperRegistries;
|
|||
import com.simibubi.create.foundation.command.ServerLagger;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.config.ContraptionMovementSetting;
|
||||
import com.simibubi.create.foundation.data.AllLangPartials;
|
||||
import com.simibubi.create.foundation.data.CreateRegistrate;
|
||||
import com.simibubi.create.foundation.data.LangMerger;
|
||||
import com.simibubi.create.foundation.data.TagGen;
|
||||
import com.simibubi.create.foundation.data.recipe.MechanicalCraftingRecipeGen;
|
||||
import com.simibubi.create.foundation.data.recipe.ProcessingRecipeGen;
|
||||
import com.simibubi.create.foundation.data.recipe.SequencedAssemblyRecipeGen;
|
||||
import com.simibubi.create.foundation.data.recipe.StandardRecipeGen;
|
||||
import com.simibubi.create.foundation.item.ItemDescription;
|
||||
import com.simibubi.create.foundation.item.KineticStats;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper.Palette;
|
||||
import com.simibubi.create.foundation.item.TooltipModifier;
|
||||
import com.simibubi.create.foundation.networking.AllPackets;
|
||||
import com.simibubi.create.foundation.utility.CreateRegistry;
|
||||
import com.simibubi.create.foundation.utility.AttachedRegistry;
|
||||
import com.simibubi.create.foundation.worldgen.AllFeatures;
|
||||
import com.simibubi.create.foundation.worldgen.AllOreFeatureConfigEntries;
|
||||
import com.simibubi.create.foundation.worldgen.AllPlacementModifiers;
|
||||
import com.simibubi.create.foundation.worldgen.BuiltinRegistration;
|
||||
import com.tterrag.registrate.util.nullness.NonNullSupplier;
|
||||
|
||||
import net.minecraft.data.DataGenerator;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.common.ForgeMod;
|
||||
|
@ -68,25 +70,31 @@ public class Create {
|
|||
public static final String NAME = "Create";
|
||||
public static final String VERSION = "0.5.1-unstable";
|
||||
|
||||
public static final Logger LOGGER = LogManager.getLogger();
|
||||
public static final Logger LOGGER = LogUtils.getLogger();
|
||||
|
||||
public static final Gson GSON = new GsonBuilder().setPrettyPrinting()
|
||||
.disableHtmlEscaping()
|
||||
.create();
|
||||
|
||||
public static final CreativeModeTab BASE_CREATIVE_TAB = new CreateItemGroup();
|
||||
public static final CreativeModeTab PALETTES_CREATIVE_TAB = new PalettesItemGroup();
|
||||
/** Use the {@link Random} of a local {@link Level} or {@link Entity} or create one */
|
||||
@Deprecated
|
||||
public static final Random RANDOM = new Random();
|
||||
|
||||
public static final CreateRegistrate REGISTRATE = CreateRegistrate.create(ID);
|
||||
|
||||
static {
|
||||
// TODO 0.5.1: choose color palette
|
||||
REGISTRATE.setTooltipModifierFactory(item -> {
|
||||
return new ItemDescription.Modifier(item, Palette.BLUE)
|
||||
.andThen(TooltipModifier.mapNull(KineticStats.create(item)));
|
||||
});
|
||||
}
|
||||
|
||||
public static final ServerSchematicLoader SCHEMATIC_RECEIVER = new ServerSchematicLoader();
|
||||
public static final RedstoneLinkNetworkHandler REDSTONE_LINK_NETWORK_HANDLER = new RedstoneLinkNetworkHandler();
|
||||
public static final TorquePropagator TORQUE_PROPAGATOR = new TorquePropagator();
|
||||
public static final GlobalRailwayManager RAILWAYS = new GlobalRailwayManager();
|
||||
public static final ServerLagger LAGGER = new ServerLagger();
|
||||
/** Use the {@link Random} of a local {@link Level} or {@link Entity} or create one */
|
||||
@Deprecated
|
||||
public static final Random RANDOM = new Random();
|
||||
|
||||
private static final NonNullSupplier<CreateRegistrate> REGISTRATE = CreateRegistrate.lazy(ID);
|
||||
|
||||
public Create() {
|
||||
onCtor();
|
||||
|
@ -99,15 +107,18 @@ public class Create {
|
|||
.getModEventBus();
|
||||
IEventBus forgeEventBus = MinecraftForge.EVENT_BUS;
|
||||
|
||||
REGISTRATE.registerEventListeners(modEventBus);
|
||||
|
||||
AllSoundEvents.prepare();
|
||||
AllTags.init();
|
||||
AllCreativeModeTabs.init();
|
||||
AllBlocks.register();
|
||||
AllItems.register();
|
||||
AllFluids.register();
|
||||
AllTags.register();
|
||||
AllPaletteBlocks.register();
|
||||
AllContainerTypes.register();
|
||||
AllMenuTypes.register();
|
||||
AllEntityTypes.register();
|
||||
AllTileEntities.register();
|
||||
AllBlockEntityTypes.register();
|
||||
AllEnchantments.register();
|
||||
AllRecipeTypes.register(modEventBus);
|
||||
AllParticleTypes.register(modEventBus);
|
||||
|
@ -138,16 +149,16 @@ public class Create {
|
|||
|
||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> CreateClient.onCtorClient(modEventBus, forgeEventBus));
|
||||
|
||||
Mods.CURIOS.executeIfInstalled(() -> Curios::init);
|
||||
Mods.CURIOS.executeIfInstalled(() -> () -> Curios.init(modEventBus, forgeEventBus));
|
||||
}
|
||||
|
||||
public static void init(final FMLCommonSetupEvent event) {
|
||||
CreateRegistry.unwrapAll();
|
||||
AllPackets.registerPackets();
|
||||
SchematicInstances.register();
|
||||
BuiltinPotatoProjectileTypes.register();
|
||||
|
||||
event.enqueueWork(() -> {
|
||||
AttachedRegistry.unwrapAll();
|
||||
AllAdvancements.register();
|
||||
AllTriggers.register();
|
||||
BoilerHeaters.registerDefaults();
|
||||
|
@ -155,9 +166,10 @@ public class Create {
|
|||
}
|
||||
|
||||
public static void gatherData(GatherDataEvent event) {
|
||||
TagGen.datagen();
|
||||
DataGenerator gen = event.getGenerator();
|
||||
if (event.includeClient()) {
|
||||
gen.addProvider(new LangMerger(gen));
|
||||
gen.addProvider(new LangMerger(gen, ID, NAME, AllLangPartials.values()));
|
||||
gen.addProvider(AllSoundEvents.provider(gen));
|
||||
}
|
||||
if (event.includeServer()) {
|
||||
|
@ -170,10 +182,6 @@ public class Create {
|
|||
}
|
||||
}
|
||||
|
||||
public static CreateRegistrate registrate() {
|
||||
return REGISTRATE.get();
|
||||
}
|
||||
|
||||
public static ResourceLocation asResource(String path) {
|
||||
return new ResourceLocation(ID, path);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.simibubi.create;
|
||||
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueSelectionHandler;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.interaction.controls.TrainHUD;
|
||||
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
|
||||
|
@ -76,15 +76,15 @@ public class CreateClient {
|
|||
}
|
||||
|
||||
public static void clientInit(final FMLClientSetupEvent event) {
|
||||
BUFFER_CACHE.registerCompartment(CachedBufferer.GENERIC_TILE);
|
||||
BUFFER_CACHE.registerCompartment(CachedBufferer.GENERIC_BLOCK);
|
||||
BUFFER_CACHE.registerCompartment(CachedBufferer.PARTIAL);
|
||||
BUFFER_CACHE.registerCompartment(CachedBufferer.DIRECTIONAL_PARTIAL);
|
||||
BUFFER_CACHE.registerCompartment(KineticTileEntityRenderer.KINETIC_TILE);
|
||||
BUFFER_CACHE.registerCompartment(KineticBlockEntityRenderer.KINETIC_BLOCK);
|
||||
BUFFER_CACHE.registerCompartment(SBBContraptionManager.CONTRAPTION, 20);
|
||||
BUFFER_CACHE.registerCompartment(WorldSectionElement.DOC_WORLD_SECTION, 20);
|
||||
|
||||
AllKeys.register();
|
||||
AllBlockPartials.init();
|
||||
AllPartialModels.init();
|
||||
AllStitchedTextures.init();
|
||||
|
||||
PonderIndex.register();
|
||||
|
@ -121,7 +121,7 @@ public class CreateClient {
|
|||
if (mc.options.graphicsMode != GraphicsStatus.FABULOUS)
|
||||
return;
|
||||
|
||||
if (AllConfigs.CLIENT.ignoreFabulousWarning.get())
|
||||
if (AllConfigs.client().ignoreFabulousWarning.get())
|
||||
return;
|
||||
|
||||
MutableComponent text = ComponentUtils.wrapInSquareBrackets(Components.literal("WARN"))
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.function.Consumer;
|
|||
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.compat.tconstruct.SpoutCasting;
|
||||
import com.simibubi.create.content.contraptions.fluids.actors.SpoutTileEntity;
|
||||
import com.simibubi.create.content.contraptions.fluids.actors.SpoutBlockEntity;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
@ -43,7 +43,7 @@ public abstract class BlockSpoutingBehaviour {
|
|||
* @param simulate whether the spout is testing or actually performing this behaviour
|
||||
* @return amount filled into the block, 0 to idle/cancel
|
||||
*/
|
||||
public abstract int fillBlock(Level world, BlockPos pos, SpoutTileEntity spout, FluidStack availableFluid,
|
||||
public abstract int fillBlock(Level world, BlockPos pos, SpoutBlockEntity spout, FluidStack availableFluid,
|
||||
boolean simulate);
|
||||
|
||||
public static void registerDefaults() {
|
||||
|
|
|
@ -13,8 +13,8 @@ import javax.annotation.Nullable;
|
|||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import com.simibubi.create.content.contraptions.fluids.tank.CreativeFluidTankTileEntity;
|
||||
import com.simibubi.create.foundation.tileEntity.IMultiTileContainer;
|
||||
import com.simibubi.create.content.contraptions.fluids.tank.CreativeFluidTankBlockEntity;
|
||||
import com.simibubi.create.foundation.blockEntity.IMultiBlockEntityContainer;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
|
@ -31,14 +31,14 @@ import net.minecraftforge.items.CapabilityItemHandler;
|
|||
|
||||
public class ConnectivityHandler {
|
||||
|
||||
public static <T extends BlockEntity & IMultiTileContainer> void formMulti(T be) {
|
||||
public static <T extends BlockEntity & IMultiBlockEntityContainer> void formMulti(T be) {
|
||||
SearchCache<T> cache = new SearchCache<>();
|
||||
List<T> frontier = new ArrayList<>();
|
||||
frontier.add(be);
|
||||
formMulti(be.getType(), be.getLevel(), cache, frontier);
|
||||
}
|
||||
|
||||
private static <T extends BlockEntity & IMultiTileContainer> void formMulti(BlockEntityType<?> type,
|
||||
private static <T extends BlockEntity & IMultiBlockEntityContainer> void formMulti(BlockEntityType<?> type,
|
||||
BlockGetter level, SearchCache<T> cache, List<T> frontier) {
|
||||
PriorityQueue<Pair<Integer, T>> creationQueue = makeCreationQueue();
|
||||
Set<BlockPos> visited = new HashSet<>();
|
||||
|
@ -110,7 +110,7 @@ public class ConnectivityHandler {
|
|||
}
|
||||
}
|
||||
|
||||
private static <T extends BlockEntity & IMultiTileContainer> int tryToFormNewMulti(T be, SearchCache<T> cache,
|
||||
private static <T extends BlockEntity & IMultiBlockEntityContainer> int tryToFormNewMulti(T be, SearchCache<T> cache,
|
||||
boolean simulate) {
|
||||
int bestWidth = 1;
|
||||
int bestAmount = -1;
|
||||
|
@ -132,7 +132,7 @@ public class ConnectivityHandler {
|
|||
return bestAmount;
|
||||
|
||||
splitMultiAndInvalidate(be, cache, false);
|
||||
if (be instanceof IMultiTileContainer.Fluid ifluid && ifluid.hasTank())
|
||||
if (be instanceof IMultiBlockEntityContainer.Fluid ifluid && ifluid.hasTank())
|
||||
ifluid.setTankSize(0, bestAmount);
|
||||
|
||||
tryToFormNewMultiOfWidth(be, bestWidth, cache, false);
|
||||
|
@ -145,7 +145,7 @@ public class ConnectivityHandler {
|
|||
return bestAmount;
|
||||
}
|
||||
|
||||
private static <T extends BlockEntity & IMultiTileContainer> int tryToFormNewMultiOfWidth(T be, int width,
|
||||
private static <T extends BlockEntity & IMultiBlockEntityContainer> int tryToFormNewMultiOfWidth(T be, int width,
|
||||
SearchCache<T> cache, boolean simulate) {
|
||||
int amount = 0;
|
||||
int height = 0;
|
||||
|
@ -158,7 +158,7 @@ public class ConnectivityHandler {
|
|||
// optional fluid handling
|
||||
IFluidTank beTank = null;
|
||||
FluidStack fluid = FluidStack.EMPTY;
|
||||
if (be instanceof IMultiTileContainer.Fluid ifluid && ifluid.hasTank()) {
|
||||
if (be instanceof IMultiBlockEntityContainer.Fluid ifluid && ifluid.hasTank()) {
|
||||
beTank = ifluid.getTank(0);
|
||||
fluid = beTank.getFluid();
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ public class ConnectivityHandler {
|
|||
break Search;
|
||||
}
|
||||
}
|
||||
if (controller instanceof IMultiTileContainer.Fluid ifluidCon && ifluidCon.hasTank()) {
|
||||
if (controller instanceof IMultiBlockEntityContainer.Fluid ifluidCon && ifluidCon.hasTank()) {
|
||||
FluidStack otherFluid = ifluidCon.getFluid(0);
|
||||
if (!fluid.isEmpty() && !otherFluid.isEmpty() && !fluid.isFluidEqual(otherFluid))
|
||||
break Search;
|
||||
|
@ -245,17 +245,17 @@ public class ConnectivityHandler {
|
|||
|
||||
extraData = be.modifyExtraData(extraData);
|
||||
|
||||
if (part instanceof IMultiTileContainer.Fluid ifluidPart && ifluidPart.hasTank()) {
|
||||
if (part instanceof IMultiBlockEntityContainer.Fluid ifluidPart && ifluidPart.hasTank()) {
|
||||
IFluidTank tankAt = ifluidPart.getTank(0);
|
||||
FluidStack fluidAt = tankAt.getFluid();
|
||||
if (!fluidAt.isEmpty()) {
|
||||
// making this generic would be a rather large mess, unfortunately
|
||||
if (beTank != null && fluid.isEmpty()
|
||||
&& beTank instanceof CreativeFluidTankTileEntity.CreativeSmartFluidTank) {
|
||||
((CreativeFluidTankTileEntity.CreativeSmartFluidTank) beTank)
|
||||
&& beTank instanceof CreativeFluidTankBlockEntity.CreativeSmartFluidTank) {
|
||||
((CreativeFluidTankBlockEntity.CreativeSmartFluidTank) beTank)
|
||||
.setContainedFluid(fluidAt);
|
||||
}
|
||||
if (be instanceof IMultiTileContainer.Fluid ifluidBE && ifluidBE.hasTank()
|
||||
if (be instanceof IMultiBlockEntityContainer.Fluid ifluidBE && ifluidBE.hasTank()
|
||||
&& beTank != null) {
|
||||
beTank.fill(fluidAt, IFluidHandler.FluidAction.EXECUTE);
|
||||
}
|
||||
|
@ -278,18 +278,18 @@ public class ConnectivityHandler {
|
|||
return amount;
|
||||
}
|
||||
|
||||
public static <T extends BlockEntity & IMultiTileContainer> void splitMulti(T be) {
|
||||
public static <T extends BlockEntity & IMultiBlockEntityContainer> void splitMulti(T be) {
|
||||
splitMultiAndInvalidate(be, null, false);
|
||||
}
|
||||
|
||||
// tryReconnect helps whenever only a few tanks have been removed
|
||||
private static <T extends BlockEntity & IMultiTileContainer> void splitMultiAndInvalidate(T be,
|
||||
private static <T extends BlockEntity & IMultiBlockEntityContainer> void splitMultiAndInvalidate(T be,
|
||||
@Nullable SearchCache<T> cache, boolean tryReconnect) {
|
||||
Level level = be.getLevel();
|
||||
if (level == null)
|
||||
return;
|
||||
|
||||
be = be.getControllerTE();
|
||||
be = be.getControllerBE();
|
||||
if (be == null)
|
||||
return;
|
||||
|
||||
|
@ -305,7 +305,7 @@ public class ConnectivityHandler {
|
|||
// fluid handling, if present
|
||||
FluidStack toDistribute = FluidStack.EMPTY;
|
||||
int maxCapacity = 0;
|
||||
if (be instanceof IMultiTileContainer.Fluid ifluidBE && ifluidBE.hasTank()) {
|
||||
if (be instanceof IMultiBlockEntityContainer.Fluid ifluidBE && ifluidBE.hasTank()) {
|
||||
toDistribute = ifluidBE.getFluid(0);
|
||||
maxCapacity = ifluidBE.getTankSize(0);
|
||||
if (!toDistribute.isEmpty() && !be.isRemoved())
|
||||
|
@ -330,16 +330,16 @@ public class ConnectivityHandler {
|
|||
.equals(origin))
|
||||
continue;
|
||||
|
||||
T controllerBE = partAt.getControllerTE();
|
||||
T controllerBE = partAt.getControllerBE();
|
||||
partAt.setExtraData((controllerBE == null ? null : controllerBE.getExtraData()));
|
||||
partAt.removeController(true);
|
||||
|
||||
if (!toDistribute.isEmpty() && partAt != be) {
|
||||
FluidStack copy = toDistribute.copy();
|
||||
IFluidTank tank =
|
||||
(partAt instanceof IMultiTileContainer.Fluid ifluidPart ? ifluidPart.getTank(0) : null);
|
||||
(partAt instanceof IMultiBlockEntityContainer.Fluid ifluidPart ? ifluidPart.getTank(0) : null);
|
||||
// making this generic would be a rather large mess, unfortunately
|
||||
if (tank instanceof CreativeFluidTankTileEntity.CreativeSmartFluidTank creativeTank) {
|
||||
if (tank instanceof CreativeFluidTankBlockEntity.CreativeSmartFluidTank creativeTank) {
|
||||
if (creativeTank.isEmpty())
|
||||
creativeTank.setContainedFluid(toDistribute);
|
||||
} else {
|
||||
|
@ -360,10 +360,10 @@ public class ConnectivityHandler {
|
|||
}
|
||||
}
|
||||
|
||||
if (be instanceof IMultiTileContainer.Inventory iinv && iinv.hasInventory())
|
||||
if (be instanceof IMultiBlockEntityContainer.Inventory inv && inv.hasInventory())
|
||||
be.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
|
||||
.invalidate();
|
||||
if (be instanceof IMultiTileContainer.Fluid ifluid && ifluid.hasTank())
|
||||
if (be instanceof IMultiBlockEntityContainer.Fluid fluid && fluid.hasTank())
|
||||
be.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY)
|
||||
.invalidate();
|
||||
|
||||
|
@ -371,12 +371,12 @@ public class ConnectivityHandler {
|
|||
formMulti(be.getType(), level, cache == null ? new SearchCache<>() : cache, frontier);
|
||||
}
|
||||
|
||||
private static <T extends BlockEntity & IMultiTileContainer> PriorityQueue<Pair<Integer, T>> makeCreationQueue() {
|
||||
private static <T extends BlockEntity & IMultiBlockEntityContainer> PriorityQueue<Pair<Integer, T>> makeCreationQueue() {
|
||||
return new PriorityQueue<>((one, two) -> two.getKey() - one.getKey());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static <T extends BlockEntity & IMultiTileContainer> T partAt(BlockEntityType<?> type, BlockGetter level,
|
||||
public static <T extends BlockEntity & IMultiBlockEntityContainer> T partAt(BlockEntityType<?> type, BlockGetter level,
|
||||
BlockPos pos) {
|
||||
BlockEntity be = level.getBlockEntity(pos);
|
||||
if (be != null && be.getType() == type && !be.isRemoved())
|
||||
|
@ -384,7 +384,7 @@ public class ConnectivityHandler {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static <T extends BlockEntity & IMultiTileContainer> boolean isConnected(BlockGetter level, BlockPos pos,
|
||||
public static <T extends BlockEntity & IMultiBlockEntityContainer> boolean isConnected(BlockGetter level, BlockPos pos,
|
||||
BlockPos other) {
|
||||
T one = checked(level.getBlockEntity(pos));
|
||||
T two = checked(level.getBlockEntity(other));
|
||||
|
@ -396,13 +396,13 @@ public class ConnectivityHandler {
|
|||
|
||||
@Nullable
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T extends BlockEntity & IMultiTileContainer> T checked(BlockEntity be) {
|
||||
if (be instanceof IMultiTileContainer)
|
||||
private static <T extends BlockEntity & IMultiBlockEntityContainer> T checked(BlockEntity be) {
|
||||
if (be instanceof IMultiBlockEntityContainer)
|
||||
return (T) be;
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class SearchCache<T extends BlockEntity & IMultiTileContainer> {
|
||||
private static class SearchCache<T extends BlockEntity & IMultiBlockEntityContainer> {
|
||||
Map<BlockPos, Optional<T>> controllerMap;
|
||||
|
||||
public SearchCache() {
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package com.simibubi.create.api.event;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Map;
|
||||
|
||||
import com.simibubi.create.foundation.blockEntity.BlockEntityBehaviour;
|
||||
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
||||
import com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.eventbus.api.GenericEvent;
|
||||
|
||||
/**
|
||||
* Event that is fired just before a SmartBlockEntity is being deserialized<br>
|
||||
* Also if a new one is placed<br>
|
||||
* Use it to attach a new {@link BlockEntityBehaviour} or replace existing ones
|
||||
* (with caution)<br>
|
||||
* <br>
|
||||
* Actual setup of the behaviours internal workings and data should be done in
|
||||
* BlockEntityBehaviour#read() and BlockEntityBehaviour#initialize()
|
||||
* respectively.<br>
|
||||
* <br>
|
||||
* Because of the earliness of this event, the added behaviours will have access
|
||||
* to the initial NBT read (unless the BE was placed, not loaded), thereby
|
||||
* allowing block entities to store and retrieve data for injected behaviours.
|
||||
*/
|
||||
public class BlockEntityBehaviourEvent<T extends SmartBlockEntity> extends GenericEvent<T> {
|
||||
|
||||
private T smartBlockEntity;
|
||||
private Map<BehaviourType<?>, BlockEntityBehaviour> behaviours;
|
||||
|
||||
public BlockEntityBehaviourEvent(T blockEntity, Map<BehaviourType<?>, BlockEntityBehaviour> behaviours) {
|
||||
smartBlockEntity = blockEntity;
|
||||
this.behaviours = behaviours;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getGenericType() {
|
||||
return smartBlockEntity.getClass();
|
||||
}
|
||||
|
||||
public void attach(BlockEntityBehaviour behaviour) {
|
||||
behaviours.put(behaviour.getType(), behaviour);
|
||||
}
|
||||
|
||||
public BlockEntityBehaviour remove(BehaviourType<?> type) {
|
||||
return behaviours.remove(type);
|
||||
}
|
||||
|
||||
public T getBlockEntity() {
|
||||
return smartBlockEntity;
|
||||
}
|
||||
|
||||
public BlockState getBlockState() {
|
||||
return smartBlockEntity.getBlockState();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
package com.simibubi.create.api.event;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.Map;
|
||||
|
||||
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||
import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraftforge.eventbus.api.GenericEvent;
|
||||
|
||||
/**
|
||||
* Event that is fired just before a SmartTileEntity is being deserialized<br>
|
||||
* Also if a new one is placed<br>
|
||||
* Use it to attach a new {@link TileEntityBehaviour} or replace existing ones
|
||||
* (with caution)<br>
|
||||
* <br>
|
||||
* Actual setup of the behaviours internal workings and data should be done in
|
||||
* TileEntityBehaviour#read() and TileEntityBehaviour#initialize()
|
||||
* respectively.<br>
|
||||
* <br>
|
||||
* Because of the earliness of this event, the added behaviours will have access
|
||||
* to the initial NBT read (unless the TE was placed, not loaded), thereby
|
||||
* allowing tiles to store and retrieve data for injected behaviours.
|
||||
*/
|
||||
public class TileEntityBehaviourEvent<T extends SmartTileEntity> extends GenericEvent<T> {
|
||||
|
||||
private T smartTileEntity;
|
||||
private Map<BehaviourType<?>, TileEntityBehaviour> behaviours;
|
||||
|
||||
public TileEntityBehaviourEvent(T tileEntity, Map<BehaviourType<?>, TileEntityBehaviour> behaviours) {
|
||||
smartTileEntity = tileEntity;
|
||||
this.behaviours = behaviours;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getGenericType() {
|
||||
return smartTileEntity.getClass();
|
||||
}
|
||||
|
||||
public void attach(TileEntityBehaviour behaviour) {
|
||||
behaviours.put(behaviour.getType(), behaviour);
|
||||
}
|
||||
|
||||
public TileEntityBehaviour remove(BehaviourType<?> type) {
|
||||
return behaviours.remove(type);
|
||||
}
|
||||
|
||||
public T getTileEntity() {
|
||||
return smartTileEntity;
|
||||
}
|
||||
|
||||
public BlockState getBlockState() {
|
||||
return smartTileEntity.getBlockState();
|
||||
}
|
||||
|
||||
}
|
|
@ -13,7 +13,9 @@ import net.minecraftforge.fml.ModList;
|
|||
public enum Mods {
|
||||
DYNAMICTREES,
|
||||
TCONSTRUCT,
|
||||
CURIOS;
|
||||
CURIOS,
|
||||
STORAGEDRAWERS,
|
||||
XLPACKETS;
|
||||
|
||||
/**
|
||||
* @return a boolean of whether the mod is loaded or not based on mod id
|
||||
|
|
|
@ -1,40 +1,44 @@
|
|||
package com.simibubi.create.compat.curios;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.content.contraptions.goggles.GogglesItem;
|
||||
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.InterModComms;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||||
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import top.theillusivec4.curios.api.CuriosCapability;
|
||||
import top.theillusivec4.curios.api.SlotTypeMessage;
|
||||
import top.theillusivec4.curios.api.SlotTypePreset;
|
||||
import top.theillusivec4.curios.api.type.inventory.ICurioStacksHandler;
|
||||
|
||||
public class Curios {
|
||||
public static void init() {
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(Curios::onInterModEnqueue);
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(Curios::onClientSetup);
|
||||
public static void init(IEventBus modEventBus, IEventBus forgeEventBus) {
|
||||
modEventBus.addListener(Curios::onInterModEnqueue);
|
||||
modEventBus.addListener(Curios::onClientSetup);
|
||||
|
||||
GogglesItem.addIsWearingPredicate(player -> {
|
||||
AtomicBoolean hasGoggles = new AtomicBoolean(false);
|
||||
player.getCapability(CuriosCapability.INVENTORY).ifPresent(handler -> {
|
||||
ICurioStacksHandler stacksHandler = handler.getCurios().get("head");
|
||||
if(stacksHandler != null) hasGoggles.set(stacksHandler.getStacks().getStackInSlot(0).getItem() == AllItems.GOGGLES.get());
|
||||
});
|
||||
return hasGoggles.get();
|
||||
});
|
||||
GogglesItem.addIsWearingPredicate(player -> player.getCapability(CuriosCapability.INVENTORY)
|
||||
.map(handler -> {
|
||||
ICurioStacksHandler stacksHandler = handler.getCurios()
|
||||
.get("head");
|
||||
if (stacksHandler == null)
|
||||
return false;
|
||||
if (stacksHandler.getSlots() == 0)
|
||||
return false;
|
||||
return AllItems.GOGGLES.isIn(stacksHandler.getStacks()
|
||||
.getStackInSlot(0));
|
||||
})
|
||||
.orElse(false));
|
||||
|
||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> FMLJavaModLoadingContext.get().getModEventBus().addListener(CuriosRenderers::onLayerRegister));
|
||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT,
|
||||
() -> () -> modEventBus.addListener(CuriosRenderers::onLayerRegister));
|
||||
}
|
||||
|
||||
private static void onInterModEnqueue(final InterModEnqueueEvent event) {
|
||||
InterModComms.sendTo("curios", SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.HEAD.getMessageBuilder().build());
|
||||
InterModComms.sendTo("curios", SlotTypeMessage.REGISTER_TYPE, () -> SlotTypePreset.HEAD.getMessageBuilder()
|
||||
.build());
|
||||
}
|
||||
|
||||
private static void onClientSetup(final FMLClientSetupEvent event) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import javax.annotation.ParametersAreNonnullByDefault;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.simibubi.create.content.curiosities.tools.BlueprintAssignCompleteRecipePacket;
|
||||
import com.simibubi.create.content.curiosities.tools.BlueprintContainer;
|
||||
import com.simibubi.create.content.curiosities.tools.BlueprintMenu;
|
||||
import com.simibubi.create.foundation.networking.AllPackets;
|
||||
|
||||
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
|
||||
|
@ -17,11 +17,11 @@ import net.minecraft.world.item.crafting.CraftingRecipe;
|
|||
|
||||
@ParametersAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
public class BlueprintTransferHandler implements IRecipeTransferHandler<BlueprintContainer, CraftingRecipe> {
|
||||
public class BlueprintTransferHandler implements IRecipeTransferHandler<BlueprintMenu, CraftingRecipe> {
|
||||
|
||||
@Override
|
||||
public Class<BlueprintContainer> getContainerClass() {
|
||||
return BlueprintContainer.class;
|
||||
public Class<BlueprintMenu> getContainerClass() {
|
||||
return BlueprintMenu.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,11 +30,11 @@ public class BlueprintTransferHandler implements IRecipeTransferHandler<Blueprin
|
|||
}
|
||||
|
||||
@Override
|
||||
public @Nullable IRecipeTransferError transferRecipe(BlueprintContainer container, CraftingRecipe craftingRecipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) {
|
||||
public @Nullable IRecipeTransferError transferRecipe(BlueprintMenu menu, CraftingRecipe craftingRecipe, IRecipeSlotsView recipeSlots, Player player, boolean maxTransfer, boolean doTransfer) {
|
||||
if (!doTransfer)
|
||||
return null;
|
||||
|
||||
AllPackets.channel.sendToServer(new BlueprintAssignCompleteRecipePacket(craftingRecipe.getId()));
|
||||
AllPackets.getChannel().sendToServer(new BlueprintAssignCompleteRecipePacket(craftingRecipe.getId()));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,10 +46,10 @@ import com.simibubi.create.content.contraptions.components.deployer.DeployerAppl
|
|||
import com.simibubi.create.content.contraptions.components.deployer.ManualApplicationRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.fan.HauntingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.fan.SplashingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity;
|
||||
import com.simibubi.create.content.contraptions.components.press.MechanicalPressBlockEntity;
|
||||
import com.simibubi.create.content.contraptions.components.press.PressingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.saw.CuttingRecipe;
|
||||
import com.simibubi.create.content.contraptions.components.saw.SawTileEntity;
|
||||
import com.simibubi.create.content.contraptions.components.saw.SawBlockEntity;
|
||||
import com.simibubi.create.content.contraptions.fluids.actors.FillingRecipe;
|
||||
import com.simibubi.create.content.contraptions.fluids.potion.PotionFluid;
|
||||
import com.simibubi.create.content.contraptions.fluids.recipe.PotionMixingRecipes;
|
||||
|
@ -66,7 +66,7 @@ import com.simibubi.create.foundation.config.AllConfigs;
|
|||
import com.simibubi.create.foundation.config.CRecipes;
|
||||
import com.simibubi.create.foundation.config.ConfigBase.ConfigBool;
|
||||
import com.simibubi.create.foundation.data.recipe.LogStrippingFakeRecipes;
|
||||
import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen;
|
||||
import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
import com.simibubi.create.foundation.utility.recipe.IRecipeTypeInfo;
|
||||
|
||||
|
@ -177,7 +177,7 @@ public class CreateJEI implements IModPlugin {
|
|||
.addAllRecipesIf(r -> r instanceof CraftingRecipe && !(r instanceof IShapedRecipe<?>)
|
||||
&& r.getIngredients()
|
||||
.size() > 1
|
||||
&& !MechanicalPressTileEntity.canCompress(r) && !AllRecipeTypes.shouldIgnoreInAutomation(r),
|
||||
&& !MechanicalPressBlockEntity.canCompress(r) && !AllRecipeTypes.shouldIgnoreInAutomation(r),
|
||||
BasinRecipe::convertShapeless)
|
||||
.catalyst(AllBlocks.MECHANICAL_MIXER::get)
|
||||
.catalyst(AllBlocks.BASIN::get)
|
||||
|
@ -206,7 +206,7 @@ public class CreateJEI implements IModPlugin {
|
|||
.enableWhen(c -> c.allowShapedSquareInPress)
|
||||
.addAllRecipesIf(
|
||||
r -> (r instanceof CraftingRecipe) && !(r instanceof MechanicalCraftingRecipe)
|
||||
&& MechanicalPressTileEntity.canCompress(r) && !AllRecipeTypes.shouldIgnoreInAutomation(r),
|
||||
&& MechanicalPressBlockEntity.canCompress(r) && !AllRecipeTypes.shouldIgnoreInAutomation(r),
|
||||
BasinRecipe::convertShapeless)
|
||||
.catalyst(AllBlocks.MECHANICAL_PRESS::get)
|
||||
.catalyst(AllBlocks.BASIN::get)
|
||||
|
@ -232,7 +232,7 @@ public class CreateJEI implements IModPlugin {
|
|||
woodCutting = builder(CondensedBlockCuttingRecipe.class)
|
||||
.enableIf(c -> c.allowWoodcuttingOnSaw.get() && ModList.get()
|
||||
.isLoaded("druidcraft"))
|
||||
.addRecipes(() -> CondensedBlockCuttingRecipe.condenseRecipes(getTypedRecipesExcluding(SawTileEntity.woodcuttingRecipeType.get(), AllRecipeTypes::shouldIgnoreInAutomation)))
|
||||
.addRecipes(() -> CondensedBlockCuttingRecipe.condenseRecipes(getTypedRecipesExcluding(SawBlockEntity.woodcuttingRecipeType.get(), AllRecipeTypes::shouldIgnoreInAutomation)))
|
||||
.catalyst(AllBlocks.MECHANICAL_SAW::get)
|
||||
.doubleItemIcon(AllBlocks.MECHANICAL_SAW.get(), Items.OAK_STAIRS)
|
||||
.emptyBackground(177, 70)
|
||||
|
@ -503,7 +503,7 @@ public class CreateJEI implements IModPlugin {
|
|||
|
||||
public CreateRecipeCategory<T> build(String name, CreateRecipeCategory.Factory<T> factory) {
|
||||
Supplier<List<T>> recipesSupplier;
|
||||
if (predicate.test(AllConfigs.SERVER.recipes)) {
|
||||
if (predicate.test(AllConfigs.server().recipes)) {
|
||||
recipesSupplier = () -> {
|
||||
List<T> recipes = new ArrayList<>();
|
||||
for (Consumer<List<T>> consumer : recipeListConsumers)
|
||||
|
|
|
@ -6,9 +6,9 @@ import java.util.List;
|
|||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import com.simibubi.create.content.logistics.item.filter.AttributeFilterScreen;
|
||||
import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen;
|
||||
import com.simibubi.create.foundation.gui.container.GhostItemContainer;
|
||||
import com.simibubi.create.foundation.gui.container.GhostItemSubmitPacket;
|
||||
import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen;
|
||||
import com.simibubi.create.foundation.gui.menu.GhostItemMenu;
|
||||
import com.simibubi.create.foundation.gui.menu.GhostItemSubmitPacket;
|
||||
import com.simibubi.create.foundation.networking.AllPackets;
|
||||
|
||||
import mezz.jei.api.gui.handlers.IGhostIngredientHandler;
|
||||
|
@ -19,7 +19,7 @@ import net.minecraft.world.item.ItemStack;
|
|||
|
||||
@MethodsReturnNonnullByDefault
|
||||
@ParametersAreNonnullByDefault
|
||||
public class GhostIngredientHandler<T extends GhostItemContainer<?>>
|
||||
public class GhostIngredientHandler<T extends GhostItemMenu<?>>
|
||||
implements IGhostIngredientHandler<AbstractSimiContainerScreen<T>> {
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +52,7 @@ public class GhostIngredientHandler<T extends GhostItemContainer<?>>
|
|||
return true;
|
||||
}
|
||||
|
||||
private static class GhostTarget<I, T extends GhostItemContainer<?>> implements Target<I> {
|
||||
private static class GhostTarget<I, T extends GhostItemMenu<?>> implements Target<I> {
|
||||
|
||||
private final Rect2i area;
|
||||
private final AbstractSimiContainerScreen<T> gui;
|
||||
|
@ -82,7 +82,7 @@ public class GhostIngredientHandler<T extends GhostItemContainer<?>>
|
|||
return;
|
||||
|
||||
// sync new filter contents with server
|
||||
AllPackets.channel.sendToServer(new GhostItemSubmitPacket(stack, slotIndex));
|
||||
AllPackets.getChannel().sendToServer(new GhostItemSubmitPacket(stack, slotIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.simibubi.create.compat.jei;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen;
|
||||
import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen;
|
||||
|
||||
import mezz.jei.api.gui.handlers.IGuiContainerHandler;
|
||||
import net.minecraft.client.renderer.Rect2i;
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package com.simibubi.create.compat.jei.category;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.compat.jei.category.animations.AnimatedDeployer;
|
||||
import com.simibubi.create.content.contraptions.components.deployer.DeployerApplicationRecipe;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
|
||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
|
||||
|
@ -34,22 +37,28 @@ public class DeployingCategory extends CreateRecipeCategory<DeployerApplicationR
|
|||
.addSlot(RecipeIngredientRole.INPUT, 51, 5)
|
||||
.setBackground(getRenderedSlot(), -1, -1)
|
||||
.addIngredients(recipe.getRequiredHeldItem());
|
||||
builder
|
||||
.addSlot(RecipeIngredientRole.OUTPUT, 132, 51)
|
||||
.setBackground(getRenderedSlot(recipe.getRollableResults().get(0)), -1, -1)
|
||||
.addItemStack(recipe.getResultItem())
|
||||
.addTooltipCallback(addStochasticTooltip(recipe.getRollableResults().get(0)));
|
||||
|
||||
if (recipe.shouldKeepHeldItem()) {
|
||||
handItemSlot.addTooltipCallback((recipeSlotView, tooltip) -> tooltip.add(1, Lang.translateDirect("recipe.deploying.not_consumed").withStyle(ChatFormatting.GOLD)));
|
||||
|
||||
List<ProcessingOutput> results = recipe.getRollableResults();
|
||||
boolean single = results.size() == 1;
|
||||
for (int i = 0; i < results.size(); i++) {
|
||||
ProcessingOutput output = results.get(i);
|
||||
int xOffset = i % 2 == 0 ? 0 : 19;
|
||||
int yOffset = (i / 2) * -19;
|
||||
builder.addSlot(RecipeIngredientRole.OUTPUT, single ? 132 : 132 + xOffset, 51 + yOffset)
|
||||
.setBackground(getRenderedSlot(output), -1, -1)
|
||||
.addItemStack(output.getStack())
|
||||
.addTooltipCallback(addStochasticTooltip(output));
|
||||
}
|
||||
|
||||
if (recipe.shouldKeepHeldItem())
|
||||
handItemSlot.addTooltipCallback((recipeSlotView, tooltip) -> tooltip.add(1, Lang.translateDirect("recipe.deploying.not_consumed").withStyle(ChatFormatting.GOLD)));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(DeployerApplicationRecipe recipe, IRecipeSlotsView recipeSlotsView, PoseStack matrixStack, double mouseX, double mouseY) {
|
||||
AllGuiTextures.JEI_SHADOW.render(matrixStack, 62, 57);
|
||||
AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 126, 29);
|
||||
AllGuiTextures.JEI_DOWN_ARROW.render(matrixStack, 126, 29 + (recipe.getRollableResults().size() > 2 ? -19 : 0));
|
||||
deployer.draw(matrixStack, getBackground().getWidth() / 2 - 13, 22);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.simibubi.create.compat.jei.category;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
@ -8,6 +9,7 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
|||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics;
|
||||
import com.simibubi.create.content.contraptions.processing.ItemApplicationRecipe;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
|
||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||
import com.simibubi.create.foundation.gui.element.GuiGameElement;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
|
@ -46,10 +48,17 @@ public class ItemApplicationCategory extends CreateRecipeCategory<ItemApplicatio
|
|||
: (view, tooltip) -> {}
|
||||
);
|
||||
|
||||
builder.addSlot(RecipeIngredientRole.OUTPUT, 132, 38)
|
||||
.setBackground(getRenderedSlot(recipe.getRollableResults().get(0)), -1, -1)
|
||||
.addItemStack(recipe.getResultItem())
|
||||
.addTooltipCallback(addStochasticTooltip(recipe.getRollableResults().get(0)));
|
||||
List<ProcessingOutput> results = recipe.getRollableResults();
|
||||
boolean single = results.size() == 1;
|
||||
for (int i = 0; i < results.size(); i++) {
|
||||
ProcessingOutput output = results.get(i);
|
||||
int xOffset = i % 2 == 0 ? 0 : 19;
|
||||
int yOffset = (i / 2) * -19;
|
||||
builder.addSlot(RecipeIngredientRole.OUTPUT, single ? 132 : 132 + xOffset, 38 + yOffset)
|
||||
.setBackground(getRenderedSlot(output), -1, -1)
|
||||
.addItemStack(output.getStack())
|
||||
.addTooltipCallback(addStochasticTooltip(output));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -7,8 +7,8 @@ import javax.annotation.ParametersAreNonnullByDefault;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.compat.jei.category.animations.AnimatedKinetics;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingOutput;
|
||||
import com.simibubi.create.content.contraptions.processing.ProcessingRecipe;
|
||||
|
@ -57,7 +57,7 @@ public abstract class ProcessingViaFanCategory<T extends Recipe<?>> extends Crea
|
|||
matrixStack.mulPose(Vector3f.XP.rotationDegrees(-12.5f));
|
||||
matrixStack.mulPose(Vector3f.YP.rotationDegrees(22.5f));
|
||||
|
||||
AnimatedKinetics.defaultBlockElement(AllBlockPartials.ENCASED_FAN_INNER)
|
||||
AnimatedKinetics.defaultBlockElement(AllPartialModels.ENCASED_FAN_INNER)
|
||||
.rotateBlock(180, 0, AnimatedKinetics.getCurrentAngle() * 16)
|
||||
.scale(SCALE)
|
||||
.render(matrixStack);
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.jozufozu.flywheel.core.PartialModel;
|
|||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.VertexConsumer;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.AllSpriteShifts;
|
||||
import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel;
|
||||
import com.simibubi.create.foundation.block.render.SpriteShiftEntry;
|
||||
|
@ -42,9 +42,9 @@ public class AnimatedBlazeBurner extends AnimatedKinetics {
|
|||
.render(matrixStack);
|
||||
|
||||
PartialModel blaze =
|
||||
heatLevel == HeatLevel.SEETHING ? AllBlockPartials.BLAZE_SUPER : AllBlockPartials.BLAZE_ACTIVE;
|
||||
PartialModel rods2 = heatLevel == HeatLevel.SEETHING ? AllBlockPartials.BLAZE_BURNER_SUPER_RODS_2
|
||||
: AllBlockPartials.BLAZE_BURNER_RODS_2;
|
||||
heatLevel == HeatLevel.SEETHING ? AllPartialModels.BLAZE_SUPER : AllPartialModels.BLAZE_ACTIVE;
|
||||
PartialModel rods2 = heatLevel == HeatLevel.SEETHING ? AllPartialModels.BLAZE_BURNER_SUPER_RODS_2
|
||||
: AllPartialModels.BLAZE_BURNER_RODS_2;
|
||||
|
||||
blockElement(blaze).atLocal(1, 1.8, 1)
|
||||
.rotate(0, 180, 0)
|
||||
|
@ -86,7 +86,7 @@ public class AnimatedBlazeBurner extends AnimatedKinetics {
|
|||
MultiBufferSource.BufferSource buffer = mc.renderBuffers()
|
||||
.bufferSource();
|
||||
VertexConsumer vb = buffer.getBuffer(RenderType.cutoutMipped());
|
||||
CachedBufferer.partial(AllBlockPartials.BLAZE_BURNER_FLAME, Blocks.AIR.defaultBlockState())
|
||||
CachedBufferer.partial(AllPartialModels.BLAZE_BURNER_FLAME, Blocks.AIR.defaultBlockState())
|
||||
.shiftUVScrolling(spriteShift, (float) uScroll, (float) vScroll)
|
||||
.light(LightTexture.FULL_BRIGHT)
|
||||
.renderInto(matrixStack, vb);
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.content.contraptions.components.deployer.DeployerBlock;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
|
||||
|
@ -37,11 +37,11 @@ public class AnimatedDeployer extends AnimatedKinetics {
|
|||
matrixStack.pushPose();
|
||||
|
||||
matrixStack.translate(0, offset * 17, 0);
|
||||
blockElement(AllBlockPartials.DEPLOYER_POLE)
|
||||
blockElement(AllPartialModels.DEPLOYER_POLE)
|
||||
.rotateBlock(90, 0, 0)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
blockElement(AllBlockPartials.DEPLOYER_HAND_HOLDING)
|
||||
blockElement(AllPartialModels.DEPLOYER_HAND_HOLDING)
|
||||
.rotateBlock(90, 0, 0)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.simibubi.create.compat.jei.category.animations;
|
||||
|
||||
import com.jozufozu.flywheel.core.PartialModel;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.foundation.gui.CustomLightingSettings;
|
||||
import com.simibubi.create.foundation.gui.ILightingSettings;
|
||||
import com.simibubi.create.foundation.gui.element.GuiGameElement;
|
||||
|
@ -49,7 +49,7 @@ public abstract class AnimatedKinetics implements IDrawable {
|
|||
}
|
||||
|
||||
protected PartialModel cogwheel() {
|
||||
return AllBlockPartials.SHAFTLESS_COGWHEEL;
|
||||
return AllPartialModels.SHAFTLESS_COGWHEEL;
|
||||
}
|
||||
|
||||
protected GuiGameElement.GuiRenderBuilder blockElement(BlockState state) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.simibubi.create.compat.jei.category.animations;
|
||||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||
|
||||
public class AnimatedMillstone extends AnimatedKinetics {
|
||||
|
@ -15,7 +15,7 @@ public class AnimatedMillstone extends AnimatedKinetics {
|
|||
matrixStack.translate(-2, 18, 0);
|
||||
int scale = 22;
|
||||
|
||||
blockElement(AllBlockPartials.MILLSTONE_COG)
|
||||
blockElement(AllPartialModels.MILLSTONE_COG)
|
||||
.rotateBlock(22.5, getCurrentAngle() * 2, 0)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
|
||||
import net.minecraft.util.Mth;
|
||||
|
@ -31,12 +31,12 @@ public class AnimatedMixer extends AnimatedKinetics {
|
|||
|
||||
float animation = ((Mth.sin(AnimationTickHolder.getRenderTime() / 32f) + 1) / 5) + .5f;
|
||||
|
||||
blockElement(AllBlockPartials.MECHANICAL_MIXER_POLE)
|
||||
blockElement(AllPartialModels.MECHANICAL_MIXER_POLE)
|
||||
.atLocal(0, animation, 0)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
|
||||
blockElement(AllBlockPartials.MECHANICAL_MIXER_HEAD)
|
||||
blockElement(AllPartialModels.MECHANICAL_MIXER_HEAD)
|
||||
.rotateBlock(0, getCurrentAngle() * 4, 0)
|
||||
.atLocal(0, animation, 0)
|
||||
.scale(scale)
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
|
||||
import net.minecraft.core.Direction.Axis;
|
||||
|
@ -33,7 +33,7 @@ public class AnimatedPress extends AnimatedKinetics {
|
|||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
|
||||
blockElement(AllBlockPartials.MECHANICAL_PRESS_HEAD)
|
||||
blockElement(AllPartialModels.MECHANICAL_PRESS_HEAD)
|
||||
.atLocal(0, -getAnimatedHeadOffset(), 0)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
|
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.compat.jei.category.animations;
|
|||
|
||||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.content.contraptions.components.saw.SawBlock;
|
||||
|
||||
import net.minecraft.core.Direction;
|
||||
|
@ -32,7 +32,7 @@ public class AnimatedSaw extends AnimatedKinetics {
|
|||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
|
||||
blockElement(AllBlockPartials.SAW_BLADE_VERTICAL_ACTIVE)
|
||||
blockElement(AllPartialModels.SAW_BLADE_VERTICAL_ACTIVE)
|
||||
.rotateBlock(0, -90, -90)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
|
|
|
@ -6,8 +6,8 @@ import com.mojang.blaze3d.platform.Lighting;
|
|||
import com.mojang.blaze3d.vertex.PoseStack;
|
||||
import com.mojang.blaze3d.vertex.Tesselator;
|
||||
import com.mojang.math.Vector3f;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.foundation.fluid.FluidRenderer;
|
||||
import com.simibubi.create.foundation.gui.UIRenderHelper;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
|
@ -45,15 +45,15 @@ public class AnimatedSpout extends AnimatedKinetics {
|
|||
|
||||
matrixStack.pushPose();
|
||||
|
||||
blockElement(AllBlockPartials.SPOUT_TOP)
|
||||
blockElement(AllPartialModels.SPOUT_TOP)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
matrixStack.translate(0, -3 * squeeze / 32f, 0);
|
||||
blockElement(AllBlockPartials.SPOUT_MIDDLE)
|
||||
blockElement(AllPartialModels.SPOUT_MIDDLE)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
matrixStack.translate(0, -3 * squeeze / 32f, 0);
|
||||
blockElement(AllBlockPartials.SPOUT_BOTTOM)
|
||||
blockElement(AllPartialModels.SPOUT_BOTTOM)
|
||||
.scale(scale)
|
||||
.render(matrixStack);
|
||||
matrixStack.translate(0, -3 * squeeze / 32f, 0);
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.simibubi.create.compat.storageDrawers;
|
||||
|
||||
import com.simibubi.create.compat.Mods;
|
||||
import com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour;
|
||||
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
public class StorageDrawers {
|
||||
|
||||
public static boolean isDrawer(BlockEntity be) {
|
||||
return be != null && Mods.STORAGEDRAWERS.asId()
|
||||
.equals(be.getType()
|
||||
.getRegistryName()
|
||||
.getNamespace());
|
||||
}
|
||||
|
||||
public static float getTrueFillLevel(IItemHandler inv, FilteringBehaviour filtering) {
|
||||
float occupied = 0;
|
||||
float totalSpace = 0;
|
||||
|
||||
for (int slot = 1; slot < inv.getSlots(); slot++) {
|
||||
ItemStack stackInSlot = inv.getStackInSlot(slot);
|
||||
int space = inv.getSlotLimit(slot);
|
||||
int count = stackInSlot.getCount();
|
||||
if (space == 0)
|
||||
continue;
|
||||
|
||||
totalSpace += 1;
|
||||
if (filtering.test(stackInSlot))
|
||||
occupied += count * (1f / space);
|
||||
}
|
||||
|
||||
if (totalSpace == 0)
|
||||
return 0;
|
||||
|
||||
return occupied / totalSpace;
|
||||
}
|
||||
|
||||
}
|
|
@ -2,7 +2,7 @@ package com.simibubi.create.compat.tconstruct;
|
|||
|
||||
import com.simibubi.create.api.behaviour.BlockSpoutingBehaviour;
|
||||
import com.simibubi.create.compat.Mods;
|
||||
import com.simibubi.create.content.contraptions.fluids.actors.SpoutTileEntity;
|
||||
import com.simibubi.create.content.contraptions.fluids.actors.SpoutBlockEntity;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.fluid.FluidHelper;
|
||||
import com.simibubi.create.foundation.utility.RegisteredObjects;
|
||||
|
@ -25,23 +25,23 @@ public class SpoutCasting extends BlockSpoutingBehaviour {
|
|||
ResourceLocation BASIN = new ResourceLocation("tconstruct", "basin");
|
||||
|
||||
@Override
|
||||
public int fillBlock(Level level, BlockPos pos, SpoutTileEntity spout, FluidStack availableFluid,
|
||||
public int fillBlock(Level level, BlockPos pos, SpoutBlockEntity spout, FluidStack availableFluid,
|
||||
boolean simulate) {
|
||||
if (!enabled())
|
||||
return 0;
|
||||
|
||||
BlockEntity te = level.getBlockEntity(pos);
|
||||
if (te == null)
|
||||
BlockEntity blockEntity = level.getBlockEntity(pos);
|
||||
if (blockEntity == null)
|
||||
return 0;
|
||||
|
||||
IFluidHandler handler = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, Direction.UP)
|
||||
IFluidHandler handler = blockEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, Direction.UP)
|
||||
.orElse(null);
|
||||
if (handler == null)
|
||||
return 0;
|
||||
if (handler.getTanks() != 1)
|
||||
return 0;
|
||||
|
||||
ResourceLocation registryName = RegisteredObjects.getKeyOrThrow(te.getType());
|
||||
ResourceLocation registryName = RegisteredObjects.getKeyOrThrow(blockEntity.getType());
|
||||
if (!registryName.equals(TABLE) && !registryName.equals(BASIN))
|
||||
return 0;
|
||||
if (!handler.isFluidValid(0, availableFluid))
|
||||
|
@ -66,7 +66,7 @@ public class SpoutCasting extends BlockSpoutingBehaviour {
|
|||
TICON_PRESENT = Mods.TCONSTRUCT.isLoaded();
|
||||
if (!TICON_PRESENT)
|
||||
return false;
|
||||
return AllConfigs.SERVER.recipes.allowCastingBySpout.get();
|
||||
return AllConfigs.server().recipes.allowCastingBySpout.get();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
package com.simibubi.create.content;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
||||
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
|
||||
public enum AllSections {
|
||||
|
||||
/** Create's kinetic mechanisms */
|
||||
KINETICS(Palette.Red),
|
||||
|
||||
/** Item transport and other Utility */
|
||||
LOGISTICS(Palette.Yellow),
|
||||
|
||||
/** Tools for strucuture movement and replication */
|
||||
SCHEMATICS(Palette.Blue),
|
||||
|
||||
/** Decorative blocks */
|
||||
PALETTES(Palette.Green),
|
||||
|
||||
/** Helpful gadgets and other shenanigans */
|
||||
CURIOSITIES(Palette.Purple),
|
||||
|
||||
/** Base materials, ingredients and tools */
|
||||
MATERIALS(Palette.Green),
|
||||
|
||||
/** Fallback section */
|
||||
UNASSIGNED(Palette.Gray)
|
||||
|
||||
;
|
||||
|
||||
private Palette tooltipPalette;
|
||||
|
||||
private AllSections(Palette tooltipPalette) {
|
||||
this.tooltipPalette = tooltipPalette;
|
||||
}
|
||||
|
||||
public Palette getTooltipPalette() {
|
||||
return tooltipPalette;
|
||||
}
|
||||
|
||||
public static AllSections of(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
if (item instanceof BlockItem)
|
||||
return ofBlock(((BlockItem) item).getBlock());
|
||||
return ofItem(item);
|
||||
}
|
||||
|
||||
static AllSections ofItem(Item item) {
|
||||
return Create.registrate()
|
||||
.getSection(item);
|
||||
}
|
||||
|
||||
static AllSections ofBlock(Block block) {
|
||||
return Create.registrate()
|
||||
.getSection(block);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.simibubi.create.content;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.foundation.item.CreateItemGroupBase;
|
||||
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
public class CreateItemGroup extends CreateItemGroupBase {
|
||||
|
||||
public CreateItemGroup() {
|
||||
super("base");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected EnumSet<AllSections> getSections() {
|
||||
return EnumSet.complementOf(EnumSet.of(AllSections.PALETTES));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack makeIcon() {
|
||||
return AllBlocks.COGWHEEL.asStack();
|
||||
}
|
||||
|
||||
}
|
|
@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions;
|
|||
|
||||
import com.simibubi.create.CreateClient;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.utility.Color;
|
||||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
|
@ -26,34 +26,34 @@ public class KineticDebugger {
|
|||
|
||||
public static void tick() {
|
||||
if (!isActive()) {
|
||||
if (KineticTileEntityRenderer.rainbowMode) {
|
||||
KineticTileEntityRenderer.rainbowMode = false;
|
||||
if (KineticBlockEntityRenderer.rainbowMode) {
|
||||
KineticBlockEntityRenderer.rainbowMode = false;
|
||||
CreateClient.BUFFER_CACHE.invalidate();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
KineticTileEntity te = getSelectedTE();
|
||||
if (te == null)
|
||||
KineticBlockEntity be = getSelectedBE();
|
||||
if (be == null)
|
||||
return;
|
||||
|
||||
Level world = Minecraft.getInstance().level;
|
||||
BlockPos toOutline = te.hasSource() ? te.source : te.getBlockPos();
|
||||
BlockState state = te.getBlockState();
|
||||
BlockPos toOutline = be.hasSource() ? be.source : be.getBlockPos();
|
||||
BlockState state = be.getBlockState();
|
||||
VoxelShape shape = world.getBlockState(toOutline)
|
||||
.getBlockSupportShape(world, toOutline);
|
||||
|
||||
if (te.getTheoreticalSpeed() != 0 && !shape.isEmpty())
|
||||
if (be.getTheoreticalSpeed() != 0 && !shape.isEmpty())
|
||||
CreateClient.OUTLINER.chaseAABB("kineticSource", shape.bounds()
|
||||
.move(toOutline))
|
||||
.lineWidth(1 / 16f)
|
||||
.colored(te.hasSource() ? Color.generateFromLong(te.network).getRGB() : 0xffcc00);
|
||||
.colored(be.hasSource() ? Color.generateFromLong(be.network).getRGB() : 0xffcc00);
|
||||
|
||||
if (state.getBlock() instanceof IRotate) {
|
||||
Axis axis = ((IRotate) state.getBlock()).getRotationAxis(state);
|
||||
Vec3 vec = Vec3.atLowerCornerOf(Direction.get(AxisDirection.POSITIVE, axis)
|
||||
.getNormal());
|
||||
Vec3 center = VecHelper.getCenterOf(te.getBlockPos());
|
||||
Vec3 center = VecHelper.getCenterOf(be.getBlockPos());
|
||||
CreateClient.OUTLINER.showLine("rotationAxis", center.add(vec), center.subtract(vec))
|
||||
.lineWidth(1 / 16f);
|
||||
}
|
||||
|
@ -61,10 +61,14 @@ public class KineticDebugger {
|
|||
}
|
||||
|
||||
public static boolean isActive() {
|
||||
return Minecraft.getInstance().options.renderDebug && AllConfigs.CLIENT.rainbowDebug.get();
|
||||
return isF3DebugModeActive() && AllConfigs.client().rainbowDebug.get();
|
||||
}
|
||||
|
||||
public static KineticTileEntity getSelectedTE() {
|
||||
public static boolean isF3DebugModeActive() {
|
||||
return Minecraft.getInstance().options.renderDebug;
|
||||
}
|
||||
|
||||
public static KineticBlockEntity getSelectedBE() {
|
||||
HitResult obj = Minecraft.getInstance().hitResult;
|
||||
ClientLevel world = Minecraft.getInstance().level;
|
||||
if (obj == null)
|
||||
|
@ -75,11 +79,11 @@ public class KineticDebugger {
|
|||
return null;
|
||||
|
||||
BlockHitResult ray = (BlockHitResult) obj;
|
||||
BlockEntity te = world.getBlockEntity(ray.getBlockPos());
|
||||
if (!(te instanceof KineticTileEntity))
|
||||
BlockEntity be = world.getBlockEntity(ray.getBlockPos());
|
||||
if (!(be instanceof KineticBlockEntity))
|
||||
return null;
|
||||
|
||||
return (KineticTileEntity) te;
|
||||
return (KineticBlockEntity) be;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,14 +4,14 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
|
||||
|
||||
public class KineticNetwork {
|
||||
|
||||
public Long id;
|
||||
public boolean initialized;
|
||||
public Map<KineticTileEntity, Float> sources;
|
||||
public Map<KineticTileEntity, Float> members;
|
||||
public Map<KineticBlockEntity, Float> sources;
|
||||
public Map<KineticBlockEntity, Float> members;
|
||||
|
||||
private float currentCapacity;
|
||||
private float currentStress;
|
||||
|
@ -33,18 +33,18 @@ public class KineticNetwork {
|
|||
updateCapacity();
|
||||
}
|
||||
|
||||
public void addSilently(KineticTileEntity te, float lastCapacity, float lastStress) {
|
||||
if (members.containsKey(te))
|
||||
public void addSilently(KineticBlockEntity be, float lastCapacity, float lastStress) {
|
||||
if (members.containsKey(be))
|
||||
return;
|
||||
if (te.isSource()) {
|
||||
unloadedCapacity -= lastCapacity * getStressMultiplierForSpeed(te.getGeneratedSpeed());
|
||||
float addedStressCapacity = te.calculateAddedStressCapacity();
|
||||
sources.put(te, addedStressCapacity);
|
||||
if (be.isSource()) {
|
||||
unloadedCapacity -= lastCapacity * getStressMultiplierForSpeed(be.getGeneratedSpeed());
|
||||
float addedStressCapacity = be.calculateAddedStressCapacity();
|
||||
sources.put(be, addedStressCapacity);
|
||||
}
|
||||
|
||||
unloadedStress -= lastStress * getStressMultiplierForSpeed(te.getTheoreticalSpeed());
|
||||
float stressApplied = te.calculateStressApplied();
|
||||
members.put(te, stressApplied);
|
||||
unloadedStress -= lastStress * getStressMultiplierForSpeed(be.getTheoreticalSpeed());
|
||||
float stressApplied = be.calculateStressApplied();
|
||||
members.put(be, stressApplied);
|
||||
|
||||
unloadedMembers--;
|
||||
if (unloadedMembers < 0)
|
||||
|
@ -55,36 +55,36 @@ public class KineticNetwork {
|
|||
unloadedStress = 0;
|
||||
}
|
||||
|
||||
public void add(KineticTileEntity te) {
|
||||
if (members.containsKey(te))
|
||||
public void add(KineticBlockEntity be) {
|
||||
if (members.containsKey(be))
|
||||
return;
|
||||
if (te.isSource())
|
||||
sources.put(te, te.calculateAddedStressCapacity());
|
||||
members.put(te, te.calculateStressApplied());
|
||||
updateFromNetwork(te);
|
||||
te.networkDirty = true;
|
||||
if (be.isSource())
|
||||
sources.put(be, be.calculateAddedStressCapacity());
|
||||
members.put(be, be.calculateStressApplied());
|
||||
updateFromNetwork(be);
|
||||
be.networkDirty = true;
|
||||
}
|
||||
|
||||
public void updateCapacityFor(KineticTileEntity te, float capacity) {
|
||||
sources.put(te, capacity);
|
||||
public void updateCapacityFor(KineticBlockEntity be, float capacity) {
|
||||
sources.put(be, capacity);
|
||||
updateCapacity();
|
||||
}
|
||||
|
||||
public void updateStressFor(KineticTileEntity te, float stress) {
|
||||
members.put(te, stress);
|
||||
public void updateStressFor(KineticBlockEntity be, float stress) {
|
||||
members.put(be, stress);
|
||||
updateStress();
|
||||
}
|
||||
|
||||
public void remove(KineticTileEntity te) {
|
||||
if (!members.containsKey(te))
|
||||
public void remove(KineticBlockEntity be) {
|
||||
if (!members.containsKey(be))
|
||||
return;
|
||||
if (te.isSource())
|
||||
sources.remove(te);
|
||||
members.remove(te);
|
||||
te.updateFromNetwork(0, 0, 0);
|
||||
if (be.isSource())
|
||||
sources.remove(be);
|
||||
members.remove(be);
|
||||
be.updateFromNetwork(0, 0, 0);
|
||||
|
||||
if (members.isEmpty()) {
|
||||
TorquePropagator.networks.get(te.getLevel())
|
||||
TorquePropagator.networks.get(be.getLevel())
|
||||
.remove(this.id);
|
||||
return;
|
||||
}
|
||||
|
@ -96,12 +96,12 @@ public class KineticNetwork {
|
|||
}
|
||||
|
||||
public void sync() {
|
||||
for (KineticTileEntity te : members.keySet())
|
||||
updateFromNetwork(te);
|
||||
for (KineticBlockEntity be : members.keySet())
|
||||
updateFromNetwork(be);
|
||||
}
|
||||
|
||||
private void updateFromNetwork(KineticTileEntity te) {
|
||||
te.updateFromNetwork(currentCapacity, currentStress, getSize());
|
||||
private void updateFromNetwork(KineticBlockEntity be) {
|
||||
be.updateFromNetwork(currentCapacity, currentStress, getSize());
|
||||
}
|
||||
|
||||
public void updateCapacity() {
|
||||
|
@ -132,15 +132,15 @@ public class KineticNetwork {
|
|||
|
||||
public float calculateCapacity() {
|
||||
float presentCapacity = 0;
|
||||
for (Iterator<KineticTileEntity> iterator = sources.keySet()
|
||||
for (Iterator<KineticBlockEntity> iterator = sources.keySet()
|
||||
.iterator(); iterator.hasNext();) {
|
||||
KineticTileEntity te = iterator.next();
|
||||
if (te.getLevel()
|
||||
.getBlockEntity(te.getBlockPos()) != te) {
|
||||
KineticBlockEntity be = iterator.next();
|
||||
if (be.getLevel()
|
||||
.getBlockEntity(be.getBlockPos()) != be) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
presentCapacity += getActualCapacityOf(te);
|
||||
presentCapacity += getActualCapacityOf(be);
|
||||
}
|
||||
float newMaxStress = presentCapacity + unloadedCapacity;
|
||||
return newMaxStress;
|
||||
|
@ -148,26 +148,26 @@ public class KineticNetwork {
|
|||
|
||||
public float calculateStress() {
|
||||
float presentStress = 0;
|
||||
for (Iterator<KineticTileEntity> iterator = members.keySet()
|
||||
for (Iterator<KineticBlockEntity> iterator = members.keySet()
|
||||
.iterator(); iterator.hasNext();) {
|
||||
KineticTileEntity te = iterator.next();
|
||||
if (te.getLevel()
|
||||
.getBlockEntity(te.getBlockPos()) != te) {
|
||||
KineticBlockEntity be = iterator.next();
|
||||
if (be.getLevel()
|
||||
.getBlockEntity(be.getBlockPos()) != be) {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
presentStress += getActualStressOf(te);
|
||||
presentStress += getActualStressOf(be);
|
||||
}
|
||||
float newStress = presentStress + unloadedStress;
|
||||
return newStress;
|
||||
}
|
||||
|
||||
public float getActualCapacityOf(KineticTileEntity te) {
|
||||
return sources.get(te) * getStressMultiplierForSpeed(te.getGeneratedSpeed());
|
||||
public float getActualCapacityOf(KineticBlockEntity be) {
|
||||
return sources.get(be) * getStressMultiplierForSpeed(be.getGeneratedSpeed());
|
||||
}
|
||||
|
||||
public float getActualStressOf(KineticTileEntity te) {
|
||||
return members.get(te) * getStressMultiplierForSpeed(te.getTheoreticalSpeed());
|
||||
public float getActualStressOf(KineticBlockEntity be) {
|
||||
return members.get(be) * getStressMultiplierForSpeed(be.getTheoreticalSpeed());
|
||||
}
|
||||
|
||||
private static float getStressMultiplierForSpeed(float speed) {
|
||||
|
|
|
@ -7,15 +7,15 @@ import java.util.List;
|
|||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.content.contraptions.base.IRotate;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerTileEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerBlockEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
|
||||
import com.simibubi.create.content.contraptions.relays.encased.DirectionalShaftHalvesTileEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.encased.DirectionalShaftHalvesBlockEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.encased.EncasedBeltBlock;
|
||||
import com.simibubi.create.content.contraptions.relays.encased.SplitShaftTileEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.gearbox.GearboxTileEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.encased.SplitShaftBlockEntity;
|
||||
import com.simibubi.create.content.contraptions.relays.gearbox.GearboxBlockEntity;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class RotationPropagator {
|
|||
* @param to
|
||||
* @return
|
||||
*/
|
||||
private static float getRotationSpeedModifier(KineticTileEntity from, KineticTileEntity to) {
|
||||
private static float getRotationSpeedModifier(KineticBlockEntity from, KineticBlockEntity to) {
|
||||
final BlockState stateFrom = from.getBlockState();
|
||||
final BlockState stateTo = to.getBlockState();
|
||||
|
||||
|
@ -121,17 +121,17 @@ public class RotationPropagator {
|
|||
return 0;
|
||||
}
|
||||
|
||||
private static float getConveyedSpeed(KineticTileEntity from, KineticTileEntity to) {
|
||||
private static float getConveyedSpeed(KineticBlockEntity from, KineticBlockEntity to) {
|
||||
final BlockState stateFrom = from.getBlockState();
|
||||
final BlockState stateTo = to.getBlockState();
|
||||
|
||||
// Rotation Speed Controller <-> Large Gear
|
||||
if (isLargeCogToSpeedController(stateFrom, stateTo, to.getBlockPos()
|
||||
.subtract(from.getBlockPos())))
|
||||
return SpeedControllerTileEntity.getConveyedSpeed(from, to, true);
|
||||
return SpeedControllerBlockEntity.getConveyedSpeed(from, to, true);
|
||||
if (isLargeCogToSpeedController(stateTo, stateFrom, from.getBlockPos()
|
||||
.subtract(to.getBlockPos())))
|
||||
return SpeedControllerTileEntity.getConveyedSpeed(to, from, false);
|
||||
return SpeedControllerBlockEntity.getConveyedSpeed(to, from, false);
|
||||
|
||||
float rotationSpeedModifier = getRotationSpeedModifier(from, to);
|
||||
return from.getTheoreticalSpeed() * rotationSpeedModifier;
|
||||
|
@ -156,17 +156,17 @@ public class RotationPropagator {
|
|||
return true;
|
||||
}
|
||||
|
||||
private static float getAxisModifier(KineticTileEntity te, Direction direction) {
|
||||
if (!(te.hasSource()||te.isSource()) || !(te instanceof DirectionalShaftHalvesTileEntity))
|
||||
private static float getAxisModifier(KineticBlockEntity be, Direction direction) {
|
||||
if (!(be.hasSource()||be.isSource()) || !(be instanceof DirectionalShaftHalvesBlockEntity))
|
||||
return 1;
|
||||
Direction source = ((DirectionalShaftHalvesTileEntity) te).getSourceFacing();
|
||||
Direction source = ((DirectionalShaftHalvesBlockEntity) be).getSourceFacing();
|
||||
|
||||
if (te instanceof GearboxTileEntity)
|
||||
if (be instanceof GearboxBlockEntity)
|
||||
return direction.getAxis() == source.getAxis() ? direction == source ? 1 : -1
|
||||
: direction.getAxisDirection() == source.getAxisDirection() ? -1 : 1;
|
||||
|
||||
if (te instanceof SplitShaftTileEntity)
|
||||
return ((SplitShaftTileEntity) te).getRotationSpeedModifier(direction);
|
||||
if (be instanceof SplitShaftBlockEntity)
|
||||
return ((SplitShaftBlockEntity) be).getRotationSpeedModifier(direction);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ public class RotationPropagator {
|
|||
* @param worldIn
|
||||
* @param pos
|
||||
*/
|
||||
public static void handleAdded(Level worldIn, BlockPos pos, KineticTileEntity addedTE) {
|
||||
public static void handleAdded(Level worldIn, BlockPos pos, KineticBlockEntity addedTE) {
|
||||
if (worldIn.isClientSide)
|
||||
return;
|
||||
if (!worldIn.isLoaded(pos))
|
||||
|
@ -218,11 +218,11 @@ public class RotationPropagator {
|
|||
*
|
||||
* @param currentTE
|
||||
*/
|
||||
private static void propagateNewSource(KineticTileEntity currentTE) {
|
||||
private static void propagateNewSource(KineticBlockEntity currentTE) {
|
||||
BlockPos pos = currentTE.getBlockPos();
|
||||
Level world = currentTE.getLevel();
|
||||
|
||||
for (KineticTileEntity neighbourTE : getConnectedNeighbours(currentTE)) {
|
||||
for (KineticBlockEntity neighbourTE : getConnectedNeighbours(currentTE)) {
|
||||
float speedOfCurrent = currentTE.getTheoreticalSpeed();
|
||||
float speedOfNeighbour = neighbourTE.getTheoreticalSpeed();
|
||||
float newSpeed = getConveyedSpeed(currentTE, neighbourTE);
|
||||
|
@ -234,8 +234,8 @@ public class RotationPropagator {
|
|||
boolean incompatible =
|
||||
Math.signum(newSpeed) != Math.signum(speedOfNeighbour) && (newSpeed != 0 && speedOfNeighbour != 0);
|
||||
|
||||
boolean tooFast = Math.abs(newSpeed) > AllConfigs.SERVER.kinetics.maxRotationSpeed.get()
|
||||
|| Math.abs(oppositeSpeed) > AllConfigs.SERVER.kinetics.maxRotationSpeed.get();
|
||||
boolean tooFast = Math.abs(newSpeed) > AllConfigs.server().kinetics.maxRotationSpeed.get()
|
||||
|| Math.abs(oppositeSpeed) > AllConfigs.server().kinetics.maxRotationSpeed.get();
|
||||
// Check for both the new speed and the opposite speed, just in case
|
||||
|
||||
boolean speedChangedTooOften = currentTE.getFlickerScore() > MAX_FLICKER_SCORE;
|
||||
|
@ -306,29 +306,29 @@ public class RotationPropagator {
|
|||
*
|
||||
* @param worldIn
|
||||
* @param pos
|
||||
* @param removedTE
|
||||
* @param removedBE
|
||||
*/
|
||||
public static void handleRemoved(Level worldIn, BlockPos pos, KineticTileEntity removedTE) {
|
||||
public static void handleRemoved(Level worldIn, BlockPos pos, KineticBlockEntity removedBE) {
|
||||
if (worldIn.isClientSide)
|
||||
return;
|
||||
if (removedTE == null)
|
||||
if (removedBE == null)
|
||||
return;
|
||||
if (removedTE.getTheoreticalSpeed() == 0)
|
||||
if (removedBE.getTheoreticalSpeed() == 0)
|
||||
return;
|
||||
|
||||
for (BlockPos neighbourPos : getPotentialNeighbourLocations(removedTE)) {
|
||||
for (BlockPos neighbourPos : getPotentialNeighbourLocations(removedBE)) {
|
||||
BlockState neighbourState = worldIn.getBlockState(neighbourPos);
|
||||
if (!(neighbourState.getBlock() instanceof IRotate))
|
||||
continue;
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(neighbourPos);
|
||||
if (!(tileEntity instanceof KineticTileEntity))
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(neighbourPos);
|
||||
if (!(blockEntity instanceof KineticBlockEntity))
|
||||
continue;
|
||||
|
||||
final KineticTileEntity neighbourTE = (KineticTileEntity) tileEntity;
|
||||
if (!neighbourTE.hasSource() || !neighbourTE.source.equals(pos))
|
||||
final KineticBlockEntity neighbourBE = (KineticBlockEntity) blockEntity;
|
||||
if (!neighbourBE.hasSource() || !neighbourBE.source.equals(pos))
|
||||
continue;
|
||||
|
||||
propagateMissingSource(neighbourTE);
|
||||
propagateMissingSource(neighbourBE);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -339,44 +339,44 @@ public class RotationPropagator {
|
|||
*
|
||||
* @param updateTE
|
||||
*/
|
||||
private static void propagateMissingSource(KineticTileEntity updateTE) {
|
||||
private static void propagateMissingSource(KineticBlockEntity updateTE) {
|
||||
final Level world = updateTE.getLevel();
|
||||
|
||||
List<KineticTileEntity> potentialNewSources = new LinkedList<>();
|
||||
List<KineticBlockEntity> potentialNewSources = new LinkedList<>();
|
||||
List<BlockPos> frontier = new LinkedList<>();
|
||||
frontier.add(updateTE.getBlockPos());
|
||||
BlockPos missingSource = updateTE.hasSource() ? updateTE.source : null;
|
||||
|
||||
while (!frontier.isEmpty()) {
|
||||
final BlockPos pos = frontier.remove(0);
|
||||
BlockEntity tileEntity = world.getBlockEntity(pos);
|
||||
if (!(tileEntity instanceof KineticTileEntity))
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
if (!(blockEntity instanceof KineticBlockEntity))
|
||||
continue;
|
||||
final KineticTileEntity currentTE = (KineticTileEntity) tileEntity;
|
||||
final KineticBlockEntity currentBE = (KineticBlockEntity) blockEntity;
|
||||
|
||||
currentTE.removeSource();
|
||||
currentTE.sendData();
|
||||
currentBE.removeSource();
|
||||
currentBE.sendData();
|
||||
|
||||
for (KineticTileEntity neighbourTE : getConnectedNeighbours(currentTE)) {
|
||||
if (neighbourTE.getBlockPos()
|
||||
for (KineticBlockEntity neighbourBE : getConnectedNeighbours(currentBE)) {
|
||||
if (neighbourBE.getBlockPos()
|
||||
.equals(missingSource))
|
||||
continue;
|
||||
if (!neighbourTE.hasSource())
|
||||
if (!neighbourBE.hasSource())
|
||||
continue;
|
||||
|
||||
if (!neighbourTE.source.equals(pos)) {
|
||||
potentialNewSources.add(neighbourTE);
|
||||
if (!neighbourBE.source.equals(pos)) {
|
||||
potentialNewSources.add(neighbourBE);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (neighbourTE.isSource())
|
||||
potentialNewSources.add(neighbourTE);
|
||||
if (neighbourBE.isSource())
|
||||
potentialNewSources.add(neighbourBE);
|
||||
|
||||
frontier.add(neighbourTE.getBlockPos());
|
||||
frontier.add(neighbourBE.getBlockPos());
|
||||
}
|
||||
}
|
||||
|
||||
for (KineticTileEntity newSource : potentialNewSources) {
|
||||
for (KineticBlockEntity newSource : potentialNewSources) {
|
||||
if (newSource.hasSource() || newSource.isSource()) {
|
||||
propagateNewSource(newSource);
|
||||
return;
|
||||
|
@ -384,27 +384,27 @@ public class RotationPropagator {
|
|||
}
|
||||
}
|
||||
|
||||
private static KineticTileEntity findConnectedNeighbour(KineticTileEntity currentTE, BlockPos neighbourPos) {
|
||||
private static KineticBlockEntity findConnectedNeighbour(KineticBlockEntity currentTE, BlockPos neighbourPos) {
|
||||
BlockState neighbourState = currentTE.getLevel()
|
||||
.getBlockState(neighbourPos);
|
||||
if (!(neighbourState.getBlock() instanceof IRotate))
|
||||
return null;
|
||||
if (!neighbourState.hasBlockEntity())
|
||||
return null;
|
||||
BlockEntity neighbourTE = currentTE.getLevel()
|
||||
BlockEntity neighbourBE = currentTE.getLevel()
|
||||
.getBlockEntity(neighbourPos);
|
||||
if (!(neighbourTE instanceof KineticTileEntity))
|
||||
if (!(neighbourBE instanceof KineticBlockEntity))
|
||||
return null;
|
||||
KineticTileEntity neighbourKTE = (KineticTileEntity) neighbourTE;
|
||||
if (!(neighbourKTE.getBlockState()
|
||||
KineticBlockEntity neighbourKBE = (KineticBlockEntity) neighbourBE;
|
||||
if (!(neighbourKBE.getBlockState()
|
||||
.getBlock() instanceof IRotate))
|
||||
return null;
|
||||
if (!isConnected(currentTE, neighbourKTE) && !isConnected(neighbourKTE, currentTE))
|
||||
if (!isConnected(currentTE, neighbourKBE) && !isConnected(neighbourKBE, currentTE))
|
||||
return null;
|
||||
return neighbourKTE;
|
||||
return neighbourKBE;
|
||||
}
|
||||
|
||||
public static boolean isConnected(KineticTileEntity from, KineticTileEntity to) {
|
||||
public static boolean isConnected(KineticBlockEntity from, KineticBlockEntity to) {
|
||||
final BlockState stateFrom = from.getBlockState();
|
||||
final BlockState stateTo = to.getBlockState();
|
||||
return isLargeCogToSpeedController(stateFrom, stateTo, to.getBlockPos()
|
||||
|
@ -412,34 +412,34 @@ public class RotationPropagator {
|
|||
|| from.isCustomConnection(to, stateFrom, stateTo);
|
||||
}
|
||||
|
||||
private static List<KineticTileEntity> getConnectedNeighbours(KineticTileEntity te) {
|
||||
List<KineticTileEntity> neighbours = new LinkedList<>();
|
||||
for (BlockPos neighbourPos : getPotentialNeighbourLocations(te)) {
|
||||
final KineticTileEntity neighbourTE = findConnectedNeighbour(te, neighbourPos);
|
||||
if (neighbourTE == null)
|
||||
private static List<KineticBlockEntity> getConnectedNeighbours(KineticBlockEntity be) {
|
||||
List<KineticBlockEntity> neighbours = new LinkedList<>();
|
||||
for (BlockPos neighbourPos : getPotentialNeighbourLocations(be)) {
|
||||
final KineticBlockEntity neighbourBE = findConnectedNeighbour(be, neighbourPos);
|
||||
if (neighbourBE == null)
|
||||
continue;
|
||||
|
||||
neighbours.add(neighbourTE);
|
||||
neighbours.add(neighbourBE);
|
||||
}
|
||||
return neighbours;
|
||||
}
|
||||
|
||||
private static List<BlockPos> getPotentialNeighbourLocations(KineticTileEntity te) {
|
||||
private static List<BlockPos> getPotentialNeighbourLocations(KineticBlockEntity be) {
|
||||
List<BlockPos> neighbours = new LinkedList<>();
|
||||
|
||||
if (!te.getLevel()
|
||||
.isAreaLoaded(te.getBlockPos(), 1))
|
||||
if (!be.getLevel()
|
||||
.isAreaLoaded(be.getBlockPos(), 1))
|
||||
return neighbours;
|
||||
|
||||
for (Direction facing : Iterate.directions)
|
||||
neighbours.add(te.getBlockPos()
|
||||
neighbours.add(be.getBlockPos()
|
||||
.relative(facing));
|
||||
|
||||
BlockState blockState = te.getBlockState();
|
||||
BlockState blockState = be.getBlockState();
|
||||
if (!(blockState.getBlock() instanceof IRotate))
|
||||
return neighbours;
|
||||
IRotate block = (IRotate) blockState.getBlock();
|
||||
return te.addPropagationLocations(block, blockState, neighbours);
|
||||
return be.addPropagationLocations(block, blockState, neighbours);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
|
||||
import com.simibubi.create.foundation.utility.WorldHelper;
|
||||
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
|
@ -23,16 +23,16 @@ public class TorquePropagator {
|
|||
Create.LOGGER.debug("Removed Kinetic Network Space for " + WorldHelper.getDimensionID(world));
|
||||
}
|
||||
|
||||
public KineticNetwork getOrCreateNetworkFor(KineticTileEntity te) {
|
||||
Long id = te.network;
|
||||
public KineticNetwork getOrCreateNetworkFor(KineticBlockEntity be) {
|
||||
Long id = be.network;
|
||||
KineticNetwork network;
|
||||
Map<Long, KineticNetwork> map = networks.computeIfAbsent(te.getLevel(), $ -> new HashMap<>());
|
||||
Map<Long, KineticNetwork> map = networks.computeIfAbsent(be.getLevel(), $ -> new HashMap<>());
|
||||
if (id == null)
|
||||
return null;
|
||||
|
||||
if (!map.containsKey(id)) {
|
||||
network = new KineticNetwork();
|
||||
network.id = te.network;
|
||||
network.id = be.network;
|
||||
map.put(id, network);
|
||||
}
|
||||
network = map.get(id);
|
||||
|
|
|
@ -5,9 +5,9 @@ import com.jozufozu.flywheel.api.MaterialManager;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
|
||||
public class BackHalfShaftInstance extends HalfShaftInstance {
|
||||
public BackHalfShaftInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
||||
super(modelManager, tile);
|
||||
public class BackHalfShaftInstance<T extends KineticBlockEntity> extends HalfShaftInstance<T> {
|
||||
public BackHalfShaftInstance(MaterialManager materialManager, T blockEntity) {
|
||||
super(materialManager, blockEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -5,9 +5,9 @@ import com.jozufozu.flywheel.api.MaterialManager;
|
|||
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
||||
import com.simibubi.create.foundation.render.AllMaterialSpecs;
|
||||
|
||||
public class CutoutRotatingInstance extends SingleRotatingInstance {
|
||||
public CutoutRotatingInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
||||
super(modelManager, tile);
|
||||
public class CutoutRotatingInstance<T extends KineticBlockEntity> extends SingleRotatingInstance<T> {
|
||||
public CutoutRotatingInstance(MaterialManager materialManager, T blockEntity) {
|
||||
super(materialManager, blockEntity);
|
||||
}
|
||||
|
||||
protected Material<RotatingData> getRotatingMaterial() {
|
||||
|
|
|
@ -15,12 +15,12 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
|||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
||||
public abstract class GeneratingKineticBlockEntity extends KineticBlockEntity {
|
||||
|
||||
public boolean reActivateSource;
|
||||
|
||||
public GeneratingKineticTileEntity(BlockEntityType<?> typeIn, BlockPos pos, BlockState state) {
|
||||
super(typeIn, pos, state);
|
||||
public GeneratingKineticBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
|
||||
super(type, pos, state);
|
||||
}
|
||||
|
||||
protected void notifyStressCapacityChange(float capacity) {
|
||||
|
@ -37,11 +37,11 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
|||
@Override
|
||||
public void setSource(BlockPos source) {
|
||||
super.setSource(source);
|
||||
BlockEntity tileEntity = level.getBlockEntity(source);
|
||||
if (!(tileEntity instanceof KineticTileEntity))
|
||||
BlockEntity blockEntity = level.getBlockEntity(source);
|
||||
if (!(blockEntity instanceof KineticBlockEntity))
|
||||
return;
|
||||
KineticTileEntity sourceTe = (KineticTileEntity) tileEntity;
|
||||
if (reActivateSource && Math.abs(sourceTe.getSpeed()) >= Math.abs(getGeneratedSpeed()))
|
||||
KineticBlockEntity sourceBE = (KineticBlockEntity) blockEntity;
|
||||
if (reActivateSource && Math.abs(sourceBE.getSpeed()) >= Math.abs(getGeneratedSpeed()))
|
||||
reActivateSource = false;
|
||||
}
|
||||
|
|
@ -2,21 +2,21 @@ package com.simibubi.create.content.contraptions.base;
|
|||
|
||||
import com.jozufozu.flywheel.api.Instancer;
|
||||
import com.jozufozu.flywheel.api.MaterialManager;
|
||||
import com.simibubi.create.AllBlockPartials;
|
||||
import com.simibubi.create.AllPartialModels;
|
||||
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
|
||||
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
|
||||
public class HalfShaftInstance extends SingleRotatingInstance {
|
||||
public HalfShaftInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
||||
super(modelManager, tile);
|
||||
public class HalfShaftInstance<T extends KineticBlockEntity> extends SingleRotatingInstance<T> {
|
||||
public HalfShaftInstance(MaterialManager materialManager, T blockEntity) {
|
||||
super(materialManager, blockEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Instancer<RotatingData> getModel() {
|
||||
Direction dir = getShaftDirection();
|
||||
return getRotatingMaterial().getModel(AllBlockPartials.SHAFT_HALF, blockState, dir);
|
||||
return getRotatingMaterial().getModel(AllPartialModels.SHAFT_HALF, blockState, dir);
|
||||
}
|
||||
|
||||
protected Direction getShaftDirection() {
|
||||
|
|
|
@ -5,10 +5,10 @@ import com.jozufozu.flywheel.api.MaterialManager;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
|
||||
public class HorizontalHalfShaftInstance extends HalfShaftInstance {
|
||||
public class HorizontalHalfShaftInstance<T extends KineticBlockEntity> extends HalfShaftInstance<T> {
|
||||
|
||||
public HorizontalHalfShaftInstance(MaterialManager modelManager, KineticTileEntity tile) {
|
||||
super(modelManager, tile);
|
||||
public HorizontalHalfShaftInstance(MaterialManager materialManager, T blockEntity) {
|
||||
super(materialManager, blockEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.base;
|
|||
|
||||
import com.simibubi.create.content.contraptions.wrench.IWrenchable;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.item.ItemDescription;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
import com.simibubi.create.foundation.utility.LangBuilder;
|
||||
|
||||
|
@ -46,10 +46,10 @@ public interface IRotate extends IWrenchable {
|
|||
public float getSpeedValue() {
|
||||
switch (this) {
|
||||
case FAST:
|
||||
return AllConfigs.SERVER.kinetics.fastSpeed.get()
|
||||
return AllConfigs.server().kinetics.fastSpeed.get()
|
||||
.floatValue();
|
||||
case MEDIUM:
|
||||
return AllConfigs.SERVER.kinetics.mediumSpeed.get()
|
||||
return AllConfigs.server().kinetics.mediumSpeed.get()
|
||||
.floatValue();
|
||||
case SLOW:
|
||||
return 1;
|
||||
|
@ -62,9 +62,9 @@ public interface IRotate extends IWrenchable {
|
|||
public static SpeedLevel of(float speed) {
|
||||
speed = Math.abs(speed);
|
||||
|
||||
if (speed >= AllConfigs.SERVER.kinetics.fastSpeed.get())
|
||||
if (speed >= AllConfigs.server().kinetics.fastSpeed.get())
|
||||
return FAST;
|
||||
if (speed >= AllConfigs.SERVER.kinetics.mediumSpeed.get())
|
||||
if (speed >= AllConfigs.server().kinetics.mediumSpeed.get())
|
||||
return MEDIUM;
|
||||
if (speed >= 1)
|
||||
return SLOW;
|
||||
|
@ -73,7 +73,7 @@ public interface IRotate extends IWrenchable {
|
|||
|
||||
public static LangBuilder getFormattedSpeedText(float speed, boolean overstressed) {
|
||||
SpeedLevel speedLevel = of(speed);
|
||||
LangBuilder builder = Lang.text(ItemDescription.makeProgressBar(3, speedLevel.ordinal()));
|
||||
LangBuilder builder = Lang.text(TooltipHelper.makeProgressBar(3, speedLevel.ordinal()));
|
||||
|
||||
builder.translate("tooltip.speedRequirement." + Lang.asId(speedLevel.name()))
|
||||
.space()
|
||||
|
@ -128,12 +128,12 @@ public interface IRotate extends IWrenchable {
|
|||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return !AllConfigs.SERVER.kinetics.disableStress.get();
|
||||
return !AllConfigs.server().kinetics.disableStress.get();
|
||||
}
|
||||
|
||||
public static LangBuilder getFormattedStressText(double stressPercent) {
|
||||
StressImpact stressLevel = of(stressPercent);
|
||||
return Lang.text(ItemDescription.makeProgressBar(3, Math.min(stressLevel.ordinal() + 1, 3)))
|
||||
return Lang.text(TooltipHelper.makeProgressBar(3, Math.min(stressLevel.ordinal() + 1, 3)))
|
||||
.translate("tooltip.stressImpact." + Lang.asId(stressLevel.name()))
|
||||
.text(String.format(" (%s%%) ", (int) (stressPercent * 100)))
|
||||
.style(stressLevel.getRelativeColor());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.simibubi.create.content.contraptions.base;
|
||||
|
||||
import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
|
||||
import com.simibubi.create.foundation.item.ItemDescription.Palette;
|
||||
import com.simibubi.create.foundation.block.IBE;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
|
@ -16,23 +16,21 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
|
||||
public abstract class KineticBlock extends Block implements IRotate {
|
||||
|
||||
protected static final Palette color = Palette.Red;
|
||||
|
||||
public KineticBlock(Properties properties) {
|
||||
super(properties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlace(BlockState state, Level worldIn, BlockPos pos, BlockState oldState, boolean isMoving) {
|
||||
// onBlockAdded is useless for init, as sometimes the TE gets re-instantiated
|
||||
// onBlockAdded is useless for init, as sometimes the BE gets re-instantiated
|
||||
|
||||
// however, if a block change occurs that does not change kinetic connections,
|
||||
// we can prevent a major re-propagation here
|
||||
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
if (tileEntity instanceof KineticTileEntity) {
|
||||
KineticTileEntity kineticTileEntity = (KineticTileEntity) tileEntity;
|
||||
kineticTileEntity.preventSpeedUpdate = 0;
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
if (blockEntity instanceof KineticBlockEntity) {
|
||||
KineticBlockEntity kineticBlockEntity = (KineticBlockEntity) blockEntity;
|
||||
kineticBlockEntity.preventSpeedUpdate = 0;
|
||||
|
||||
if (oldState.getBlock() != state.getBlock())
|
||||
return;
|
||||
|
@ -41,9 +39,14 @@ public abstract class KineticBlock extends Block implements IRotate {
|
|||
if (!areStatesKineticallyEquivalent(oldState, state))
|
||||
return;
|
||||
|
||||
kineticTileEntity.preventSpeedUpdate = 2;
|
||||
kineticBlockEntity.preventSpeedUpdate = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemove(BlockState pState, Level pLevel, BlockPos pPos, BlockState pNewState, boolean pIsMoving) {
|
||||
IBE.onRemove(pState, pLevel, pPos, pNewState);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasShaftTowards(LevelReader world, BlockPos pos, BlockState state, Direction face) {
|
||||
|
@ -62,18 +65,18 @@ public abstract class KineticBlock extends Block implements IRotate {
|
|||
if (worldIn.isClientSide())
|
||||
return;
|
||||
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
if (!(tileEntity instanceof KineticTileEntity))
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
if (!(blockEntity instanceof KineticBlockEntity))
|
||||
return;
|
||||
KineticTileEntity kte = (KineticTileEntity) tileEntity;
|
||||
KineticBlockEntity kbe = (KineticBlockEntity) blockEntity;
|
||||
|
||||
if (kte.preventSpeedUpdate > 0)
|
||||
if (kbe.preventSpeedUpdate > 0)
|
||||
return;
|
||||
|
||||
// Remove previous information when block is added
|
||||
kte.warnOfMovement();
|
||||
kte.clearKineticInformation();
|
||||
kte.updateSpeed = true;
|
||||
kbe.warnOfMovement();
|
||||
kbe.clearKineticInformation();
|
||||
kbe.updateSpeed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,12 +85,12 @@ public abstract class KineticBlock extends Block implements IRotate {
|
|||
if (worldIn.isClientSide)
|
||||
return;
|
||||
|
||||
BlockEntity tileEntity = worldIn.getBlockEntity(pos);
|
||||
if (!(tileEntity instanceof KineticTileEntity))
|
||||
BlockEntity blockEntity = worldIn.getBlockEntity(pos);
|
||||
if (!(blockEntity instanceof KineticBlockEntity))
|
||||
return;
|
||||
|
||||
KineticTileEntity kte = (KineticTileEntity) tileEntity;
|
||||
kte.effects.queueRotationIndicators();
|
||||
KineticBlockEntity kbe = (KineticBlockEntity) blockEntity;
|
||||
kbe.effects.queueRotationIndicators();
|
||||
}
|
||||
|
||||
public float getParticleTargetRadius() {
|
||||
|
|
|
@ -18,12 +18,13 @@ import com.simibubi.create.content.contraptions.goggles.IHaveHoveringInformation
|
|||
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
|
||||
import com.simibubi.create.content.contraptions.relays.gearbox.GearboxBlock;
|
||||
import com.simibubi.create.foundation.block.BlockStressValues;
|
||||
import com.simibubi.create.foundation.blockEntity.BlockEntityBehaviour;
|
||||
import com.simibubi.create.foundation.blockEntity.SmartBlockEntity;
|
||||
import com.simibubi.create.foundation.config.AllConfigs;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper;
|
||||
import com.simibubi.create.foundation.item.TooltipHelper.Palette;
|
||||
import com.simibubi.create.foundation.sound.SoundScapes;
|
||||
import com.simibubi.create.foundation.sound.SoundScapes.AmbienceGroup;
|
||||
import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
|
||||
import net.minecraft.ChatFormatting;
|
||||
|
@ -46,7 +47,7 @@ import net.minecraftforge.api.distmarker.Dist;
|
|||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
|
||||
public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInformation, IHaveHoveringInformation {
|
||||
public class KineticBlockEntity extends SmartBlockEntity implements IHaveGoggleInformation, IHaveHoveringInformation {
|
||||
|
||||
public @Nullable Long network;
|
||||
public @Nullable BlockPos source;
|
||||
|
@ -67,7 +68,7 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
protected float lastStressApplied;
|
||||
protected float lastCapacityProvided;
|
||||
|
||||
public KineticTileEntity(BlockEntityType<?> typeIn, BlockPos pos, BlockState state) {
|
||||
public KineticBlockEntity(BlockEntityType<?> typeIn, BlockPos pos, BlockState state) {
|
||||
super(typeIn, pos, state);
|
||||
effects = new KineticEffectHandler(this);
|
||||
updateSpeed = true;
|
||||
|
@ -101,7 +102,7 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
}
|
||||
|
||||
if (validationCountdown-- <= 0) {
|
||||
validationCountdown = AllConfigs.SERVER.kinetics.kineticValidationFrequency.get();
|
||||
validationCountdown = AllConfigs.server().kinetics.kineticValidationFrequency.get();
|
||||
validateKinetics();
|
||||
}
|
||||
|
||||
|
@ -125,10 +126,10 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
if (!level.isLoaded(source))
|
||||
return;
|
||||
|
||||
BlockEntity tileEntity = level.getBlockEntity(source);
|
||||
KineticTileEntity sourceTe =
|
||||
tileEntity instanceof KineticTileEntity ? (KineticTileEntity) tileEntity : null;
|
||||
if (sourceTe == null || sourceTe.speed == 0) {
|
||||
BlockEntity blockEntity = level.getBlockEntity(source);
|
||||
KineticBlockEntity sourceBE =
|
||||
blockEntity instanceof KineticBlockEntity ? (KineticBlockEntity) blockEntity : null;
|
||||
if (sourceBE == null || sourceBE.speed == 0) {
|
||||
removeSource();
|
||||
detachKinetics();
|
||||
return;
|
||||
|
@ -184,18 +185,13 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setRemoved() {
|
||||
super.setRemoved();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setRemovedNotDueToChunkUnload() {
|
||||
public void remove() {
|
||||
if (!level.isClientSide) {
|
||||
if (hasNetwork())
|
||||
getOrCreateNetwork().remove(this);
|
||||
detachKinetics();
|
||||
}
|
||||
super.setRemovedNotDueToChunkUnload();
|
||||
super.remove();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -297,14 +293,14 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
if (level == null || level.isClientSide)
|
||||
return;
|
||||
|
||||
BlockEntity tileEntity = level.getBlockEntity(source);
|
||||
if (!(tileEntity instanceof KineticTileEntity)) {
|
||||
BlockEntity blockEntity = level.getBlockEntity(source);
|
||||
if (!(blockEntity instanceof KineticBlockEntity)) {
|
||||
removeSource();
|
||||
return;
|
||||
}
|
||||
|
||||
KineticTileEntity sourceTe = (KineticTileEntity) tileEntity;
|
||||
setNetwork(sourceTe.network);
|
||||
KineticBlockEntity sourceBE = (KineticBlockEntity) blockEntity;
|
||||
setNetwork(sourceBE.network);
|
||||
}
|
||||
|
||||
public void removeSource() {
|
||||
|
@ -365,43 +361,43 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
if (world.isClientSide)
|
||||
return;
|
||||
|
||||
BlockEntity tileEntityIn = world.getBlockEntity(pos);
|
||||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
BlockState currentState = world.getBlockState(pos);
|
||||
boolean isKinetic = tileEntityIn instanceof KineticTileEntity;
|
||||
boolean isKinetic = blockEntity instanceof KineticBlockEntity;
|
||||
|
||||
if (currentState == state)
|
||||
return;
|
||||
if (tileEntityIn == null || !isKinetic) {
|
||||
if (blockEntity == null || !isKinetic) {
|
||||
world.setBlock(pos, state, 3);
|
||||
return;
|
||||
}
|
||||
|
||||
KineticTileEntity tileEntity = (KineticTileEntity) tileEntityIn;
|
||||
KineticBlockEntity kineticBlockEntity = (KineticBlockEntity) blockEntity;
|
||||
if (state.getBlock() instanceof KineticBlock
|
||||
&& !((KineticBlock) state.getBlock()).areStatesKineticallyEquivalent(currentState, state)) {
|
||||
if (tileEntity.hasNetwork())
|
||||
tileEntity.getOrCreateNetwork()
|
||||
.remove(tileEntity);
|
||||
tileEntity.detachKinetics();
|
||||
tileEntity.removeSource();
|
||||
if (kineticBlockEntity.hasNetwork())
|
||||
kineticBlockEntity.getOrCreateNetwork()
|
||||
.remove(kineticBlockEntity);
|
||||
kineticBlockEntity.detachKinetics();
|
||||
kineticBlockEntity.removeSource();
|
||||
}
|
||||
|
||||
world.setBlock(pos, state, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBehaviours(List<TileEntityBehaviour> behaviours) {}
|
||||
public void addBehaviours(List<BlockEntityBehaviour> behaviours) {}
|
||||
|
||||
@Override
|
||||
public boolean addToTooltip(List<Component> tooltip, boolean isPlayerSneaking) {
|
||||
boolean notFastEnough = !isSpeedRequirementFulfilled() && getSpeed() != 0;
|
||||
|
||||
if (overStressed && AllConfigs.CLIENT.enableOverstressedTooltip.get()) {
|
||||
if (overStressed && AllConfigs.client().enableOverstressedTooltip.get()) {
|
||||
Lang.translate("gui.stressometer.overstressed")
|
||||
.style(GOLD)
|
||||
.forGoggles(tooltip);
|
||||
Component hint = Lang.translateDirect("gui.contraptions.network_overstressed");
|
||||
List<Component> cutString = TooltipHelper.cutTextComponent(hint, GRAY, ChatFormatting.WHITE);
|
||||
List<Component> cutString = TooltipHelper.cutTextComponent(hint, Palette.GRAY_AND_WHITE);
|
||||
for (int i = 0; i < cutString.size(); i++)
|
||||
Lang.builder()
|
||||
.add(cutString.get(i)
|
||||
|
@ -417,7 +413,7 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
MutableComponent hint =
|
||||
Lang.translateDirect("gui.contraptions.not_fast_enough", I18n.get(getBlockState().getBlock()
|
||||
.getDescriptionId()));
|
||||
List<Component> cutString = TooltipHelper.cutTextComponent(hint, GRAY, ChatFormatting.WHITE);
|
||||
List<Component> cutString = TooltipHelper.cutTextComponent(hint, Palette.GRAY_AND_WHITE);
|
||||
for (int i = 0; i < cutString.size(); i++)
|
||||
Lang.builder()
|
||||
.add(cutString.get(i)
|
||||
|
@ -505,18 +501,18 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
* Specify ratio of transferred rotation from this kinetic component to a
|
||||
* specific other.
|
||||
*
|
||||
* @param target other Kinetic TE to transfer to
|
||||
* @param stateFrom this TE's blockstate
|
||||
* @param stateTo other TE's blockstate
|
||||
* @param target other Kinetic BE to transfer to
|
||||
* @param stateFrom this BE's blockstate
|
||||
* @param stateTo other BE's blockstate
|
||||
* @param diff difference in position (to.pos - from.pos)
|
||||
* @param connectedViaAxes whether these kinetic blocks are connected via mutual
|
||||
* IRotate.hasShaftTowards()
|
||||
* @param connectedViaCogs whether these kinetic blocks are connected via mutual
|
||||
* IRotate.hasIntegratedCogwheel()
|
||||
* @return factor of rotation speed from this TE to other. 0 if no rotation is
|
||||
* @return factor of rotation speed from this BE to other. 0 if no rotation is
|
||||
* transferred, or the standard rules apply (integrated shafts/cogs)
|
||||
*/
|
||||
public float propagateRotationTo(KineticTileEntity target, BlockState stateFrom, BlockState stateTo, BlockPos diff,
|
||||
public float propagateRotationTo(KineticBlockEntity target, BlockState stateFrom, BlockState stateTo, BlockPos diff,
|
||||
boolean connectedViaAxes, boolean connectedViaCogs) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -559,7 +555,7 @@ public class KineticTileEntity extends SmartTileEntity implements IHaveGoggleInf
|
|||
* @return true if this and the other component should check their propagation
|
||||
* factor and are not already connected via integrated cogs or shafts
|
||||
*/
|
||||
public boolean isCustomConnection(KineticTileEntity other, BlockState state, BlockState otherState) {
|
||||
public boolean isCustomConnection(KineticBlockEntity other, BlockState state, BlockState otherState) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -13,21 +13,21 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.core.Direction.Axis;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public abstract class KineticTileInstance<T extends KineticTileEntity> extends BlockEntityInstance<T> {
|
||||
public abstract class KineticBlockEntityInstance<T extends KineticBlockEntity> extends BlockEntityInstance<T> {
|
||||
|
||||
protected final Direction.Axis axis;
|
||||
|
||||
public KineticTileInstance(MaterialManager modelManager, T tile) {
|
||||
super(modelManager, tile);
|
||||
axis = (blockState.getBlock()instanceof IRotate irotate) ? irotate.getRotationAxis(blockState) : Axis.Y;
|
||||
public KineticBlockEntityInstance(MaterialManager materialManager, T blockEntity) {
|
||||
super(materialManager, blockEntity);
|
||||
axis = (blockState.getBlock() instanceof IRotate irotate) ? irotate.getRotationAxis(blockState) : Axis.Y;
|
||||
}
|
||||
|
||||
protected final void updateRotation(RotatingData instance) {
|
||||
updateRotation(instance, getRotationAxis(), getTileSpeed());
|
||||
updateRotation(instance, getRotationAxis(), getBlockEntitySpeed());
|
||||
}
|
||||
|
||||
protected final void updateRotation(RotatingData instance, Direction.Axis axis) {
|
||||
updateRotation(instance, axis, getTileSpeed());
|
||||
updateRotation(instance, axis, getBlockEntitySpeed());
|
||||
}
|
||||
|
||||
protected final void updateRotation(RotatingData instance, float speed) {
|
||||
|
@ -42,11 +42,11 @@ public abstract class KineticTileInstance<T extends KineticTileEntity> extends B
|
|||
}
|
||||
|
||||
protected final RotatingData setup(RotatingData key) {
|
||||
return setup(key, getRotationAxis(), getTileSpeed());
|
||||
return setup(key, getRotationAxis(), getBlockEntitySpeed());
|
||||
}
|
||||
|
||||
protected final RotatingData setup(RotatingData key, Direction.Axis axis) {
|
||||
return setup(key, axis, getTileSpeed());
|
||||
return setup(key, axis, getBlockEntitySpeed());
|
||||
}
|
||||
|
||||
protected final RotatingData setup(RotatingData key, float speed) {
|
||||
|
@ -77,7 +77,7 @@ public abstract class KineticTileInstance<T extends KineticTileEntity> extends B
|
|||
return axis;
|
||||
}
|
||||
|
||||
protected float getTileSpeed() {
|
||||
protected float getBlockEntitySpeed() {
|
||||
return blockEntity.getSpeed();
|
||||
}
|
||||
|
|
@ -8,10 +8,10 @@ import com.mojang.blaze3d.vertex.VertexConsumer;
|
|||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.content.contraptions.KineticDebugger;
|
||||
import com.simibubi.create.content.contraptions.relays.elementary.ICogWheel;
|
||||
import com.simibubi.create.foundation.blockEntity.renderer.SafeBlockEntityRenderer;
|
||||
import com.simibubi.create.foundation.render.CachedBufferer;
|
||||
import com.simibubi.create.foundation.render.SuperByteBuffer;
|
||||
import com.simibubi.create.foundation.render.SuperByteBufferCache;
|
||||
import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.utility.Color;
|
||||
|
||||
|
@ -26,9 +26,9 @@ import net.minecraft.core.Direction.AxisDirection;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
|
||||
public class KineticTileEntityRenderer extends SafeTileEntityRenderer<KineticTileEntity> {
|
||||
public class KineticBlockEntityRenderer<T extends KineticBlockEntity> extends SafeBlockEntityRenderer<T> {
|
||||
|
||||
public static final SuperByteBufferCache.Compartment<BlockState> KINETIC_TILE = new SuperByteBufferCache.Compartment<>();
|
||||
public static final SuperByteBufferCache.Compartment<BlockState> KINETIC_BLOCK = new SuperByteBufferCache.Compartment<>();
|
||||
public static boolean rainbowMode = false;
|
||||
|
||||
protected static final RenderType[] REVERSED_CHUNK_BUFFER_LAYERS = RenderType.chunkBufferLayers().toArray(RenderType[]::new);
|
||||
|
@ -36,71 +36,71 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer<KineticTil
|
|||
ArrayUtils.reverse(REVERSED_CHUNK_BUFFER_LAYERS);
|
||||
}
|
||||
|
||||
public KineticTileEntityRenderer(BlockEntityRendererProvider.Context context) {
|
||||
public KineticBlockEntityRenderer(BlockEntityRendererProvider.Context context) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderSafe(KineticTileEntity te, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||
protected void renderSafe(T be, float partialTicks, PoseStack ms, MultiBufferSource buffer,
|
||||
int light, int overlay) {
|
||||
if (Backend.canUseInstancing(te.getLevel())) return;
|
||||
if (Backend.canUseInstancing(be.getLevel())) return;
|
||||
|
||||
BlockState state = getRenderedBlockState(te);
|
||||
RenderType type = getRenderType(te, state);
|
||||
BlockState state = getRenderedBlockState(be);
|
||||
RenderType type = getRenderType(be, state);
|
||||
if (type != null)
|
||||
renderRotatingBuffer(te, getRotatedModel(te, state), ms, buffer.getBuffer(type), light);
|
||||
renderRotatingBuffer(be, getRotatedModel(be, state), ms, buffer.getBuffer(type), light);
|
||||
}
|
||||
|
||||
protected BlockState getRenderedBlockState(KineticTileEntity te) {
|
||||
return te.getBlockState();
|
||||
protected BlockState getRenderedBlockState(T be) {
|
||||
return be.getBlockState();
|
||||
}
|
||||
|
||||
protected RenderType getRenderType(KineticTileEntity te, BlockState state) {
|
||||
protected RenderType getRenderType(T be, BlockState state) {
|
||||
for (RenderType type : REVERSED_CHUNK_BUFFER_LAYERS)
|
||||
if (ItemBlockRenderTypes.canRenderInLayer(state, type))
|
||||
return type;
|
||||
return null;
|
||||
}
|
||||
|
||||
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
|
||||
return CachedBufferer.block(KINETIC_TILE, state);
|
||||
protected SuperByteBuffer getRotatedModel(T be, BlockState state) {
|
||||
return CachedBufferer.block(KINETIC_BLOCK, state);
|
||||
}
|
||||
|
||||
public static void renderRotatingKineticBlock(KineticTileEntity te, BlockState renderedState, PoseStack ms,
|
||||
public static void renderRotatingKineticBlock(KineticBlockEntity be, BlockState renderedState, PoseStack ms,
|
||||
VertexConsumer buffer, int light) {
|
||||
SuperByteBuffer superByteBuffer = CachedBufferer.block(KINETIC_TILE, renderedState);
|
||||
renderRotatingBuffer(te, superByteBuffer, ms, buffer, light);
|
||||
SuperByteBuffer superByteBuffer = CachedBufferer.block(KINETIC_BLOCK, renderedState);
|
||||
renderRotatingBuffer(be, superByteBuffer, ms, buffer, light);
|
||||
}
|
||||
|
||||
public static void renderRotatingBuffer(KineticTileEntity te, SuperByteBuffer superBuffer, PoseStack ms,
|
||||
public static void renderRotatingBuffer(KineticBlockEntity be, SuperByteBuffer superBuffer, PoseStack ms,
|
||||
VertexConsumer buffer, int light) {
|
||||
standardKineticRotationTransform(superBuffer, te, light).renderInto(ms, buffer);
|
||||
standardKineticRotationTransform(superBuffer, be, light).renderInto(ms, buffer);
|
||||
}
|
||||
|
||||
public static float getAngleForTe(KineticTileEntity te, final BlockPos pos, Axis axis) {
|
||||
float time = AnimationTickHolder.getRenderTime(te.getLevel());
|
||||
float offset = getRotationOffsetForPosition(te, pos, axis);
|
||||
float angle = ((time * te.getSpeed() * 3f / 10 + offset) % 360) / 180 * (float) Math.PI;
|
||||
public static float getAngleForTe(KineticBlockEntity be, final BlockPos pos, Axis axis) {
|
||||
float time = AnimationTickHolder.getRenderTime(be.getLevel());
|
||||
float offset = getRotationOffsetForPosition(be, pos, axis);
|
||||
float angle = ((time * be.getSpeed() * 3f / 10 + offset) % 360) / 180 * (float) Math.PI;
|
||||
return angle;
|
||||
}
|
||||
|
||||
public static SuperByteBuffer standardKineticRotationTransform(SuperByteBuffer buffer, KineticTileEntity te,
|
||||
public static SuperByteBuffer standardKineticRotationTransform(SuperByteBuffer buffer, KineticBlockEntity be,
|
||||
int light) {
|
||||
final BlockPos pos = te.getBlockPos();
|
||||
Axis axis = ((IRotate) te.getBlockState()
|
||||
.getBlock()).getRotationAxis(te.getBlockState());
|
||||
return kineticRotationTransform(buffer, te, axis, getAngleForTe(te, pos, axis), light);
|
||||
final BlockPos pos = be.getBlockPos();
|
||||
Axis axis = ((IRotate) be.getBlockState()
|
||||
.getBlock()).getRotationAxis(be.getBlockState());
|
||||
return kineticRotationTransform(buffer, be, axis, getAngleForTe(be, pos, axis), light);
|
||||
}
|
||||
|
||||
public static SuperByteBuffer kineticRotationTransform(SuperByteBuffer buffer, KineticTileEntity te, Axis axis,
|
||||
public static SuperByteBuffer kineticRotationTransform(SuperByteBuffer buffer, KineticBlockEntity be, Axis axis,
|
||||
float angle, int light) {
|
||||
buffer.light(light);
|
||||
buffer.rotateCentered(Direction.get(AxisDirection.POSITIVE, axis), angle);
|
||||
|
||||
if (KineticDebugger.isActive()) {
|
||||
rainbowMode = true;
|
||||
buffer.color(te.hasNetwork() ? Color.generateFromLong(te.network) : Color.WHITE);
|
||||
buffer.color(be.hasNetwork() ? Color.generateFromLong(be.network) : Color.WHITE);
|
||||
} else {
|
||||
float overStressedEffect = te.effects.overStressedEffect;
|
||||
float overStressedEffect = be.effects.overStressedEffect;
|
||||
if (overStressedEffect != 0)
|
||||
if (overStressedEffect > 0)
|
||||
buffer.color(Color.WHITE.mixWith(Color.RED, overStressedEffect));
|
||||
|
@ -113,13 +113,13 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer<KineticTil
|
|||
return buffer;
|
||||
}
|
||||
|
||||
public static float getRotationOffsetForPosition(KineticTileEntity te, final BlockPos pos, final Axis axis) {
|
||||
float offset = ICogWheel.isLargeCog(te.getBlockState()) ? 11.25f : 0;
|
||||
public static float getRotationOffsetForPosition(KineticBlockEntity be, final BlockPos pos, final Axis axis) {
|
||||
float offset = ICogWheel.isLargeCog(be.getBlockState()) ? 11.25f : 0;
|
||||
double d = (((axis == Axis.X) ? 0 : pos.getX()) + ((axis == Axis.Y) ? 0 : pos.getY())
|
||||
+ ((axis == Axis.Z) ? 0 : pos.getZ())) % 2;
|
||||
if (d == 0)
|
||||
offset = 22.5f;
|
||||
return offset + te.getRotationAngleOffset(axis);
|
||||
return offset + be.getRotationAngleOffset(axis);
|
||||
}
|
||||
|
||||
public static BlockState shaft(Axis axis) {
|
||||
|
@ -127,9 +127,9 @@ public class KineticTileEntityRenderer extends SafeTileEntityRenderer<KineticTil
|
|||
.setValue(BlockStateProperties.AXIS, axis);
|
||||
}
|
||||
|
||||
public static Axis getRotationAxisOf(KineticTileEntity te) {
|
||||
return ((IRotate) te.getBlockState()
|
||||
.getBlock()).getRotationAxis(te.getBlockState());
|
||||
public static Axis getRotationAxisOf(KineticBlockEntity be) {
|
||||
return ((IRotate) be.getBlockState()
|
||||
.getBlock()).getRotationAxis(be.getBlockState());
|
||||
}
|
||||
|
||||
}
|
|
@ -21,9 +21,9 @@ public class KineticEffectHandler {
|
|||
int overStressedTime;
|
||||
float overStressedEffect;
|
||||
int particleSpawnCountdown;
|
||||
KineticTileEntity kte;
|
||||
KineticBlockEntity kte;
|
||||
|
||||
public KineticEffectHandler(KineticTileEntity kte) {
|
||||
public KineticEffectHandler(KineticBlockEntity kte) {
|
||||
this.kte = kte;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue