Merge branch 'mc1.18/0.5.1' into mc1.18/0.5.1-repolish

This commit is contained in:
simibubi 2023-02-24 22:29:10 +01:00
commit 51e3aadd34
1001 changed files with 27049 additions and 67113 deletions

View file

@ -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
View 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 }}

View file

@ -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>

View file

@ -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
View 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",
}
}
}
]

View file

@ -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

View file

@ -573,23 +573,7 @@ bf2b0310500213ff853c748c236eb5d01f61658e assets/create/blockstates/yellow_toolbo
7f39521b211441f5c3e06d60c5978cebe16cacfb assets/create/blockstates/zinc_block.json
b7181bcd8182b2f17088e5aa881f374c9c65470c assets/create/blockstates/zinc_ore.json
f7ccfdfb562774ed479b0eb4428b01c9370a0e82 assets/create/lang/en_ud.json
a687bb0e852475b0767811d1ed312cea575c8d67 assets/create/lang/en_us.json
24ac91b8858450b43759a28f4e723770ff830f3e assets/create/lang/unfinished/de_de.json
03d654aa6010284357870c7182b09b0f3c002a36 assets/create/lang/unfinished/es_cl.json
5cc92870004fc51c4161e18fe47584c3ed007d95 assets/create/lang/unfinished/es_es.json
777b19874e306ff7cf15680daa09cb96f6932bac assets/create/lang/unfinished/fr_fr.json
6195558d5fab2313cbecdf6700cac56ba6cc01bc assets/create/lang/unfinished/it_it.json
ec44c15168f39ddef731a63c381334648d2c43ec assets/create/lang/unfinished/ja_jp.json
a748f9aa8e1a2e46a767534d108f45106d9ba1cd assets/create/lang/unfinished/ko_kr.json
f2b869014a5a09bb6afde268bca429d30678b513 assets/create/lang/unfinished/nl_nl.json
06ab4f23425ecdabd0f6d448cd4f3cce9c4b6340 assets/create/lang/unfinished/pl_pl.json
8e3c503979b094574aa63bfed38c49d8a89a38a2 assets/create/lang/unfinished/pt_br.json
1d0aaae3e650b5c0b5331b12fb65c0b9287510b3 assets/create/lang/unfinished/pt_pt.json
f9446a1fe1546c679553b6ae06afc52b77c1d249 assets/create/lang/unfinished/ro_ro.json
140a5ac56c031fe47aaedb1c3ee1e7d8ff363240 assets/create/lang/unfinished/ru_ru.json
3bc54c7c305a6f33e9c1eb84bfd7d4282c6e635d assets/create/lang/unfinished/uk_ua.json
7096c87595fa806088e0602cb165cc6c68336c96 assets/create/lang/unfinished/zh_cn.json
994886a932bc8cc19c8203273e2b0d5852c86fd5 assets/create/lang/unfinished/zh_tw.json
95b45943acc80d5269a1659d826c9037e85cf8a3 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
@ -5681,22 +5665,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
c71f8ee0103d0c1b0d1b0727f1ecdc4d1999f1f6 data/create/tags/blocks/wrench_pickup.json
96671fd75d4209280940ef774c4185f33610a64d 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
@ -5704,6 +5688,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
@ -5744,7 +5729,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
@ -5798,6 +5782,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

View file

@ -1142,6 +1142,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 +1208,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 +1236,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 +1784,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 [------------------------<-",

View file

@ -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"
]
}

View file

@ -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"
]
}

View file

@ -0,0 +1,8 @@
{
"replace": false,
"values": [
"minecraft:cobweb",
"minecraft:powder_snow",
"#minecraft:fence_gates"
]
}

View file

@ -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"
]
}

View file

@ -27,7 +27,7 @@
"create:placard",
"create:pulse_repeater",
"create:pulse_extender",
"#minecraft:signs",
"#minecraft:banners"
"#minecraft:banners",
"#minecraft:signs"
]
}

View file

@ -2,9 +2,9 @@
"replace": false,
"values": [
"minecraft:bee_nest",
"minecraft:vine",
"minecraft:cocoa",
"minecraft:moss_carpet",
"minecraft:shroomlight",
"minecraft:cocoa"
"minecraft:vine"
]
}

View file

@ -1,4 +0,0 @@
{
"replace": false,
"values": []
}

View file

@ -1,9 +1,6 @@
{
"replace": false,
"values": [
"#minecraft:rails",
"#minecraft:buttons",
"#minecraft:pressure_plates",
"minecraft:redstone_wire",
"minecraft:redstone_torch",
"minecraft:repeater",
@ -17,6 +14,9 @@
"minecraft:tripwire_hook",
"minecraft:daylight_detector",
"minecraft:target",
"minecraft:hopper"
"minecraft:hopper",
"#minecraft:buttons",
"#minecraft:pressure_plates",
"#minecraft:rails"
]
}

View file

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"minecraft:milk_bucket",
"minecraft:potion"
]
}

View file

@ -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;
@ -125,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;
@ -243,7 +243,7 @@ import com.simibubi.create.foundation.data.BuilderTransformers;
import com.simibubi.create.foundation.data.CreateRegistrate;
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;
@ -290,15 +290,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)
@ -332,10 +329,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))
@ -372,23 +365,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))))
@ -396,9 +392,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))))
@ -406,16 +403,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();
@ -614,7 +613,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)
@ -881,7 +880,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)
@ -892,6 +891,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 =
@ -1444,7 +1444,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)
@ -1579,10 +1579,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))
@ -2024,10 +2020,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)
@ -2079,7 +2071,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"))
@ -2091,10 +2083,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))

View 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() {
}
}

View file

@ -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)

View file

@ -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)

View file

@ -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")

View file

@ -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);
}

View file

@ -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();

View file

@ -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();
}

View file

@ -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);
}

View file

@ -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

View file

@ -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();
}
}

View file

@ -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);
}

View file

@ -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"))

View file

@ -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() {

View file

@ -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() {

View file

@ -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();
}
}

View file

@ -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();
}
}

View file

@ -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

View file

@ -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) {

View file

@ -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;
}

View file

@ -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)

View file

@ -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));
}
}
}

View file

@ -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;

View file

@ -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);
}

View file

@ -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

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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) {

View file

@ -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);

View file

@ -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)

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;
}
}

View file

@ -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();
}
}

View file

@ -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);
}
}

View file

@ -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();
}
}

View file

@ -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;
}
}

View file

@ -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) {

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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

View file

@ -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() {

View file

@ -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;
}

View file

@ -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() {

View file

@ -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

View file

@ -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());

View file

@ -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() {

View file

@ -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;
}

View file

@ -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();
}

View file

@ -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());
}
}

View file

@ -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;
}

View file

@ -6,12 +6,12 @@ import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
import net.minecraft.world.level.block.state.BlockState;
public class SingleRotatingInstance extends KineticTileInstance<KineticTileEntity> {
public class SingleRotatingInstance<T extends KineticBlockEntity> extends KineticBlockEntityInstance<T> {
protected RotatingData rotatingModel;
public SingleRotatingInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile);
public SingleRotatingInstance(MaterialManager materialManager, T blockEntity) {
super(materialManager, blockEntity);
}
@Override

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.base.flwdata;
import com.jozufozu.flywheel.core.materials.BasicData;
import com.mojang.math.Vector3f;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.foundation.utility.Color;
import net.minecraft.core.BlockPos;
@ -38,9 +38,9 @@ public class KineticData extends BasicData {
return this;
}
public KineticData setColor(KineticTileEntity te) {
if (te.hasNetwork()) {
setColor(Color.generateFromLong(te.network));
public KineticData setColor(KineticBlockEntity blockEntity) {
if (blockEntity.hasNetwork()) {
setColor(Color.generateFromLong(blockEntity.network));
}else {
setColor(0xFF, 0xFF, 0xFF);
}

View file

@ -15,7 +15,7 @@ import net.minecraft.world.phys.Vec3;
public class BellMovementBehaviour implements MovementBehaviour {
@Override
public boolean renderAsNormalTileEntity() {
public boolean renderAsNormalBlockEntity() {
return true;
}

View file

@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.actors;
import java.util.concurrent.atomic.AtomicInteger;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticBlockEntity;
import com.simibubi.create.foundation.utility.BlockHelper;
import com.simibubi.create.foundation.utility.VecHelper;
@ -18,7 +18,7 @@ import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity {
public abstract class BlockBreakingKineticBlockEntity extends KineticBlockEntity {
public static final AtomicInteger NEXT_BREAKER_ID = new AtomicInteger();
protected int ticksUntilNextProgress;
@ -26,8 +26,8 @@ public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity {
protected int breakerId = -NEXT_BREAKER_ID.incrementAndGet();
protected BlockPos breakingPos;
public BlockBreakingKineticTileEntity(BlockEntityType<?> typeIn, BlockPos pos, BlockState state) {
super(typeIn, pos, state);
public BlockBreakingKineticBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}
@Override
@ -73,10 +73,10 @@ public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity {
}
@Override
public void setRemoved() {
public void invalidate() {
super.invalidate();
if (!level.isClientSide && destroyProgress != 0)
level.destroyBlockProgress(breakerId, breakingPos, -1);
super.setRemoved();
}
@Override

View file

@ -28,7 +28,7 @@ public class BlockBreakingMovementBehaviour implements MovementBehaviour {
public void startMoving(MovementContext context) {
if (context.world.isClientSide)
return;
context.data.putInt("BreakerId", -BlockBreakingKineticTileEntity.NEXT_BREAKER_ID.incrementAndGet());
context.data.putInt("BreakerId", -BlockBreakingKineticBlockEntity.NEXT_BREAKER_ID.incrementAndGet());
}
@Override
@ -220,7 +220,7 @@ public class BlockBreakingMovementBehaviour implements MovementBehaviour {
public boolean canBreak(Level world, BlockPos breakingPos, BlockState state) {
float blockHardness = state.getDestroySpeed(world, breakingPos);
return BlockBreakingKineticTileEntity.isBreakable(state, blockHardness);
return BlockBreakingKineticBlockEntity.isBreakable(state, blockHardness);
}
protected void onBlockBroken(MovementContext context, BlockPos pos, BlockState brokenState) {

View file

@ -10,7 +10,7 @@ import net.minecraft.world.level.block.CampfireBlock;
public class CampfireMovementBehaviour implements MovementBehaviour {
@Override
public boolean renderAsNormalTileEntity() {
public boolean renderAsNormalBlockEntity() {
return true;
}
@ -20,7 +20,7 @@ public class CampfireMovementBehaviour implements MovementBehaviour {
|| !context.state.getValue(CampfireBlock.LIT))
return;
// Mostly copied from CampfireBlock and CampfireTileEntity
// Mostly copied from CampfireBlock and CampfireBlockEntity
Random random = context.world.random;
if (random.nextFloat() < 0.11F) {
for (int i = 0; i < random.nextInt(2) + 2; ++i) {

View file

@ -4,7 +4,7 @@ import com.jozufozu.flywheel.api.Material;
import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.mojang.math.Quaternion;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.actors.flwdata.ActorData;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
@ -39,7 +39,7 @@ public class DrillActorInstance extends ActorInstance {
else
eulerY = facing.toYRot() + ((axis == Direction.Axis.X) ? 180 : 0);
drillHead = material.getModel(AllBlockPartials.DRILL_HEAD, state).createInstance();
drillHead = material.getModel(AllPartialModels.DRILL_HEAD, state).createInstance();
drillHead.setPosition(context.localPos)
.setBlockLight(localBlockLight())

View file

@ -2,10 +2,10 @@ package com.simibubi.create.content.contraptions.components.actors;
import javax.annotation.ParametersAreNonnullByDefault;
import com.simibubi.create.AllBlockEntityTypes;
import com.simibubi.create.AllShapes;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.content.contraptions.base.DirectionalKineticBlock;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.foundation.block.IBE;
import net.minecraft.MethodsReturnNonnullByDefault;
import net.minecraft.core.BlockPos;
@ -36,7 +36,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
public class DrillBlock extends DirectionalKineticBlock implements ITE<DrillTileEntity>, SimpleWaterloggedBlock {
public class DrillBlock extends DirectionalKineticBlock implements IBE<DrillBlockEntity>, SimpleWaterloggedBlock {
public static DamageSource damageSourceDrill = new DamageSource("create.mechanical_drill").bypassArmor();
public DrillBlock(Properties properties) {
@ -51,10 +51,10 @@ public class DrillBlock extends DirectionalKineticBlock implements ITE<DrillTile
if (!new AABB(pos).deflate(.1f)
.intersects(entityIn.getBoundingBox()))
return;
withTileEntityDo(worldIn, pos, te -> {
if (te.getSpeed() == 0)
withBlockEntityDo(worldIn, pos, be -> {
if (be.getSpeed() == 0)
return;
entityIn.hurt(damageSourceDrill, (float) getDamage(te.getSpeed()));
entityIn.hurt(damageSourceDrill, (float) getDamage(be.getSpeed()));
});
}
@ -66,7 +66,7 @@ public class DrillBlock extends DirectionalKineticBlock implements ITE<DrillTile
@Override
public void neighborChanged(BlockState state, Level worldIn, BlockPos pos, Block blockIn, BlockPos fromPos,
boolean isMoving) {
withTileEntityDo(worldIn, pos, DrillTileEntity::destroyNextTick);
withBlockEntityDo(worldIn, pos, DrillBlockEntity::destroyNextTick);
}
@Override
@ -125,12 +125,12 @@ public class DrillBlock extends DirectionalKineticBlock implements ITE<DrillTile
}
@Override
public Class<DrillTileEntity> getTileEntityClass() {
return DrillTileEntity.class;
public Class<DrillBlockEntity> getBlockEntityClass() {
return DrillBlockEntity.class;
}
@Override
public BlockEntityType<? extends DrillTileEntity> getTileEntityType() {
return AllTileEntities.DRILL.get();
public BlockEntityType<? extends DrillBlockEntity> getBlockEntityType() {
return AllBlockEntityTypes.DRILL.get();
}
}

View file

@ -4,9 +4,9 @@ import net.minecraft.core.BlockPos;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockState;
public class DrillTileEntity extends BlockBreakingKineticTileEntity {
public class DrillBlockEntity extends BlockBreakingKineticBlockEntity {
public DrillTileEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
public DrillBlockEntity(BlockEntityType<?> type, BlockPos pos, BlockState state) {
super(type, pos, state);
}

View file

@ -2,8 +2,7 @@ package com.simibubi.create.content.contraptions.components.actors;
import com.jozufozu.flywheel.api.Instancer;
import com.jozufozu.flywheel.api.MaterialManager;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.SingleRotatingInstance;
import com.simibubi.create.content.contraptions.base.flwdata.RotatingData;
@ -11,16 +10,16 @@ import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
public class DrillInstance extends SingleRotatingInstance {
public class DrillInstance extends SingleRotatingInstance<DrillBlockEntity> {
public DrillInstance(MaterialManager modelManager, KineticTileEntity tile) {
super(modelManager, tile);
public DrillInstance(MaterialManager materialManager, DrillBlockEntity blockEntity) {
super(materialManager, blockEntity);
}
@Override
protected Instancer<RotatingData> getModel() {
BlockState referenceState = blockEntity.getBlockState();
Direction facing = referenceState.getValue(BlockStateProperties.FACING);
return getRotatingMaterial().getModel(AllBlockPartials.DRILL_HEAD, referenceState, facing);
return getRotatingMaterial().getModel(AllPartialModels.DRILL_HEAD, referenceState, facing);
}
}

View file

@ -1,9 +1,8 @@
package com.simibubi.create.content.contraptions.components.actors;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.base.KineticBlockEntityRenderer;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionMatrices;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher;
@ -19,21 +18,21 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.Direction;
import net.minecraft.world.level.block.state.BlockState;
public class DrillRenderer extends KineticTileEntityRenderer {
public class DrillRenderer extends KineticBlockEntityRenderer<DrillBlockEntity> {
public DrillRenderer(BlockEntityRendererProvider.Context context) {
super(context);
}
@Override
protected SuperByteBuffer getRotatedModel(KineticTileEntity te, BlockState state) {
return CachedBufferer.partialFacing(AllBlockPartials.DRILL_HEAD, state);
protected SuperByteBuffer getRotatedModel(DrillBlockEntity be, BlockState state) {
return CachedBufferer.partialFacing(AllPartialModels.DRILL_HEAD, state);
}
public static void renderInContraption(MovementContext context, VirtualRenderWorld renderWorld,
ContraptionMatrices matrices, MultiBufferSource buffer) {
BlockState state = context.state;
SuperByteBuffer superBuffer = CachedBufferer.partial(AllBlockPartials.DRILL_HEAD, state);
SuperByteBuffer superBuffer = CachedBufferer.partial(AllPartialModels.DRILL_HEAD, state);
Direction facing = state.getValue(DrillBlock.FACING);
float speed = (float) (context.contraption.stalled

View file

@ -5,7 +5,7 @@ import com.jozufozu.flywheel.api.MaterialManager;
import com.jozufozu.flywheel.core.Materials;
import com.jozufozu.flywheel.core.materials.model.ModelData;
import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld;
import com.simibubi.create.AllBlockPartials;
import com.simibubi.create.AllPartialModels;
import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext;
import com.simibubi.create.content.contraptions.components.structureMovement.render.ActorInstance;
import com.simibubi.create.foundation.utility.AngleHelper;
@ -41,7 +41,7 @@ public class HarvesterActorInstance extends ActorInstance {
facing = state.getValue(BlockStateProperties.HORIZONTAL_FACING);
harvester = material.getModel(AllBlockPartials.HARVESTER_BLADE, state).createInstance();
harvester = material.getModel(AllPartialModels.HARVESTER_BLADE, state).createInstance();
horizontalAngle = facing.toYRot() + ((facing.getAxis() == Direction.Axis.X) ? 180 : 0);

View file

@ -1,24 +1,24 @@
package com.simibubi.create.content.contraptions.components.actors;
import com.simibubi.create.AllTileEntities;
import com.simibubi.create.foundation.block.ITE;
import com.simibubi.create.AllBlockEntityTypes;
import com.simibubi.create.foundation.block.IBE;
import net.minecraft.world.level.block.entity.BlockEntityType;
public class HarvesterBlock extends AttachedActorBlock implements ITE<HarvesterTileEntity> {
public class HarvesterBlock extends AttachedActorBlock implements IBE<HarvesterBlockEntity> {
public HarvesterBlock(Properties p_i48377_1_) {
super(p_i48377_1_);
}
@Override
public Class<HarvesterTileEntity> getTileEntityClass() {
return HarvesterTileEntity.class;
public Class<HarvesterBlockEntity> getBlockEntityClass() {
return HarvesterBlockEntity.class;
}
@Override
public BlockEntityType<? extends HarvesterTileEntity> getTileEntityType() {
return AllTileEntities.HARVESTER.get();
public BlockEntityType<? extends HarvesterBlockEntity> getBlockEntityType() {
return AllBlockEntityTypes.HARVESTER.get();
}
}

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