From d8de624fd16d69ecadd115a0a88d08602af56d47 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Wed, 15 Dec 2021 13:08:15 +0300 Subject: [PATCH] Recipe fixes, replaced spaces with tabs --- README.md | 8 +- bclib.gradle | 30 +- javadoc.css | 884 +++++++++--------- settings.gradle | 14 +- src/main/java/ru/bclib/api/TagAPI.java | 6 +- .../ru/bclib/api/biomes/BCLBiomeBuilder.java | 3 - .../java/ru/bclib/api/biomes/BiomeAPI.java | 4 +- .../api/dataexchange/DataExchangeAPI.java | 18 +- .../bclib/api/dataexchange/SyncFileHash.java | 162 ++-- .../handler/autosync/AutoSync.java | 32 +- .../handler/autosync/HelloClient.java | 36 +- .../handler/autosync/HelloServer.java | 2 +- .../handler/autosync/RequestFiles.java | 2 +- .../handler/autosync/SendFiles.java | 10 +- .../autosync/SyncFolderDescriptor.java | 4 +- .../ru/bclib/api/datafixer/DataFixerAPI.java | 4 +- .../java/ru/bclib/api/datafixer/Patch.java | 26 +- .../bclib/api/surface/SurfaceRuleBuilder.java | 2 +- src/main/java/ru/bclib/blocks/BaseBlock.java | 6 +- .../ru/bclib/blocks/LeveledAnvilBlock.java | 16 +- .../ru/bclib/client/models/OBJBlockModel.java | 2 +- .../ru/bclib/client/models/UnbakedQuad.java | 2 +- .../WoodenComplexMaterial.java | 688 +++++++------- .../java/ru/bclib/config/ClientConfig.java | 82 +- .../java/ru/bclib/config/ConfigKeeper.java | 2 +- .../java/ru/bclib/config/ServerConfig.java | 60 +- .../ru/bclib/gui/gridlayout/GridColumn.java | 104 +-- .../gui/screens/AtomicProgressListener.java | 8 +- .../gui/screens/ConfirmRestartScreen.java | 74 +- .../gui/screens/LevelFixErrorScreen.java | 90 +- .../ru/bclib/gui/screens/ModListScreen.java | 376 ++++---- .../bclib/integration/ModMenuIntegration.java | 14 +- .../interfaces/SurfaceMaterialProvider.java | 6 +- .../java/ru/bclib/interfaces/TriConsumer.java | 2 +- .../ru/bclib/mixin/client/MinecraftMixin.java | 19 - .../mixin/common/MinecraftServerMixin.java | 50 +- .../mixin/common/NetherBiomeDataMixin.java | 8 +- .../common/NoiseGeneratorSettingsMixin.java | 1 - .../common/SurfaceRulesContextAccessor.java | 70 +- .../mixin/common/TheEndBiomeDataMixin.java | 36 +- .../java/ru/bclib/recipes/AnvilRecipe.java | 592 ++++++------ .../java/ru/bclib/recipes/FurnaceRecipe.java | 82 +- .../java/ru/bclib/recipes/GridRecipe.java | 38 +- .../ru/bclib/recipes/SmithingTableRecipe.java | 14 +- src/main/java/ru/bclib/util/BlocksHelper.java | 2 +- src/main/java/ru/bclib/util/PathUtil.java | 10 +- .../java/ru/bclib/util/TranslationHelper.java | 6 +- .../ru/bclib/world/features/BCLFeature.java | 18 +- .../bclib/world/generator/BCLBiomeSource.java | 24 +- .../generator/BCLibNetherBiomeSource.java | 16 +- .../DoubleBlockSurfaceNoiseCondition.java | 40 +- .../resources/assets/bclib/lang/en_us.json | 2 +- .../resources/assets/bclib/lang/ko_kr.json | 2 +- .../shaders/material/alpha_emission.frag | 2 +- .../shaders/core/rendertype_cutout.fsh | 2 +- .../shaders/core/rendertype_entity_cutout.fsh | 2 +- ...endertype_item_entity_translucent_cull.fsh | 2 +- .../shaders/core/rendertype_solid.fsh | 2 +- src/main/resources/bclib.accesswidener | 14 +- src/main/resources/fabric.mod.json | 22 +- 60 files changed, 1910 insertions(+), 1945 deletions(-) diff --git a/README.md b/README.md index 7310d2e9..952ba6d6 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ BCLib is a library mod for BetterX team mods, developed for Fabric, MC 1.18 ## Features: ### Rendering * Emissive textures (with _e suffix) - * Can be applied to Solid and Transparent blocks; - * Can be changed/added with resourcepacks; - * Incompatible with Sodium and Canvas (just will be not rendered); - * Incompatible with Iris shaders (Iris without shaders works fine). + * Can be applied to Solid and Transparent blocks; + * Can be changed/added with resourcepacks; + * Incompatible with Sodium and Canvas (just will be not rendered); + * Incompatible with Iris shaders (Iris without shaders works fine). * Procedural block and item models (from paterns or from code); * Block render interfaces. diff --git a/bclib.gradle b/bclib.gradle index 18f6f51c..48a69fe9 100644 --- a/bclib.gradle +++ b/bclib.gradle @@ -3,9 +3,9 @@ buildscript { classpath 'org.kohsuke:github-api:1.114' } - repositories { - gradlePluginPortal() - } + repositories { + gradlePluginPortal() + } } sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 @@ -15,16 +15,16 @@ version = project.mod_version group = project.maven_group repositories { - maven { url "https://maven.dblsaiko.net/" } - maven { url "https://server.bbkr.space:8081/artifactory/libs-release/" } + maven { url "https://maven.dblsaiko.net/" } + maven { url "https://server.bbkr.space:8081/artifactory/libs-release/" } maven { url "https://maven.fabricmc.net/" } maven { url "https://maven.shedaniel.me/" } - maven { url 'https://maven.blamejared.com' } + maven { url 'https://maven.blamejared.com' } maven { url 'https://jitpack.io' } } loom { - accessWidenerPath = file("src/main/resources/bclib.accesswidener") + accessWidenerPath = file("src/main/resources/bclib.accesswidener") } dependencies { @@ -40,7 +40,7 @@ processResources { println "Version: ${project.mod_version}" inputs.property "version", project.mod_version - filesMatching("fabric.mod.json") { + filesMatching("fabric.mod.json") { expand "version": project.mod_version } } @@ -50,12 +50,12 @@ processResources { // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html tasks.withType(JavaCompile) { options.encoding = "UTF-8" - it.options.release = 17 + it.options.release = 17 } javadoc { options.tags = [ "reason" ] - options.stylesheetFile = new File(projectDir, "javadoc.css"); + options.stylesheetFile = new File(projectDir, "javadoc.css"); } task javadocJar(type: Jar, dependsOn: javadoc) { @@ -134,12 +134,12 @@ publishing { } configurations { - dev { - canBeResolved = false - canBeConsumed = true - } + dev { + canBeResolved = false + canBeConsumed = true + } } artifacts { - dev jar + dev jar } diff --git a/javadoc.css b/javadoc.css index 922bc6bb..e393f777 100644 --- a/javadoc.css +++ b/javadoc.css @@ -12,88 +12,88 @@ */ body { - background-color: #ffffff; - color: #353833; - font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; - font-size: 14px; - margin: 0; - padding: 0; - height: 100%; - width: 100%; + background-color: #ffffff; + color: #353833; + font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; + font-size: 14px; + margin: 0; + padding: 0; + height: 100%; + width: 100%; } iframe { - margin: 0; - padding: 0; - height: 100%; - width: 100%; - overflow-y: scroll; - border: none; + margin: 0; + padding: 0; + height: 100%; + width: 100%; + overflow-y: scroll; + border: none; } a:link, a:visited { - text-decoration: none; - color: #4a6782; + text-decoration: none; + color: #4a6782; } a[href]:hover, a[href]:focus { - text-decoration: none; - color: #bb7a2a; + text-decoration: none; + color: #bb7a2a; } a[name] { - color: #353833; + color: #353833; } pre { - font-family: "DejaVu Sans Mono", monospace; - font-size: 16px; - background-color: #fffadb; - border-radius: 5px; + font-family: "DejaVu Sans Mono", monospace; + font-size: 16px; + background-color: #fffadb; + border-radius: 5px; } h1 { - font-size: 20px; + font-size: 20px; } h2 { - font-size: 18px; + font-size: 18px; } h3 { - font-size: 16px; + font-size: 16px; } h4 { - font-size: 13px; + font-size: 13px; } h5 { - font-size: 12px; + font-size: 12px; } h6 { - font-size: 11px; + font-size: 11px; } ul { - list-style-type: disc; + list-style-type: disc; } code, tt { - font-family: "DejaVu Sans Mono", monospace; - font-size: 14px; - padding-top: 4px; - margin-top: 8px; - line-height: 1.4em; + font-family: "DejaVu Sans Mono", monospace; + font-size: 14px; + padding-top: 4px; + margin-top: 8px; + line-height: 1.4em; } dt code { - font-family: "DejaVu Sans Mono", monospace; - font-size: 14px; - padding-top: 4px; + font-family: "DejaVu Sans Mono", monospace; + font-size: 14px; + padding-top: 4px; } .summary-table dt code { - font-family: "DejaVu Sans Mono", monospace; - font-size: 14px; - vertical-align: top; - padding-top: 4px; + font-family: "DejaVu Sans Mono", monospace; + font-size: 14px; + vertical-align: top; + padding-top: 4px; } sup { - font-size: 8px; + font-size: 8px; } button { - font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; - font-size: 14px; + font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; + font-size: 14px; } /* * Styles for HTML generated by javadoc. @@ -105,155 +105,155 @@ button { * Styles for document title and copyright. */ .clear { - clear: both; - height: 0; - overflow: hidden; + clear: both; + height: 0; + overflow: hidden; } .about-language { - float: right; - padding: 0 21px 8px 8px; - font-size: 11px; - margin-top: -9px; - height: 2.9em; + float: right; + padding: 0 21px 8px 8px; + font-size: 11px; + margin-top: -9px; + height: 2.9em; } .legal-copy { - margin-left: 0.5em; + margin-left: 0.5em; } .tab { - background-color: #0066ff; - color: #ffffff; - padding: 8px; - width: 5em; - font-weight: bold; + background-color: #0066ff; + color: #ffffff; + padding: 8px; + width: 5em; + font-weight: bold; } /* * Styles for navigation bar. */ @media screen { - .flex-box { - position: fixed; - display: flex; - flex-direction: column; - height: 100%; - width: 100%; - } - .flex-header { - flex: 0 0 auto; - } - .flex-content { - flex: 1 1 auto; - overflow-y: auto; - } + .flex-box { + position: fixed; + display: flex; + flex-direction: column; + height: 100%; + width: 100%; + } + .flex-header { + flex: 0 0 auto; + } + .flex-content { + flex: 1 1 auto; + overflow-y: auto; + } } .top-nav { - background-color: #4d7a97; - color: #ffffff; - float: left; - padding: 0; - width: 100%; - clear: right; - min-height: 2.8em; - padding-top: 10px; - overflow: hidden; - font-size: 12px; + background-color: #4d7a97; + color: #ffffff; + float: left; + padding: 0; + width: 100%; + clear: right; + min-height: 2.8em; + padding-top: 10px; + overflow: hidden; + font-size: 12px; } .sub-nav { - background-color: #dee3e9; - float: left; - width: 100%; - overflow: hidden; - font-size: 12px; + background-color: #dee3e9; + float: left; + width: 100%; + overflow: hidden; + font-size: 12px; } .sub-nav div { - clear: left; - float: left; - padding: 0 0 5px 6px; - text-transform: uppercase; + clear: left; + float: left; + padding: 0 0 5px 6px; + text-transform: uppercase; } .sub-nav .nav-list { - padding-top: 5px; + padding-top: 5px; } ul.nav-list { - display: block; - margin: 0 25px 0 0; - padding: 0; + display: block; + margin: 0 25px 0 0; + padding: 0; } ul.sub-nav-list { - float: left; - margin: 0 25px 0 0; - padding: 0; + float: left; + margin: 0 25px 0 0; + padding: 0; } ul.nav-list li { - list-style: none; - float: left; - padding: 5px 6px; - text-transform: uppercase; + list-style: none; + float: left; + padding: 5px 6px; + text-transform: uppercase; } .sub-nav .nav-list-search { - float: right; - margin: 0 0 0 0; - padding: 5px 6px; - clear: none; + float: right; + margin: 0 0 0 0; + padding: 5px 6px; + clear: none; } .nav-list-search label { - position: relative; - right: -16px; + position: relative; + right: -16px; } ul.sub-nav-list li { - list-style: none; - float: left; - padding-top: 10px; + list-style: none; + float: left; + padding-top: 10px; } .top-nav a:link, .top-nav a:active, .top-nav a:visited { - color: #ffffff; - text-decoration: none; - text-transform: uppercase; + color: #ffffff; + text-decoration: none; + text-transform: uppercase; } .top-nav a:hover { - text-decoration: none; - color: #bb7a2a; - text-transform: uppercase; + text-decoration: none; + color: #bb7a2a; + text-transform: uppercase; } .nav-bar-cell1-rev { - background-color: #f8981d; - color: #253441; - margin: auto 5px; + background-color: #f8981d; + color: #253441; + margin: auto 5px; } .skip-nav { - position: absolute; - top: auto; - left: -9999px; - overflow: hidden; + position: absolute; + top: auto; + left: -9999px; + overflow: hidden; } /* * Hide navigation links and search box in print layout */ @media print { - ul.nav-list, - div.sub-nav { - display: none; - } + ul.nav-list, + div.sub-nav { + display: none; + } } /* * Styles for page header and footer. */ .title { - color: #2c4557; - margin: 10px 0; + color: #2c4557; + margin: 10px 0; } .sub-title { - margin: 5px 0 0 0; + margin: 5px 0 0 0; } .header ul { - margin: 0 0 15px 0; - padding: 0; + margin: 0 0 15px 0; + padding: 0; } .header ul li, .footer ul li { - list-style: none; - font-size: 13px; + list-style: none; + font-size: 13px; } /* * Styles for headings. @@ -262,204 +262,204 @@ body.class-declaration-page .summary h2, body.class-declaration-page .details h2, body.class-use-page h2, body.module-declaration-page .block-list h2 { - font-style: italic; - padding: 0; - margin: 15px 0; + font-style: italic; + padding: 0; + margin: 15px 0; } body.class-declaration-page .summary h3, body.class-declaration-page .details h3, body.class-declaration-page .summary .inherited-list h2 { - background-color: #dee3e9; - border: 1px solid #d0d9e0; - margin: 0 0 6px -8px; - padding: 7px 5px; + background-color: #dee3e9; + border: 1px solid #d0d9e0; + margin: 0 0 6px -8px; + padding: 7px 5px; } /* * Styles for page layout containers. */ main { - clear: both; - padding: 10px 20px; - position: relative; + clear: both; + padding: 10px 20px; + position: relative; } dl.notes > dt { - font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; - font-size: 12px; - font-weight: bold; - margin: 10px 0 0 0; - color: #4e4e4e; + font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: bold; + margin: 10px 0 0 0; + color: #4e4e4e; } dl.notes > dd { - margin: 5px 0 10px 0; - font-size: 15px; - font-family: "Roboto", "DejaVu Sans", "Helvetica Neue", Arial, Helvetica, sans-serif; + margin: 5px 0 10px 0; + font-size: 15px; + font-family: "Roboto", "DejaVu Sans", "Helvetica Neue", Arial, Helvetica, sans-serif; } dl.name-value > dt { - margin-left: 1px; - font-size: 1.1em; - display: inline; - font-weight: bold; + margin-left: 1px; + font-size: 1.1em; + display: inline; + font-weight: bold; } dl.name-value > dd { - margin: 0 0 0 1px; - font-size: 1.1em; - display: inline; + margin: 0 0 0 1px; + font-size: 1.1em; + display: inline; } /* * Styles for lists. */ li.circle { - list-style: circle; + list-style: circle; } ul.horizontal li { - display: inline; - font-size: 0.9em; + display: inline; + font-size: 0.9em; } div.inheritance { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } div.inheritance div.inheritance { - margin-left: 2em; + margin-left: 2em; } ul.block-list, ul.details-list, ul.member-list, ul.summary-list { - margin: 10px 0 10px 0; - padding: 0; + margin: 10px 0 10px 0; + padding: 0; } ul.block-list > li, ul.details-list > li, ul.member-list > li, ul.summary-list > li { - list-style: none; - margin-bottom: 15px; - line-height: 1.4; + list-style: none; + margin-bottom: 15px; + line-height: 1.4; } .summary-table dl, .summary-table dl dt, .summary-table dl dd { - margin-top: 0; - margin-bottom: 1px; + margin-top: 0; + margin-bottom: 1px; } /* * Styles for tables. */ .summary-table { - width: 100%; - border-spacing: 0; - border-left: 1px solid #eee; - border-right: 1px solid #eee; - border-bottom: 1px solid #eee; + width: 100%; + border-spacing: 0; + border-left: 1px solid #eee; + border-right: 1px solid #eee; + border-bottom: 1px solid #eee; } .summary-table { - padding: 0; + padding: 0; } .caption { - position: relative; - text-align: left; - background-repeat: no-repeat; - color: #253441; - font-weight: bold; - clear: none; - overflow: hidden; - padding: 0px; - padding-top: 10px; - padding-left: 1px; - margin: 0px; - white-space: pre; + position: relative; + text-align: left; + background-repeat: no-repeat; + color: #253441; + font-weight: bold; + clear: none; + overflow: hidden; + padding: 0px; + padding-top: 10px; + padding-left: 1px; + margin: 0px; + white-space: pre; } .caption a:link, .caption a:visited { - color: #1f389c; + color: #1f389c; } .caption a:hover, .caption a:active { - color: #ffffff; + color: #ffffff; } .caption span { - white-space: nowrap; - padding-top: 5px; - padding-left: 12px; - padding-right: 12px; - padding-bottom: 7px; - display: inline-block; - float: left; - background-color: #f8981d; - border: none; - height: 16px; + white-space: nowrap; + padding-top: 5px; + padding-left: 12px; + padding-right: 12px; + padding-bottom: 7px; + display: inline-block; + float: left; + background-color: #f8981d; + border: none; + height: 16px; } div.table-tabs > button { - border: none; - cursor: pointer; - padding: 5px 12px 7px 12px; - font-weight: bold; - margin-right: 3px; + border: none; + cursor: pointer; + padding: 5px 12px 7px 12px; + font-weight: bold; + margin-right: 3px; } div.table-tabs > button.active-table-tab { - background: #f8981d; - color: #253441; + background: #f8981d; + color: #253441; } div.table-tabs > button.table-tab { - background: #4d7a97; - color: #ffffff; + background: #4d7a97; + color: #ffffff; } .two-column-summary { - display: grid; - grid-template-columns: minmax(15%, max-content) minmax(15%, auto); + display: grid; + grid-template-columns: minmax(15%, max-content) minmax(15%, auto); } .three-column-summary { - display: grid; - grid-template-columns: minmax(10%, max-content) minmax(15%, max-content) minmax(15%, auto); + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(15%, max-content) minmax(15%, auto); } .four-column-summary { - display: grid; - grid-template-columns: minmax(10%, max-content) minmax(10%, max-content) minmax(10%, max-content) minmax(10%, auto); + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(10%, max-content) minmax(10%, max-content) minmax(10%, auto); } @media screen and (max-width: 600px) { - .two-column-summary { - display: grid; - grid-template-columns: 1fr; - } + .two-column-summary { + display: grid; + grid-template-columns: 1fr; + } } @media screen and (max-width: 800px) { - .three-column-summary { - display: grid; - grid-template-columns: minmax(10%, max-content) minmax(25%, auto); - } - .three-column-summary .col-last { - grid-column-end: span 2; - } + .three-column-summary { + display: grid; + grid-template-columns: minmax(10%, max-content) minmax(25%, auto); + } + .three-column-summary .col-last { + grid-column-end: span 2; + } } @media screen and (max-width: 1000px) { - .four-column-summary { - display: grid; - grid-template-columns: minmax(15%, max-content) minmax(15%, auto); - } + .four-column-summary { + display: grid; + grid-template-columns: minmax(15%, max-content) minmax(15%, auto); + } } .summary-table > div { - text-align: left; - padding: 8px 3px 3px 7px; + text-align: left; + padding: 8px 3px 3px 7px; } .col-first, .col-second, .col-last, .col-constructor-name, .col-deprecated-item-name { - vertical-align: top; - padding-right: 0; - padding-top: 8px; - padding-bottom: 3px; + vertical-align: top; + padding-right: 0; + padding-top: 8px; + padding-bottom: 3px; } .table-header { - background: #dee3e9; - font-weight: bold; + background: #dee3e9; + font-weight: bold; } .col-first, .col-first { - font-size: 13px; + font-size: 13px; } .col-second, .col-second, @@ -467,16 +467,16 @@ div.table-tabs > button.table-tab { .col-constructor-name, .col-deprecated-item-name, .col-last { - font-size: 13px; + font-size: 13px; } .col-first, .col-second, .col-constructor-name { - vertical-align: top; - overflow: auto; + vertical-align: top; + overflow: auto; } .col-last { - white-space: normal; + white-space: normal; } .col-first a:link, .col-first a:visited, @@ -496,76 +496,76 @@ div.table-tabs > button.table-tab { .all-classes-container a:visited, .all-packages-container a:link, .all-packages-container a:visited { - font-weight: bold; + font-weight: bold; } .table-sub-heading-color { - background-color: #eeeeff; + background-color: #eeeeff; } .even-row-color, .even-row-color .table-header { - background-color: #ffffff; + background-color: #ffffff; } .odd-row-color, .odd-row-color .table-header { - background-color: #eeeeef; + background-color: #eeeeef; } /* * Styles for contents. */ .deprecated-content { - margin: 0; - padding: 10px 0; + margin: 0; + padding: 10px 0; } div.block { - font-size: 15px; - font-family: "Roboto", "DejaVu Sans", "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: 15px; + font-family: "Roboto", "DejaVu Sans", "Helvetica Neue", Arial, Helvetica, sans-serif; } .col-last div { - padding-top: 0; + padding-top: 0; } .col-last a { - padding-bottom: 3px; + padding-bottom: 3px; } .module-signature, .package-signature, .type-signature, .member-signature { - font-family: "DejaVu Sans Mono", monospace; - font-size: 14px; - margin: 14px 0; - white-space: pre-wrap; + font-family: "DejaVu Sans Mono", monospace; + font-size: 14px; + margin: 14px 0; + white-space: pre-wrap; } .module-signature, .package-signature, .type-signature { - margin-top: 0; + margin-top: 0; } .member-signature .type-parameters-long, .member-signature .parameters, .member-signature .exceptions { - display: inline-block; - vertical-align: top; - white-space: pre; + display: inline-block; + vertical-align: top; + white-space: pre; } .member-signature .type-parameters { - white-space: normal; + white-space: normal; } /* * Styles for formatting effect. */ .source-line-no { - color: green; - padding: 0 30px 0 0; + color: green; + padding: 0 30px 0 0; } h1.hidden { - visibility: hidden; - overflow: hidden; - font-size: 10px; + visibility: hidden; + overflow: hidden; + font-size: 10px; } .block { - display: block; - margin: 0 10px 5px 0; - color: #474747; + display: block; + margin: 0 10px 5px 0; + color: #474747; } .deprecated-label, .descfrm-type-label, @@ -580,28 +580,28 @@ h1.hidden { .type-name-label, .type-name-link, .search-tag-link { - font-weight: bold; + font-weight: bold; } .deprecation-comment, .help-footnote, .interface-name { - font-style: italic; + font-style: italic; } .deprecation-block { - font-size: 14px; - font-family: "DejaVu Serif", Georgia, "Times New Roman", Times, serif; - border-style: solid; - border-width: thin; - border-radius: 10px; - padding: 10px; - margin-bottom: 10px; - margin-right: 10px; - display: inline-block; + font-size: 14px; + font-family: "DejaVu Serif", Georgia, "Times New Roman", Times, serif; + border-style: solid; + border-width: thin; + border-radius: 10px; + padding: 10px; + margin-bottom: 10px; + margin-right: 10px; + display: inline-block; } div.block div.deprecation-comment, div.block div.block span.emphasized-phrase, div.block div.block span.interface-name { - font-style: normal; + font-style: normal; } /* * Styles specific to HTML5 elements. @@ -611,172 +611,172 @@ nav, header, footer, section { - display: block; + display: block; } /* * Styles for javadoc search. */ .ui-autocomplete-category { - font-weight: bold; - font-size: 15px; - padding: 7px 0 7px 3px; - background-color: #4d7a97; - color: #ffffff; + font-weight: bold; + font-size: 15px; + padding: 7px 0 7px 3px; + background-color: #4d7a97; + color: #ffffff; } .result-item { - font-size: 13px; + font-size: 13px; } .ui-autocomplete { - max-height: 85%; - max-width: 65%; - overflow-y: scroll; - overflow-x: scroll; - white-space: nowrap; - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); + max-height: 85%; + max-width: 65%; + overflow-y: scroll; + overflow-x: scroll; + white-space: nowrap; + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23); } ul.ui-autocomplete { - position: fixed; - z-index: 999999; + position: fixed; + z-index: 999999; } ul.ui-autocomplete li { - float: left; - clear: both; - width: 100%; + float: left; + clear: both; + width: 100%; } .result-highlight { - font-weight: bold; + font-weight: bold; } #search { - background-image: url("resources/glass.png"); - background-size: 13px; - background-repeat: no-repeat; - background-position: 2px 3px; - padding-left: 20px; - position: relative; - right: -18px; - width: 400px; + background-image: url("resources/glass.png"); + background-size: 13px; + background-repeat: no-repeat; + background-position: 2px 3px; + padding-left: 20px; + position: relative; + right: -18px; + width: 400px; } #reset { - background-color: rgb(255, 255, 255); - background-image: url("resources/x.png"); - background-position: center; - background-repeat: no-repeat; - background-size: 12px; - border: 0 none; - width: 16px; - height: 16px; - position: relative; - left: -4px; - top: -4px; - font-size: 0px; + background-color: rgb(255, 255, 255); + background-image: url("resources/x.png"); + background-position: center; + background-repeat: no-repeat; + background-size: 12px; + border: 0 none; + width: 16px; + height: 16px; + position: relative; + left: -4px; + top: -4px; + font-size: 0px; } .watermark { - color: #545454; + color: #545454; } .search-tag-desc-result { - font-style: italic; - font-size: 11px; + font-style: italic; + font-size: 11px; } .search-tag-holder-result { - font-style: italic; - font-size: 12px; + font-style: italic; + font-size: 12px; } .search-tag-result:target { - background-color: yellow; + background-color: yellow; } .module-graph span { - display: none; - position: absolute; + display: none; + position: absolute; } .module-graph:hover span { - display: block; - margin: -100px 0 0 100px; - z-index: 1; + display: block; + margin: -100px 0 0 100px; + z-index: 1; } .inherited-list { - margin: 10px 0 10px 0; + margin: 10px 0 10px 0; } section.description { - line-height: 1.4; + line-height: 1.4; } .summary section[class$="-summary"], .details section[class$="-details"], .class-uses .detail, .serialized-class-details { - padding: 0px 20px 5px 10px; - border: 1px solid #ededed; - background-color: #f8f8f8; + padding: 0px 20px 5px 10px; + border: 1px solid #ededed; + background-color: #f8f8f8; } .inherited-list, section[class$="-details"] .detail { - padding: 0 0 5px 8px; - background-color: #ffffff; - border: none; + padding: 0 0 5px 8px; + background-color: #ffffff; + border: none; } .vertical-separator { - padding: 0 5px; + padding: 0 5px; } ul.help-section-list { - margin: 0; + margin: 0; } /* * Indicator icon for external links. */ main a[href*="://"]::after { - content: ""; - display: inline-block; - background-image: url('data:image/svg+xml; utf8, \ - \ - \ - '); - background-size: 100% 100%; - width: 7px; - height: 7px; - margin-left: 2px; - margin-bottom: 4px; + content: ""; + display: inline-block; + background-image: url('data:image/svg+xml; utf8, \ + \ + \ + '); + background-size: 100% 100%; + width: 7px; + height: 7px; + margin-left: 2px; + margin-bottom: 4px; } main a[href*="://"]:hover::after, main a[href*="://"]:focus::after { - background-image: url('data:image/svg+xml; utf8, \ - \ - \ - '); + background-image: url('data:image/svg+xml; utf8, \ + \ + \ + '); } /* * Styles for user-provided tables. * * borderless: - * No borders, vertical margins, styled caption. - * This style is provided for use with existing doc comments. - * In general, borderless tables should not be used for layout purposes. + * No borders, vertical margins, styled caption. + * This style is provided for use with existing doc comments. + * In general, borderless tables should not be used for layout purposes. * * plain: - * Plain borders around table and cells, vertical margins, styled caption. - * Best for small tables or for complex tables for tables with cells that span - * rows and columns, when the "striped" style does not work well. + * Plain borders around table and cells, vertical margins, styled caption. + * Best for small tables or for complex tables for tables with cells that span + * rows and columns, when the "striped" style does not work well. * * striped: - * Borders around the table and vertical borders between cells, striped rows, - * vertical margins, styled caption. - * Best for tables that have a header row, and a body containing a series of simple rows. + * Borders around the table and vertical borders between cells, striped rows, + * vertical margins, styled caption. + * Best for tables that have a header row, and a body containing a series of simple rows. */ table.borderless, table.plain, table.striped { - margin-top: 10px; - margin-bottom: 10px; + margin-top: 10px; + margin-bottom: 10px; } table.borderless > caption, table.plain > caption, table.striped > caption { - font-weight: bold; - font-size: smaller; + font-weight: bold; + font-size: smaller; } table.borderless th, table.borderless td, @@ -784,7 +784,7 @@ table.plain th, table.plain td, table.striped th, table.striped td { - padding: 2px 5px; + padding: 2px 5px; } table.borderless, table.borderless > thead > tr > th, @@ -793,21 +793,21 @@ table.borderless > tr > th, table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td { - border: none; + border: none; } table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr { - background-color: transparent; + background-color: transparent; } table.plain { - border-collapse: collapse; - border: 1px solid black; + border-collapse: collapse; + border: 1px solid black; } table.plain > thead > tr, table.plain > tbody tr, table.plain > tr { - background-color: transparent; + background-color: transparent; } table.plain > thead > tr > th, table.plain > tbody > tr > th, @@ -815,89 +815,89 @@ table.plain > tr > th, table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td { - border: 1px solid black; + border: 1px solid black; } table.striped { - border-collapse: collapse; - border: 1px solid black; + border-collapse: collapse; + border: 1px solid black; } table.striped > thead { - background-color: #e3e3e3; + background-color: #e3e3e3; } table.striped > thead > tr > th, table.striped > thead > tr > td { - border: 1px solid black; + border: 1px solid black; } table.striped > tbody > tr:nth-child(even) { - background-color: #eee; + background-color: #eee; } table.striped > tbody > tr:nth-child(odd) { - background-color: #fff; + background-color: #fff; } table.striped > tbody > tr > th, table.striped > tbody > tr > td { - border-left: 1px solid black; - border-right: 1px solid black; + border-left: 1px solid black; + border-right: 1px solid black; } table.striped > tbody > tr > th { - font-weight: normal; + font-weight: normal; } /** * Tweak font sizes and paddings for small screens. */ @media screen and (max-width: 1050px) { - #search { - width: 300px; - } + #search { + width: 300px; + } } @media screen and (max-width: 800px) { - #search { - width: 200px; - } - .top-nav, - .bottom-nav { - font-size: 11px; - padding-top: 6px; - } - .sub-nav { - font-size: 11px; - } - .about-language { - padding-right: 16px; - } - ul.nav-list li, - .sub-nav .nav-list-search { - padding: 6px; - } - ul.sub-nav-list li { - padding-top: 5px; - } - main { - padding: 10px; - } - .summary section[class$="-summary"], - .details section[class$="-details"], - .class-uses .detail, - .serialized-class-details { - padding: 0 8px 5px 8px; - } - body { - -webkit-text-size-adjust: none; - } + #search { + width: 200px; + } + .top-nav, + .bottom-nav { + font-size: 11px; + padding-top: 6px; + } + .sub-nav { + font-size: 11px; + } + .about-language { + padding-right: 16px; + } + ul.nav-list li, + .sub-nav .nav-list-search { + padding: 6px; + } + ul.sub-nav-list li { + padding-top: 5px; + } + main { + padding: 10px; + } + .summary section[class$="-summary"], + .details section[class$="-details"], + .class-uses .detail, + .serialized-class-details { + padding: 0 8px 5px 8px; + } + body { + -webkit-text-size-adjust: none; + } } @media screen and (max-width: 500px) { - #search { - width: 150px; - } - .top-nav, - .bottom-nav { - font-size: 10px; - } - .sub-nav { - font-size: 10px; - } - .about-language { - font-size: 10px; - padding-right: 12px; - } + #search { + width: 150px; + } + .top-nav, + .bottom-nav { + font-size: 10px; + } + .sub-nav { + font-size: 10px; + } + .about-language { + font-size: 10px; + padding-right: 12px; + } } diff --git a/settings.gradle b/settings.gradle index f91a4fe7..027b233d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,9 @@ pluginManagement { - repositories { - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - gradlePluginPortal() - } + repositories { + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net/' + } + gradlePluginPortal() + } } diff --git a/src/main/java/ru/bclib/api/TagAPI.java b/src/main/java/ru/bclib/api/TagAPI.java index a9948037..b1a555bf 100644 --- a/src/main/java/ru/bclib/api/TagAPI.java +++ b/src/main/java/ru/bclib/api/TagAPI.java @@ -72,7 +72,7 @@ public class TagAPI { * Get or create {@link Tag.Named}. * * @param containerSupplier - {@link TagCollection} {@link Supplier} tag collection; - * @param id - {@link ResourceLocation} tag id. + * @param id - {@link ResourceLocation} tag id. * @return {@link Tag.Named}. */ public static Tag.Named makeTag(Supplier> containerSupplier, ResourceLocation id) { @@ -194,7 +194,7 @@ public static void init() { * The call will reserve the Tag. The Tag is added to the blocks once * {@link #apply(String, Map)} was executed. * - * @param tag The new Tag + * @param tag The new Tag * @param blocks One or more blocks that should receive the Tag. */ public static void addTag(Tag.Named tag, Block... blocks) { @@ -282,7 +282,7 @@ public static Tag.Builder apply(Tag.Builder builder, Set ids) * In most cases there is no need to call this Method manually. * * @param directory The name of the Tag-directory. Should be either "tags/blocks" or - * "tags/items". + * "tags/items". * @param tagsMap The map that will hold the registered Tags * @return The {@code tagsMap} Parameter. */ diff --git a/src/main/java/ru/bclib/api/biomes/BCLBiomeBuilder.java b/src/main/java/ru/bclib/api/biomes/BCLBiomeBuilder.java index 261f26cc..2c189a21 100644 --- a/src/main/java/ru/bclib/api/biomes/BCLBiomeBuilder.java +++ b/src/main/java/ru/bclib/api/biomes/BCLBiomeBuilder.java @@ -27,8 +27,6 @@ import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.Noises; import net.minecraft.world.level.levelgen.SurfaceRules; -import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource; -import net.minecraft.world.level.levelgen.SurfaceRules.SequenceRuleSource; import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver; import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; import net.minecraft.world.level.levelgen.placement.PlacedFeature; @@ -38,7 +36,6 @@ import ru.bclib.world.biomes.BCLBiome; import ru.bclib.world.features.BCLFeature; import ru.bclib.world.structures.BCLStructureFeature; -import ru.bclib.world.surface.DoubleBlockSurfaceNoiseCondition; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/ru/bclib/api/biomes/BiomeAPI.java b/src/main/java/ru/bclib/api/biomes/BiomeAPI.java index 6abaa2b0..839dbe78 100644 --- a/src/main/java/ru/bclib/api/biomes/BiomeAPI.java +++ b/src/main/java/ru/bclib/api/biomes/BiomeAPI.java @@ -35,7 +35,6 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.chunk.ChunkGenerator; -import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.levelgen.GenerationStep.Carving; import net.minecraft.world.level.levelgen.GenerationStep.Decoration; import net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator; @@ -68,7 +67,6 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -182,7 +180,7 @@ public static BCLBiome registerNetherBiome(BCLBiome biome) { Random random = new Random(biome.getID().hashCode()); //temperature, humidity, continentalness, erosion, depth, weirdness, offset - Climate.ParameterPoint parameters = Climate.parameters( + Climate.ParameterPoint parameters = Climate.parameters( MHelper.randRange(-1.5F, 1.5F, random), MHelper.randRange(-1.5F, 1.5F, random), MHelper.randRange(-1.5F, 1.5F, random), //new in 1.18 diff --git a/src/main/java/ru/bclib/api/dataexchange/DataExchangeAPI.java b/src/main/java/ru/bclib/api/dataexchange/DataExchangeAPI.java index 4a22c6db..868223c5 100644 --- a/src/main/java/ru/bclib/api/dataexchange/DataExchangeAPI.java +++ b/src/main/java/ru/bclib/api/dataexchange/DataExchangeAPI.java @@ -111,7 +111,7 @@ public static void send(BaseDataHandler h) { /** * Registers a File for automatic client syncing. * - * @param modID The ID of the calling Mod + * @param modID The ID of the calling Mod * @param fileName The name of the File */ public static void addAutoSyncFile(String modID, File fileName) { @@ -124,9 +124,9 @@ public static void addAutoSyncFile(String modID, File fileName) { * The file is synced of the {@link SyncFileHash} on client and server are not equal. This method will not copy the * configs content from the client to the server. * - * @param modID The ID of the calling Mod + * @param modID The ID of the calling Mod * @param uniqueID A unique Identifier for the File. (see {@link SyncFileHash#uniqueID} for - * Details + * Details * @param fileName The name of the File */ public static void addAutoSyncFile(String modID, String uniqueID, File fileName) { @@ -143,8 +143,8 @@ public static void addAutoSyncFile(String modID, String uniqueID, File fileName) * if the File needs to be copied. Normally using the {@link SyncFileHash} * for comparison is sufficient. * - * @param modID The ID of the calling Mod - * @param fileName The name of the File + * @param modID The ID of the calling Mod + * @param fileName The name of the File * @param needTransfer If the predicate returns true, the file needs to get copied to the server. */ public static void addAutoSyncFile(String modID, File fileName, NeedTransferPredicate needTransfer) { @@ -161,10 +161,10 @@ public static void addAutoSyncFile(String modID, File fileName, NeedTransferPred * if the File needs to be copied. Normally using the {@link SyncFileHash} * for comparison is sufficient. * - * @param modID The ID of the calling Mod - * @param uniqueID A unique Identifier for the File. (see {@link SyncFileHash#uniqueID} for - * Details - * @param fileName The name of the File + * @param modID The ID of the calling Mod + * @param uniqueID A unique Identifier for the File. (see {@link SyncFileHash#uniqueID} for + * Details + * @param fileName The name of the File * @param needTransfer If the predicate returns true, the file needs to get copied to the server. */ public static void addAutoSyncFile(String modID, String uniqueID, File fileName, NeedTransferPredicate needTransfer) { diff --git a/src/main/java/ru/bclib/api/dataexchange/SyncFileHash.java b/src/main/java/ru/bclib/api/dataexchange/SyncFileHash.java index 81a3c853..d8bc1e6a 100644 --- a/src/main/java/ru/bclib/api/dataexchange/SyncFileHash.java +++ b/src/main/java/ru/bclib/api/dataexchange/SyncFileHash.java @@ -16,93 +16,93 @@ * identical. */ public class SyncFileHash extends AutoSyncID { - public final FileHash hash; + public final FileHash hash; - SyncFileHash(String modID, File file, byte[] md5, int size, int value) { - this(modID, file.getName(), md5, size, value); - } + SyncFileHash(String modID, File file, byte[] md5, int size, int value) { + this(modID, file.getName(), md5, size, value); + } - SyncFileHash(String modID, String uniqueID, byte[] md5, int size, int value) { - this(modID, uniqueID, new FileHash(md5, size, value)); - } - - SyncFileHash(String modID, File file, FileHash hash) { - this(modID, file.getName(), hash); - } - - SyncFileHash(String modID, String uniqueID, FileHash hash) { - super(modID, uniqueID); - this.hash = hash; - } + SyncFileHash(String modID, String uniqueID, byte[] md5, int size, int value) { + this(modID, uniqueID, new FileHash(md5, size, value)); + } + + SyncFileHash(String modID, File file, FileHash hash) { + this(modID, file.getName(), hash); + } + + SyncFileHash(String modID, String uniqueID, FileHash hash) { + super(modID, uniqueID); + this.hash = hash; + } - final static NeedTransferPredicate NEED_TRANSFER = (clientHash, serverHash, content)-> !clientHash.equals(serverHash); - - @Override - public String toString() { - return super.toString()+": "+hash.toString(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof SyncFileHash)) return false; - if (!super.equals(o)) return false; - SyncFileHash that = (SyncFileHash) o; - return hash.equals(that.hash); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), hash); - } - - /** - * Serializes the Object to a buffer - * @param buf The buffer to write to - */ - public void serialize(FriendlyByteBuf buf) { - hash.serialize(buf); - DataHandler.writeString(buf, modID); - DataHandler.writeString(buf, uniqueID); - } + final static NeedTransferPredicate NEED_TRANSFER = (clientHash, serverHash, content)-> !clientHash.equals(serverHash); + + @Override + public String toString() { + return super.toString()+": "+hash.toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof SyncFileHash)) return false; + if (!super.equals(o)) return false; + SyncFileHash that = (SyncFileHash) o; + return hash.equals(that.hash); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), hash); + } + + /** + * Serializes the Object to a buffer + * @param buf The buffer to write to + */ + public void serialize(FriendlyByteBuf buf) { + hash.serialize(buf); + DataHandler.writeString(buf, modID); + DataHandler.writeString(buf, uniqueID); + } - /** - *Deserialize a Buffer to a new {@link SyncFileHash}-Object - * @param buf Thea buffer to read from - * @return The received String - */ - public static SyncFileHash deserialize(FriendlyByteBuf buf){ - final FileHash hash = FileHash.deserialize(buf); - final String modID = DataHandler.readString(buf); - final String uniqueID = DataHandler.readString(buf); + /** + *Deserialize a Buffer to a new {@link SyncFileHash}-Object + * @param buf Thea buffer to read from + * @return The received String + */ + public static SyncFileHash deserialize(FriendlyByteBuf buf){ + final FileHash hash = FileHash.deserialize(buf); + final String modID = DataHandler.readString(buf); + final String uniqueID = DataHandler.readString(buf); - return new SyncFileHash(modID, uniqueID, hash); - } + return new SyncFileHash(modID, uniqueID, hash); + } - /** - * Create a new {@link SyncFileHash}. - *

- * Will call {@link #create(String, File, String)} using the name of the File as {@code uniqueID}. - * @param modID ID of the calling Mod - * @param file The input file - * - * @return A new Instance. You can compare instances using {@link #equals(Object)} to determine if two files are - * identical. Will return {@code null} when an error occurs or the File does not exist - */ - public static SyncFileHash create(String modID, File file){ - return create(modID, file, file.getName()); - } + /** + * Create a new {@link SyncFileHash}. + *

+ * Will call {@link #create(String, File, String)} using the name of the File as {@code uniqueID}. + * @param modID ID of the calling Mod + * @param file The input file + * + * @return A new Instance. You can compare instances using {@link #equals(Object)} to determine if two files are + * identical. Will return {@code null} when an error occurs or the File does not exist + */ + public static SyncFileHash create(String modID, File file){ + return create(modID, file, file.getName()); + } - /** - * Create a new {@link SyncFileHash}. - * @param modID ID of the calling Mod - * @param file The input file - * @param uniqueID The unique ID that is used for this File (see {@link SyncFileHash#uniqueID} for Details. - * @return A new Instance. You can compare instances using {@link #equals(Object)} to determine if two files are - * identical. Will return {@code null} when an error occurs or the File does not exist - */ - public static SyncFileHash create(String modID, File file, String uniqueID){ - return new SyncFileHash(modID, uniqueID, FileHash.create(file)); - } + /** + * Create a new {@link SyncFileHash}. + * @param modID ID of the calling Mod + * @param file The input file + * @param uniqueID The unique ID that is used for this File (see {@link SyncFileHash#uniqueID} for Details. + * @return A new Instance. You can compare instances using {@link #equals(Object)} to determine if two files are + * identical. Will return {@code null} when an error occurs or the File does not exist + */ + public static SyncFileHash create(String modID, File file, String uniqueID){ + return new SyncFileHash(modID, uniqueID, FileHash.create(file)); + } } diff --git a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java index 89a33463..eace188d 100644 --- a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java +++ b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/AutoSync.java @@ -68,15 +68,15 @@ public static List getAutoSyncFiles() { /** * Registers a File for automatic client syncing. * - * @param modID The ID of the calling Mod + * @param modID The ID of the calling Mod * @param needTransfer If the predicate returns true, the file needs to get copied to the server. - * @param fileName The name of the File + * @param fileName The name of the File * @param requestContent When {@code true} the content of the file is requested for comparison. This will copy the - * entire file from the client to the server. - *

- * You should only use this option, if you need to compare parts of the file in order to decide - * If the File needs to be copied. Normally using the {@link SyncFileHash} - * for comparison is sufficient. + * entire file from the client to the server. + *

+ * You should only use this option, if you need to compare parts of the file in order to decide + * If the File needs to be copied. Normally using the {@link SyncFileHash} + * for comparison is sufficient. */ public static void addAutoSyncFileData(String modID, File fileName, boolean requestContent, NeedTransferPredicate needTransfer) { if (!PathUtil.isChildOf(PathUtil.GAME_FOLDER, fileName.toPath())){ @@ -89,17 +89,17 @@ public static void addAutoSyncFileData(String modID, File fileName, boolean requ /** * Registers a File for automatic client syncing. * - * @param modID The ID of the calling Mod - * @param uniqueID A unique Identifier for the File. (see {@link SyncFileHash#uniqueID} for - * Details + * @param modID The ID of the calling Mod + * @param uniqueID A unique Identifier for the File. (see {@link SyncFileHash#uniqueID} for + * Details * @param needTransfer If the predicate returns true, the file needs to get copied to the server. - * @param fileName The name of the File + * @param fileName The name of the File * @param requestContent When {@code true} the content of the file is requested for comparison. This will copy the - * entire file from the client to the server. - *

- * You should only use this option, if you need to compare parts of the file in order to decide - * If the File needs to be copied. Normally using the {@link SyncFileHash} - * for comparison is sufficient. + * entire file from the client to the server. + *

+ * You should only use this option, if you need to compare parts of the file in order to decide + * If the File needs to be copied. Normally using the {@link SyncFileHash} + * for comparison is sufficient. */ public static void addAutoSyncFileData(String modID, String uniqueID, File fileName, boolean requestContent, NeedTransferPredicate needTransfer) { if (!PathUtil.isChildOf(PathUtil.GAME_FOLDER, fileName.toPath())){ diff --git a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloClient.java b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloClient.java index 206735d4..9c693c2d 100644 --- a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloClient.java +++ b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloClient.java @@ -120,7 +120,7 @@ protected void serializeDataOnServer(FriendlyByteBuf buf) { final boolean canDownload = size>0 && Configs.SERVER_CONFIG.isOfferingMods() && (Configs.SERVER_CONFIG.isOfferingAllMods() || inmods.contains(modID)); buf.writeBoolean(canDownload); - BCLib.LOGGER.info(" - Listing Mod " + modID + " v" + ver + " (size: " + PathUtil.humanReadableFileSize(size) + ", download="+canDownload+")"); + BCLib.LOGGER.info(" - Listing Mod " + modID + " v" + ver + " (size: " + PathUtil.humanReadableFileSize(size) + ", download="+canDownload+")"); } } else { @@ -140,7 +140,7 @@ protected void serializeDataOnServer(FriendlyByteBuf buf) { buf.writeInt(existingAutoSyncFiles.size()); for (AutoFileSyncEntry entry : existingAutoSyncFiles) { entry.serialize(buf); - BCLib.LOGGER.info(" - Offering " + (entry.isConfigFile() ? "Config " : "File ") + entry); + BCLib.LOGGER.info(" - Offering " + (entry.isConfigFile() ? "Config " : "File ") + entry); } } else { @@ -151,7 +151,7 @@ protected void serializeDataOnServer(FriendlyByteBuf buf) { if (Configs.SERVER_CONFIG.isOfferingFiles()) { buf.writeInt(AutoSync.syncFolderDescriptions.size()); AutoSync.syncFolderDescriptions.forEach(desc -> { - BCLib.LOGGER.info(" - Offering Folder " + desc.localFolder + " (allowDelete=" + desc.removeAdditionalFiles + ")"); + BCLib.LOGGER.info(" - Offering Folder " + desc.localFolder + " (allowDelete=" + desc.removeAdditionalFiles + ")"); desc.serialize(buf); }); } @@ -238,13 +238,13 @@ private void processAutoSyncFolder(final List filesToRequest, final //desc contains the fileCache sent from the server, load the local version to get hold of the actual file cache on the client SyncFolderDescriptor localDescriptor = AutoSync.getSyncFolderDescriptor(desc.folderID); if (localDescriptor != null) { - BCLib.LOGGER.info(" - " + desc.folderID + " (" + desc.localFolder + ", allowRemove=" + desc.removeAdditionalFiles + ")"); + BCLib.LOGGER.info(" - " + desc.folderID + " (" + desc.localFolder + ", allowRemove=" + desc.removeAdditionalFiles + ")"); localDescriptor.invalidateCache(); desc.relativeFilesStream() .filter(desc::discardChildElements) .forEach(subFile -> { - BCLib.LOGGER.warning(" * " + subFile.relPath + " (REJECTED)"); + BCLib.LOGGER.warning(" * " + subFile.relPath + " (REJECTED)"); }); @@ -256,7 +256,7 @@ private void processAutoSyncFolder(final List filesToRequest, final .map(absPath -> new AutoSyncID.ForDirectFileRequest(desc.folderID, absPath.toFile())) .collect(Collectors.toList()); - additionalFiles.forEach(aid -> BCLib.LOGGER.info(" * " + desc.localFolder.relativize(aid.relFile.toPath()) + " (missing on server)")); + additionalFiles.forEach(aid -> BCLib.LOGGER.info(" * " + desc.localFolder.relativize(aid.relFile.toPath()) + " (missing on server)")); filesToRemove.addAll(additionalFiles); } @@ -267,16 +267,16 @@ private void processAutoSyncFolder(final List filesToRequest, final if (localSubFile != null) { //the file exists locally, check if the hashes match if (!localSubFile.hash.equals(subFile.hash)) { - BCLib.LOGGER.info(" * " + subFile.relPath + " (changed)"); + BCLib.LOGGER.info(" * " + subFile.relPath + " (changed)"); filesToRequest.add(new AutoSyncID.ForDirectFileRequest(desc.folderID, new File(subFile.relPath))); } else { - BCLib.LOGGER.info(" * " + subFile.relPath); + BCLib.LOGGER.info(" * " + subFile.relPath); } } else { //the file is missing locally - BCLib.LOGGER.info(" * " + subFile.relPath + " (missing on client)"); + BCLib.LOGGER.info(" * " + subFile.relPath + " (missing on client)"); filesToRequest.add(new AutoSyncID.ForDirectFileRequest(desc.folderID, new File(subFile.relPath))); } }); @@ -285,7 +285,7 @@ private void processAutoSyncFolder(final List filesToRequest, final localDescriptor.invalidateCache(); } else { - BCLib.LOGGER.info(" - " + desc.folderID + " (Failed to find)"); + BCLib.LOGGER.info(" - " + desc.folderID + " (Failed to find)"); } }); } @@ -320,11 +320,11 @@ else if (e.localMatch.needTransfer.test(e.localMatch.getFileHash(), e.serverHash } } - BCLib.LOGGER.info(" - " + e + ": " + actionString); + BCLib.LOGGER.info(" - " + e + ": " + actionString); if (debugHashes) { - BCLib.LOGGER.info(" * " + e.serverHash + " (Server)"); - BCLib.LOGGER.info(" * " + e.localMatch.getFileHash() + " (Client)"); - BCLib.LOGGER.info(" * local Content " + (contentWrapper.getRawContent() == null)); + BCLib.LOGGER.info(" * " + e.serverHash + " (Server)"); + BCLib.LOGGER.info(" * " + e.localMatch.getFileHash() + " (Client)"); + BCLib.LOGGER.info(" * local Content " + (contentWrapper.getRawContent() == null)); } } } @@ -337,7 +337,7 @@ private void processModFileSync(final List filesToRequest, final Set final OfferedModInfo serverInfo = e.getValue(); final boolean requestMod = !serverInfo.version.equals(localVersion) && serverInfo.size > 0 && serverInfo.canDownload; - BCLib.LOGGER.info(" - " + e.getKey() + " (client=" + localVersion + ", server=" + serverInfo.version + ", size=" + PathUtil.humanReadableFileSize(serverInfo.size) + (requestMod ? ", requesting" : "") + (serverInfo.canDownload ? "" :", not offered")+ ")"); + BCLib.LOGGER.info(" - " + e.getKey() + " (client=" + localVersion + ", server=" + serverInfo.version + ", size=" + PathUtil.humanReadableFileSize(serverInfo.size) + (requestMod ? ", requesting" : "") + (serverInfo.canDownload ? "" :", not offered")+ ")"); if (requestMod) { filesToRequest.add(new AutoSyncID.ForModFileRequest(e.getKey(), serverInfo.version)); } @@ -451,7 +451,7 @@ else if (downloadFiles) { } if (removeFiles) { filesToRemove.forEach(aid -> { - BCLib.LOGGER.info(" - " + aid.relFile + " (removing)"); + BCLib.LOGGER.info(" - " + aid.relFile + " (removing)"); aid.relFile.delete(); }); } @@ -469,13 +469,13 @@ private void onCloseSyncFilesScreen(){ private void processOfferedFile(List requestFiles, AutoSyncID aid) { if (aid instanceof WithContentOverride) { final WithContentOverride aidc = (WithContentOverride) aid; - BCLib.LOGGER.info(" - " + aid + " (updating Content)"); + BCLib.LOGGER.info(" - " + aid + " (updating Content)"); SendFiles.writeSyncedFile(aid, aidc.contentWrapper.getRawContent(), aidc.localFile); } else { requestFiles.add(aid); - BCLib.LOGGER.info(" - " + aid + " (requesting)"); + BCLib.LOGGER.info(" - " + aid + " (requesting)"); } } diff --git a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloServer.java b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloServer.java index 300f8ba6..bf58db93 100644 --- a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloServer.java +++ b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/HelloServer.java @@ -19,7 +19,7 @@ * This message is sent once a player enters the world. It initiates a sequence of Messages that will sync files between both * client and server. * - * + * * * * diff --git a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/RequestFiles.java b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/RequestFiles.java index 6e69dd8a..089a6372 100644 --- a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/RequestFiles.java +++ b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/RequestFiles.java @@ -66,7 +66,7 @@ protected void deserializeIncomingDataOnServer(FriendlyByteBuf buf, PacketSender for (int i = 0; i < size; i++) { AutoSyncID asid = AutoSyncID.deserializeData(buf); files.add(asid); - BCLib.LOGGER.info(" - " + asid); + BCLib.LOGGER.info(" - " + asid); } diff --git a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SendFiles.java b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SendFiles.java index 2b3e419a..ef52b214 100644 --- a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SendFiles.java +++ b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SendFiles.java @@ -74,7 +74,7 @@ protected void serializeDataOnServer(FriendlyByteBuf buf) { BCLib.LOGGER.info("Sending " + existingFiles.size() + " Files to Client:"); for (AutoFileSyncEntry entry : existingFiles) { int length = entry.serializeContent(buf); - BCLib.LOGGER.info(" - " + entry + " (" + PathUtil.humanReadableFileSize(length) + ")"); + BCLib.LOGGER.info(" - " + entry + " (" + PathUtil.humanReadableFileSize(length) + ")"); } } @@ -112,7 +112,7 @@ protected void deserializeIncomingDataOnClient(FriendlyByteBuf buf, PacketSender } else { type = "Ignoring "; } - BCLib.LOGGER.info(" - " + type + p.first + " (" + PathUtil.humanReadableFileSize(p.second.length) + ")"); + BCLib.LOGGER.info(" - " + type + p.first + " (" + PathUtil.humanReadableFileSize(p.second.length) + ")"); } else { BCLib.LOGGER.error(" - Failed to receive File " + p.third + ", possibly sent from a Mod that is not installed on the client."); @@ -173,7 +173,7 @@ static void writeSyncedFile(AutoSyncID e, byte[] data, File fileName) { } while (path.toFile().exists()); } - BCLib.LOGGER.info(" - Writing " + path + " (" + PathUtil.humanReadableFileSize(data.length) + ")"); + BCLib.LOGGER.info(" - Writing " + path + " (" + PathUtil.humanReadableFileSize(data.length) + ")"); try { final File parentFile = path.getParent() .toFile(); @@ -192,7 +192,7 @@ static void writeSyncedFile(AutoSyncID e, byte[] data, File fileName) { collisionFreeName = String.format("%03d", count) + "_" + bakFileName; } while (targetPath.toFile().exists()); - BCLib.LOGGER.info(" - Moving " + removeAfter + " to " +targetPath); + BCLib.LOGGER.info(" - Moving " + removeAfter + " to " +targetPath); removeAfter.toFile().renameTo(targetPath.toFile()); } AutoSync.didReceiveFile(e, fileName); @@ -200,7 +200,7 @@ static void writeSyncedFile(AutoSyncID e, byte[] data, File fileName) { } catch (IOException ioException) { - BCLib.LOGGER.error(" --> Writing " + fileName + " failed: " + ioException); + BCLib.LOGGER.error(" --> Writing " + fileName + " failed: " + ioException); } } diff --git a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SyncFolderDescriptor.java b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SyncFolderDescriptor.java index bba41d5e..71836a8c 100644 --- a/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SyncFolderDescriptor.java +++ b/src/main/java/ru/bclib/api/dataexchange/handler/autosync/SyncFolderDescriptor.java @@ -124,9 +124,9 @@ public void serialize(FriendlyByteBuf buf) { buf.writeBoolean(removeAdditionalFiles); buf.writeInt(fileCache.size()); fileCache.forEach(fl -> { - BCLib.LOGGER.info(" - " + fl.relPath); + BCLib.LOGGER.info(" - " + fl.relPath); if (debugHashes) { - BCLib.LOGGER.info(" " + fl.hash); + BCLib.LOGGER.info(" " + fl.hash); } fl.serialize(buf); }); diff --git a/src/main/java/ru/bclib/api/datafixer/DataFixerAPI.java b/src/main/java/ru/bclib/api/datafixer/DataFixerAPI.java index c6f23694..53252da6 100644 --- a/src/main/java/ru/bclib/api/datafixer/DataFixerAPI.java +++ b/src/main/java/ru/bclib/api/datafixer/DataFixerAPI.java @@ -108,7 +108,7 @@ private static boolean wrapCall(LevelStorageSource levelSource, String levelID, * {@code Minecraft.getInstance().getLevelSource()} * @param levelID The ID of the Level you want to patch * @param showUI {@code true}, if you want to present the user with a Screen that offers to backup the world - * before applying the patches + * before applying the patches * @param onResume When this method retursn {@code true}, this function will be called when the world is ready * @return {@code true} if the UI was displayed. The UI is only displayed if {@code showUI} was {@code true} and * patches were enabled in the config and the Guardian did find any patches that need to be applied to the world. @@ -123,7 +123,7 @@ public static boolean fixData(LevelStorageSource levelSource, String levelID, bo * * @param levelStorageAccess The access class of the level you want to patch * @param showUI {@code true}, if you want to present the user with a Screen that offers to backup the world - * before applying the patches + * before applying the patches * @param onResume When this method retursn {@code true}, this function will be called when the world is ready * @return {@code true} if the UI was displayed. The UI is only displayed if {@code showUI} was {@code true} and * patches were enabled in the config and the Guardian did find any patches that need to be applied to the world. diff --git a/src/main/java/ru/bclib/api/datafixer/Patch.java b/src/main/java/ru/bclib/api/datafixer/Patch.java index 4fcb48be..248b406a 100644 --- a/src/main/java/ru/bclib/api/datafixer/Patch.java +++ b/src/main/java/ru/bclib/api/datafixer/Patch.java @@ -70,12 +70,12 @@ public static int maxPatchLevel(@NotNull String modID) { * inconsistencies are found. * * @param modID The ID of the Mod you want to register a patch for. This should be your - * ModID only. The ModID can not be {@code null} or an empty String. + * ModID only. The ModID can not be {@code null} or an empty String. * @param version The mod-version that introduces the patch. This needs Semantic-Version String - * like x.x.x. Developers are responsible for registering their patches in the correct - * order (with increasing versions). You are not allowed to register a new - * Patch with a version lower or equal than - * {@link Patch#maxPatchVersion(String)} + * like x.x.x. Developers are responsible for registering their patches in the correct + * order (with increasing versions). You are not allowed to register a new + * Patch with a version lower or equal than + * {@link Patch#maxPatchVersion(String)} */ protected Patch(@NotNull String modID, String version) { this(modID, version, false); @@ -85,10 +85,10 @@ protected Patch(@NotNull String modID, String version) { * Internal Constructor used to create patches that can allways run (no matter what patchlevel a level has) * @param modID The ID of the Mod * @param version The mod-version that introduces the patch. When {@Code runAllways} is set, this version will - * determine the patchlevel that is written to the level + * determine the patchlevel that is written to the level * @param alwaysApply When true, this patch is always active, no matter the patchlevel of the world. - * This should be used sparingly and just for patches that apply to level.dat (as they only take - * effect when changes are detected). Use {@link ForcedLevelPatch} to instatiate. + * This should be used sparingly and just for patches that apply to level.dat (as they only take + * effect when changes are detected). Use {@link ForcedLevelPatch} to instatiate. */ Patch(@NotNull String modID, String version, boolean alwaysApply) { //Patchlevels need to be unique and registered in ascending order @@ -201,11 +201,11 @@ static MigrationProfile createMigrationData() { * a {@link CompoundTag}. If the Path contains a non-leaf {@link net.minecraft.nbt.ListTag}, all members of that * list will be processed. For example: *
-	 *     - global +
-	 *              | - key (String)
-	 *              | - items (List) +
-	 *                               | - { id (String) }
-	 *                               | - { id (String) }
+	 *	 - global +
+	 *			  | - key (String)
+	 *			  | - items (List) +
+	 *							   | - { id (String) }
+	 *							   | - { id (String) }
 	 * 
* The path global.items.id will fix all id-entries in the items-list, while the path * global.key will only fix the key-entry. diff --git a/src/main/java/ru/bclib/api/surface/SurfaceRuleBuilder.java b/src/main/java/ru/bclib/api/surface/SurfaceRuleBuilder.java index eb832e39..641b73aa 100644 --- a/src/main/java/ru/bclib/api/surface/SurfaceRuleBuilder.java +++ b/src/main/java/ru/bclib/api/surface/SurfaceRuleBuilder.java @@ -221,7 +221,7 @@ public SurfaceRuleBuilder chancedFloor(BlockState surfaceBlockA, BlockState surf /** * Set biome floor with specified {@link BlockState} and the given Noise Function. The rule is added with priority 3. * @param surfaceBlockA {@link BlockState} for the ground cover. - * @param surfaceBlockB {@link BlockState} for the alternative ground cover. + * @param surfaceBlockB {@link BlockState} for the alternative ground cover. * @param noise The {@link NoiseCondition} * @return same {@link SurfaceRuleBuilder} instance. */ diff --git a/src/main/java/ru/bclib/blocks/BaseBlock.java b/src/main/java/ru/bclib/blocks/BaseBlock.java index 7dd51813..a8776744 100644 --- a/src/main/java/ru/bclib/blocks/BaseBlock.java +++ b/src/main/java/ru/bclib/blocks/BaseBlock.java @@ -19,8 +19,8 @@ *

* This Block-Type will: *

    - *
  • Drop itself
  • - *
  • Automatically create an Item-Model from the Block-Model
  • + *
  • Drop itself
  • + *
  • Automatically create an Item-Model from the Block-Model
  • *
*/ public class BaseBlock extends Block implements BlockModelProvider { @@ -63,7 +63,7 @@ public BlockModel getItemModel(ResourceLocation blockId) { * For example in {@link BaseLeavesBlock#BaseLeavesBlock(Block, MaterialColor, Consumer)} * * @param customizeProperties A {@link Consumer} to call with the preset properties - * @param settings The properties as created by the Block + * @param settings The properties as created by the Block * @return The reconfigured {@code settings} */ static FabricBlockSettings acceptAndReturn(Consumer customizeProperties, FabricBlockSettings settings) { diff --git a/src/main/java/ru/bclib/blocks/LeveledAnvilBlock.java b/src/main/java/ru/bclib/blocks/LeveledAnvilBlock.java index 6d71663a..8123f88b 100644 --- a/src/main/java/ru/bclib/blocks/LeveledAnvilBlock.java +++ b/src/main/java/ru/bclib/blocks/LeveledAnvilBlock.java @@ -3,14 +3,14 @@ import net.minecraft.world.level.material.MaterialColor; public class LeveledAnvilBlock extends BaseAnvilBlock{ - protected final int level; + protected final int level; - public LeveledAnvilBlock(MaterialColor color, int level) { - super(color); - this.level = level; - } + public LeveledAnvilBlock(MaterialColor color, int level) { + super(color); + this.level = level; + } - public int getCraftingLevel() { - return level; - } + public int getCraftingLevel() { + return level; + } } diff --git a/src/main/java/ru/bclib/client/models/OBJBlockModel.java b/src/main/java/ru/bclib/client/models/OBJBlockModel.java index 73497925..866ee048 100644 --- a/src/main/java/ru/bclib/client/models/OBJBlockModel.java +++ b/src/main/java/ru/bclib/client/models/OBJBlockModel.java @@ -220,7 +220,7 @@ else if (string.startsWith("f")) { if (member.contains("/")) { String[] sub = member.split("/"); vertexIndex.add(Integer.parseInt(sub[0]) - 1); // Vertex - uvIndex.add(Integer.parseInt(sub[1]) - 1); // UV + uvIndex.add(Integer.parseInt(sub[1]) - 1); // UV } else { vertexIndex.add(Integer.parseInt(member) - 1); // Vertex diff --git a/src/main/java/ru/bclib/client/models/UnbakedQuad.java b/src/main/java/ru/bclib/client/models/UnbakedQuad.java index 60b4ecc5..dbf5f6d8 100644 --- a/src/main/java/ru/bclib/client/models/UnbakedQuad.java +++ b/src/main/java/ru/bclib/client/models/UnbakedQuad.java @@ -55,7 +55,7 @@ public BakedQuad bake(TextureAtlasSprite[] sprites, ModelState modelState) { float z = data[dataIndex++]; // Z POS.set(x, y, z, 0); POS.transform(matrix); - vertexData[index] = Float.floatToIntBits(POS.x()); // X + vertexData[index] = Float.floatToIntBits(POS.x()); // X vertexData[index | 1] = Float.floatToIntBits(POS.y()); // Y vertexData[index | 2] = Float.floatToIntBits(POS.z()); // Z vertexData[index | 3] = -1; // Unknown constant diff --git a/src/main/java/ru/bclib/complexmaterials/WoodenComplexMaterial.java b/src/main/java/ru/bclib/complexmaterials/WoodenComplexMaterial.java index ba329585..9c1cb029 100644 --- a/src/main/java/ru/bclib/complexmaterials/WoodenComplexMaterial.java +++ b/src/main/java/ru/bclib/complexmaterials/WoodenComplexMaterial.java @@ -39,372 +39,372 @@ import ru.bclib.recipes.GridRecipe; public class WoodenComplexMaterial extends ComplexMaterial { - public static final ResourceLocation MATERIAL_ID = BCLib.makeID("wooden_material"); + public static final ResourceLocation MATERIAL_ID = BCLib.makeID("wooden_material"); - public static final String BLOCK_CRAFTING_TABLE = "crafting_table"; - public static final String BLOCK_STRIPPED_BARK = "stripped_bark"; - public static final String BLOCK_STRIPPED_LOG = "stripped_log"; - public static final String BLOCK_PRESSURE_PLATE = "plate"; - public static final String BLOCK_BOOKSHELF = "bookshelf"; - public static final String BLOCK_COMPOSTER = "composter"; - public static final String BLOCK_TRAPDOOR = "trapdoor"; - public static final String BLOCK_BARREL = "barrel"; - public static final String BLOCK_BUTTON = "button"; - public static final String BLOCK_LADDER = "ladder"; - public static final String BLOCK_PLANKS = "planks"; - public static final String BLOCK_STAIRS = "stairs"; - public static final String BLOCK_CHEST = "chest"; - public static final String BLOCK_FENCE = "fence"; - public static final String BLOCK_BARK = "bark"; - public static final String BLOCK_DOOR = "door"; - public static final String BLOCK_GATE = "gate"; - public static final String BLOCK_SIGN = "sign"; - public static final String BLOCK_SLAB = "slab"; - public static final String BLOCK_LOG = "log"; + public static final String BLOCK_CRAFTING_TABLE = "crafting_table"; + public static final String BLOCK_STRIPPED_BARK = "stripped_bark"; + public static final String BLOCK_STRIPPED_LOG = "stripped_log"; + public static final String BLOCK_PRESSURE_PLATE = "plate"; + public static final String BLOCK_BOOKSHELF = "bookshelf"; + public static final String BLOCK_COMPOSTER = "composter"; + public static final String BLOCK_TRAPDOOR = "trapdoor"; + public static final String BLOCK_BARREL = "barrel"; + public static final String BLOCK_BUTTON = "button"; + public static final String BLOCK_LADDER = "ladder"; + public static final String BLOCK_PLANKS = "planks"; + public static final String BLOCK_STAIRS = "stairs"; + public static final String BLOCK_CHEST = "chest"; + public static final String BLOCK_FENCE = "fence"; + public static final String BLOCK_BARK = "bark"; + public static final String BLOCK_DOOR = "door"; + public static final String BLOCK_GATE = "gate"; + public static final String BLOCK_SIGN = "sign"; + public static final String BLOCK_SLAB = "slab"; + public static final String BLOCK_LOG = "log"; - public static final String TAG_LOGS = "logs"; + public static final String TAG_LOGS = "logs"; - public final MaterialColor planksColor; - public final MaterialColor woodColor; + public final MaterialColor planksColor; + public final MaterialColor woodColor; - public WoodenComplexMaterial(String modID, String baseName, String receipGroupPrefix, MaterialColor woodColor, MaterialColor planksColor) { - super(modID, baseName, receipGroupPrefix); - this.planksColor = planksColor; - this.woodColor = woodColor; - } + public WoodenComplexMaterial(String modID, String baseName, String receipGroupPrefix, MaterialColor woodColor, MaterialColor planksColor) { + super(modID, baseName, receipGroupPrefix); + this.planksColor = planksColor; + this.woodColor = woodColor; + } - @Override - protected FabricBlockSettings getBlockSettings() { - return FabricBlockSettings.copyOf(Blocks.OAK_PLANKS) - .materialColor(planksColor); - } + @Override + protected FabricBlockSettings getBlockSettings() { + return FabricBlockSettings.copyOf(Blocks.OAK_PLANKS) + .materialColor(planksColor); + } - @Override - public ResourceLocation getMaterialID() { - return MATERIAL_ID; - } + @Override + public ResourceLocation getMaterialID() { + return MATERIAL_ID; + } - @Override - protected void initTags() { - addBlockTag(TagAPI.makeBlockTag(getModID(), getBaseName() + "_logs")); - addItemTag(TagAPI.makeItemTag(getModID(), getBaseName() + "_logs")); - } + @Override + protected void initTags() { + addBlockTag(TagAPI.makeBlockTag(getModID(), getBaseName() + "_logs")); + addItemTag(TagAPI.makeItemTag(getModID(), getBaseName() + "_logs")); + } - @Override - protected void initDefault(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { - initBase(blockSettings, itemSettings); - initStorage(blockSettings, itemSettings); - initDecorations(blockSettings, itemSettings); - } + @Override + protected void initDefault(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { + initBase(blockSettings, itemSettings); + initStorage(blockSettings, itemSettings); + initDecorations(blockSettings, itemSettings); + } - final protected void initBase(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { - Tag.Named tagBlockLog = getBlockTag(TAG_LOGS); - Tag.Named tagItemLog = getItemTag(TAG_LOGS); + final protected void initBase(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { + Tag.Named tagBlockLog = getBlockTag(TAG_LOGS); + Tag.Named tagItemLog = getItemTag(TAG_LOGS); - addBlockEntry( - new BlockEntry(BLOCK_STRIPPED_LOG, (complexMaterial, settings) -> { - return new BaseRotatedPillarBlock(settings); - }) - .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) - .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) - ); - addBlockEntry( - new BlockEntry(BLOCK_STRIPPED_BARK, (complexMaterial, settings) -> { - return new BaseBarkBlock(settings); - }) - .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) - .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) - ); + addBlockEntry( + new BlockEntry(BLOCK_STRIPPED_LOG, (complexMaterial, settings) -> { + return new BaseRotatedPillarBlock(settings); + }) + .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) + .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) + ); + addBlockEntry( + new BlockEntry(BLOCK_STRIPPED_BARK, (complexMaterial, settings) -> { + return new BaseBarkBlock(settings); + }) + .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) + .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) + ); - addBlockEntry( - new BlockEntry(BLOCK_LOG, (complexMaterial, settings) -> { - return new BaseStripableLogBlock(woodColor, getBlock(BLOCK_STRIPPED_LOG)); - }) - .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) - .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) - ); - addBlockEntry( - new BlockEntry(BLOCK_BARK, (complexMaterial, settings) -> { - return new StripableBarkBlock(woodColor, getBlock(BLOCK_STRIPPED_BARK)); - }) - .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) - .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) - ); - addBlockEntry(new BlockEntry(BLOCK_PLANKS, (complexMaterial, settings) -> { - return new BaseBlock(settings); - }).setBlockTags(BlockTags.PLANKS) - .setItemTags(ItemTags.PLANKS)); + addBlockEntry( + new BlockEntry(BLOCK_LOG, (complexMaterial, settings) -> { + return new BaseStripableLogBlock(woodColor, getBlock(BLOCK_STRIPPED_LOG)); + }) + .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) + .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) + ); + addBlockEntry( + new BlockEntry(BLOCK_BARK, (complexMaterial, settings) -> { + return new StripableBarkBlock(woodColor, getBlock(BLOCK_STRIPPED_BARK)); + }) + .setBlockTags(BlockTags.LOGS, BlockTags.LOGS_THAT_BURN, tagBlockLog) + .setItemTags(ItemTags.LOGS, ItemTags.LOGS_THAT_BURN, tagItemLog) + ); + addBlockEntry(new BlockEntry(BLOCK_PLANKS, (complexMaterial, settings) -> { + return new BaseBlock(settings); + }).setBlockTags(BlockTags.PLANKS) + .setItemTags(ItemTags.PLANKS)); - addBlockEntry(new BlockEntry(BLOCK_STAIRS, (complexMaterial, settings) -> { - return new BaseStairsBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.WOODEN_STAIRS, BlockTags.STAIRS) - .setItemTags(ItemTags.WOODEN_STAIRS, ItemTags.STAIRS)); - addBlockEntry(new BlockEntry(BLOCK_SLAB, (complexMaterial, settings) -> { - return new BaseSlabBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.WOODEN_SLABS, BlockTags.SLABS) - .setItemTags(ItemTags.WOODEN_SLABS, ItemTags.SLABS)); - addBlockEntry(new BlockEntry(BLOCK_FENCE, (complexMaterial, settings) -> { - return new BaseFenceBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.FENCES, BlockTags.WOODEN_FENCES) - .setItemTags(ItemTags.FENCES, ItemTags.WOODEN_FENCES)); - addBlockEntry(new BlockEntry(BLOCK_GATE, (complexMaterial, settings) -> { - return new BaseGateBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.FENCE_GATES)); - addBlockEntry(new BlockEntry(BLOCK_BUTTON, (complexMaterial, settings) -> { - return new BaseWoodenButtonBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.BUTTONS, BlockTags.WOODEN_BUTTONS) - .setItemTags(ItemTags.BUTTONS, ItemTags.WOODEN_BUTTONS)); - addBlockEntry(new BlockEntry(BLOCK_PRESSURE_PLATE, (complexMaterial, settings) -> { - return new WoodenPressurePlateBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.PRESSURE_PLATES, BlockTags.WOODEN_PRESSURE_PLATES) - .setItemTags(ItemTags.WOODEN_PRESSURE_PLATES)); - addBlockEntry(new BlockEntry(BLOCK_TRAPDOOR, (complexMaterial, settings) -> { - return new BaseTrapdoorBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.TRAPDOORS, BlockTags.WOODEN_TRAPDOORS) - .setItemTags(ItemTags.TRAPDOORS, ItemTags.WOODEN_TRAPDOORS)); - addBlockEntry(new BlockEntry(BLOCK_DOOR, (complexMaterial, settings) -> { - return new BaseDoorBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.DOORS, BlockTags.WOODEN_DOORS) - .setItemTags(ItemTags.DOORS, ItemTags.WOODEN_DOORS)); + addBlockEntry(new BlockEntry(BLOCK_STAIRS, (complexMaterial, settings) -> { + return new BaseStairsBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.WOODEN_STAIRS, BlockTags.STAIRS) + .setItemTags(ItemTags.WOODEN_STAIRS, ItemTags.STAIRS)); + addBlockEntry(new BlockEntry(BLOCK_SLAB, (complexMaterial, settings) -> { + return new BaseSlabBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.WOODEN_SLABS, BlockTags.SLABS) + .setItemTags(ItemTags.WOODEN_SLABS, ItemTags.SLABS)); + addBlockEntry(new BlockEntry(BLOCK_FENCE, (complexMaterial, settings) -> { + return new BaseFenceBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.FENCES, BlockTags.WOODEN_FENCES) + .setItemTags(ItemTags.FENCES, ItemTags.WOODEN_FENCES)); + addBlockEntry(new BlockEntry(BLOCK_GATE, (complexMaterial, settings) -> { + return new BaseGateBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.FENCE_GATES)); + addBlockEntry(new BlockEntry(BLOCK_BUTTON, (complexMaterial, settings) -> { + return new BaseWoodenButtonBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.BUTTONS, BlockTags.WOODEN_BUTTONS) + .setItemTags(ItemTags.BUTTONS, ItemTags.WOODEN_BUTTONS)); + addBlockEntry(new BlockEntry(BLOCK_PRESSURE_PLATE, (complexMaterial, settings) -> { + return new WoodenPressurePlateBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.PRESSURE_PLATES, BlockTags.WOODEN_PRESSURE_PLATES) + .setItemTags(ItemTags.WOODEN_PRESSURE_PLATES)); + addBlockEntry(new BlockEntry(BLOCK_TRAPDOOR, (complexMaterial, settings) -> { + return new BaseTrapdoorBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.TRAPDOORS, BlockTags.WOODEN_TRAPDOORS) + .setItemTags(ItemTags.TRAPDOORS, ItemTags.WOODEN_TRAPDOORS)); + addBlockEntry(new BlockEntry(BLOCK_DOOR, (complexMaterial, settings) -> { + return new BaseDoorBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.DOORS, BlockTags.WOODEN_DOORS) + .setItemTags(ItemTags.DOORS, ItemTags.WOODEN_DOORS)); - addBlockEntry(new BlockEntry(BLOCK_LADDER, (complexMaterial, settings) -> { - return new BaseLadderBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.CLIMBABLE)); - addBlockEntry(new BlockEntry(BLOCK_SIGN, (complexMaterial, settings) -> { - return new BaseSignBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(BlockTags.SIGNS) - .setItemTags(ItemTags.SIGNS)); + addBlockEntry(new BlockEntry(BLOCK_LADDER, (complexMaterial, settings) -> { + return new BaseLadderBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.CLIMBABLE)); + addBlockEntry(new BlockEntry(BLOCK_SIGN, (complexMaterial, settings) -> { + return new BaseSignBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(BlockTags.SIGNS) + .setItemTags(ItemTags.SIGNS)); - } + } - final protected void initStorage(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { - addBlockEntry(new BlockEntry(BLOCK_CHEST, (complexMaterial, settings) -> { - return new BaseChestBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(TagAPI.BLOCK_CHEST, TagAPI.BLOCK_WOODEN_CHEST) - .setItemTags(TagAPI.ITEM_CHEST, TagAPI.ITEM_WOODEN_CHEST)); + final protected void initStorage(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { + addBlockEntry(new BlockEntry(BLOCK_CHEST, (complexMaterial, settings) -> { + return new BaseChestBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(TagAPI.BLOCK_CHEST, TagAPI.BLOCK_WOODEN_CHEST) + .setItemTags(TagAPI.ITEM_CHEST, TagAPI.ITEM_WOODEN_CHEST)); - addBlockEntry(new BlockEntry(BLOCK_BARREL, (complexMaterial, settings) -> { - return new BaseBarrelBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(TagAPI.BLOCK_BARREL, TagAPI.BLOCK_WOODEN_BARREL) - .setItemTags(TagAPI.ITEM_BARREL, TagAPI.ITEM_WOODEN_BARREL)); - } + addBlockEntry(new BlockEntry(BLOCK_BARREL, (complexMaterial, settings) -> { + return new BaseBarrelBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(TagAPI.BLOCK_BARREL, TagAPI.BLOCK_WOODEN_BARREL) + .setItemTags(TagAPI.ITEM_BARREL, TagAPI.ITEM_WOODEN_BARREL)); + } - final protected void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { - addBlockEntry(new BlockEntry(BLOCK_CRAFTING_TABLE, (complexMaterial, settings) -> { - return new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(TagAPI.BLOCK_WORKBENCHES) - .setItemTags(TagAPI.ITEM_WORKBENCHES)); + final protected void initDecorations(FabricBlockSettings blockSettings, FabricItemSettings itemSettings) { + addBlockEntry(new BlockEntry(BLOCK_CRAFTING_TABLE, (complexMaterial, settings) -> { + return new BaseCraftingTableBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(TagAPI.BLOCK_WORKBENCHES) + .setItemTags(TagAPI.ITEM_WORKBENCHES)); - addBlockEntry(new BlockEntry(BLOCK_BOOKSHELF, (complexMaterial, settings) -> { - return new BaseBookshelfBlock(getBlock(BLOCK_PLANKS)); - }).setBlockTags(TagAPI.BLOCK_BOOKSHELVES)); + addBlockEntry(new BlockEntry(BLOCK_BOOKSHELF, (complexMaterial, settings) -> { + return new BaseBookshelfBlock(getBlock(BLOCK_PLANKS)); + }).setBlockTags(TagAPI.BLOCK_BOOKSHELVES)); - addBlockEntry(new BlockEntry(BLOCK_COMPOSTER, (complexMaterial, settings) -> { - return new BaseComposterBlock(getBlock(BLOCK_PLANKS)); - })); - } + addBlockEntry(new BlockEntry(BLOCK_COMPOSTER, (complexMaterial, settings) -> { + return new BaseComposterBlock(getBlock(BLOCK_PLANKS)); + })); + } - @Override - protected void initFlammable(FlammableBlockRegistry registry) { - getBlocks().forEach(block -> { - registry.add(block, 5, 20); - }); + @Override + protected void initFlammable(FlammableBlockRegistry registry) { + getBlocks().forEach(block -> { + registry.add(block, 5, 20); + }); - registry.add(getBlock(BLOCK_LOG), 5, 5); - registry.add(getBlock(BLOCK_BARK), 5, 5); - registry.add(getBlock(BLOCK_STRIPPED_LOG), 5, 5); - registry.add(getBlock(BLOCK_STRIPPED_BARK), 5, 5); - } + registry.add(getBlock(BLOCK_LOG), 5, 5); + registry.add(getBlock(BLOCK_BARK), 5, 5); + registry.add(getBlock(BLOCK_STRIPPED_LOG), 5, 5); + registry.add(getBlock(BLOCK_STRIPPED_BARK), 5, 5); + } - @Override - public void initDefaultRecipes() { - Block planks = getBlock(BLOCK_PLANKS); - addRecipeEntry(new RecipeEntry("planks", (material, config, id) -> { - Block log_stripped = getBlock(BLOCK_STRIPPED_LOG); - Block bark_stripped = getBlock(BLOCK_STRIPPED_BARK); - Block log = getBlock(BLOCK_LOG); - Block bark = getBlock(BLOCK_BARK); - GridRecipe.make(id, planks) - .checkConfig(config) - .setOutputCount(4) - .setList("#") - .addMaterial('#', log, bark, log_stripped, bark_stripped) - .setGroup(receipGroupPrefix + "_planks") - .build(); - })); - addRecipeEntry(new RecipeEntry("stairs", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_STAIRS)) - .checkConfig(config) - .setOutputCount(4) - .setShape("# ", "## ", "###") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_planks_stairs") - .build(); - })); - addRecipeEntry(new RecipeEntry("slab", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_SLAB)) - .checkConfig(config) - .setOutputCount(6) - .setShape("###") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_planks_slabs") - .build(); - })); - addRecipeEntry(new RecipeEntry("fence", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_FENCE)) - .checkConfig(config) - .setOutputCount(3) - .setShape("#I#", "#I#") - .addMaterial('#', planks) - .addMaterial('I', Items.STICK) - .setGroup(receipGroupPrefix + "_planks_fences") - .build(); - })); - addRecipeEntry(new RecipeEntry("gate", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_GATE)) - .checkConfig(config) - .setShape("I#I", "I#I") - .addMaterial('#', planks) - .addMaterial('I', Items.STICK) - .setGroup(receipGroupPrefix + "_planks_gates") - .build(); - })); - addRecipeEntry(new RecipeEntry("button", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_BUTTON)) - .checkConfig(config) - .setList("#") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_planks_buttons") - .build(); - })); - addRecipeEntry(new RecipeEntry("pressure_plate", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_PRESSURE_PLATE)) - .checkConfig(config) - .setShape("##") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_planks_plates") - .build(); - })); - addRecipeEntry(new RecipeEntry("trapdoor", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_TRAPDOOR)) - .checkConfig(config) - .setOutputCount(2) - .setShape("###", "###") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_trapdoors") - .build(); - })); - addRecipeEntry(new RecipeEntry("door", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_DOOR)) - .checkConfig(config) - .setOutputCount(3) - .setShape("##", "##", "##") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_doors") - .build(); - })); - addRecipeEntry(new RecipeEntry("crafting_table", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_CRAFTING_TABLE)) - .checkConfig(config) - .setShape("##", "##") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_tables") - .build(); - })); - addRecipeEntry(new RecipeEntry("ladder", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_LADDER)) - .checkConfig(config) - .setOutputCount(3) - .setShape("I I", "I#I", "I I") - .addMaterial('#', planks) - .addMaterial('I', Items.STICK) - .setGroup(receipGroupPrefix + "_ladders") - .build(); - })); - addRecipeEntry(new RecipeEntry("sign", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_SIGN)) - .checkConfig(config) - .setOutputCount(3) - .setShape("###", "###", " I ") - .addMaterial('#', planks) - .addMaterial('I', Items.STICK) - .setGroup(receipGroupPrefix + "_signs") - .build(); - })); - addRecipeEntry(new RecipeEntry("chest", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_CHEST)) - .checkConfig(config) - .setShape("###", "# #", "###") - .addMaterial('#', planks) - .setGroup(receipGroupPrefix + "_chests") - .build(); - })); - addRecipeEntry(new RecipeEntry("barrel", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_BARREL)) - .checkConfig(config) - .setShape("#S#", "# #", "#S#") - .addMaterial('#', planks) - .addMaterial('S', getBlock(BLOCK_SLAB)) - .setGroup(receipGroupPrefix + "_barrels") - .build(); - })); - addRecipeEntry(new RecipeEntry("bookshelf", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_BOOKSHELF)) - .checkConfig(config) - .setShape("###", "PPP", "###") - .addMaterial('#', planks) - .addMaterial('P', Items.BOOK) - .setGroup(receipGroupPrefix + "_bookshelves") - .build(); - })); - addRecipeEntry(new RecipeEntry("bark", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_BARK)) - .checkConfig(config) - .setShape("##", "##") - .addMaterial('#', getBlock(BLOCK_LOG)) - .setOutputCount(3) - .build(); - })); - addRecipeEntry(new RecipeEntry("log", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_LOG)) - .checkConfig(config) - .setShape("##", "##") - .addMaterial('#', getBlock(BLOCK_BARK)) - .setOutputCount(3) - .build(); - })); - addRecipeEntry(new RecipeEntry("stripped_bark", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_STRIPPED_BARK)) - .checkConfig(config) - .setShape("##", "##") - .addMaterial('#', getBlock(BLOCK_STRIPPED_LOG)) - .setOutputCount(3) - .build(); - })); - addRecipeEntry(new RecipeEntry("stripped_log", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_STRIPPED_LOG)) - .checkConfig(config) - .setShape("##", "##") - .addMaterial('#', getBlock(BLOCK_STRIPPED_BARK)) - .setOutputCount(3) - .build(); - })); - addRecipeEntry(new RecipeEntry("composter", (material, config, id) -> { - GridRecipe.make(id, getBlock(BLOCK_COMPOSTER)) - .checkConfig(config) - .setShape("# #", "# #", "###") - .addMaterial('#', getBlock(BLOCK_SLAB)) - .build(); - })); - addRecipeEntry(new RecipeEntry("shulker", (material, config, id) -> { - GridRecipe.make(id, Blocks.SHULKER_BOX) - .checkConfig(config) - .setShape("S", "#", "S") - .addMaterial('S', Items.SHULKER_SHELL) - .addMaterial('#', getBlock(BLOCK_CHEST)) - .build(); - })); - } + @Override + public void initDefaultRecipes() { + Block planks = getBlock(BLOCK_PLANKS); + addRecipeEntry(new RecipeEntry("planks", (material, config, id) -> { + Block log_stripped = getBlock(BLOCK_STRIPPED_LOG); + Block bark_stripped = getBlock(BLOCK_STRIPPED_BARK); + Block log = getBlock(BLOCK_LOG); + Block bark = getBlock(BLOCK_BARK); + GridRecipe.make(id, planks) + .checkConfig(config) + .setOutputCount(4) + .setList("#") + .addMaterial('#', log, bark, log_stripped, bark_stripped) + .setGroup(receipGroupPrefix + "_planks") + .build(); + })); + addRecipeEntry(new RecipeEntry("stairs", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_STAIRS)) + .checkConfig(config) + .setOutputCount(4) + .setShape("# ", "## ", "###") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_planks_stairs") + .build(); + })); + addRecipeEntry(new RecipeEntry("slab", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_SLAB)) + .checkConfig(config) + .setOutputCount(6) + .setShape("###") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_planks_slabs") + .build(); + })); + addRecipeEntry(new RecipeEntry("fence", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_FENCE)) + .checkConfig(config) + .setOutputCount(3) + .setShape("#I#", "#I#") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup(receipGroupPrefix + "_planks_fences") + .build(); + })); + addRecipeEntry(new RecipeEntry("gate", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_GATE)) + .checkConfig(config) + .setShape("I#I", "I#I") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup(receipGroupPrefix + "_planks_gates") + .build(); + })); + addRecipeEntry(new RecipeEntry("button", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_BUTTON)) + .checkConfig(config) + .setList("#") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_planks_buttons") + .build(); + })); + addRecipeEntry(new RecipeEntry("pressure_plate", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_PRESSURE_PLATE)) + .checkConfig(config) + .setShape("##") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_planks_plates") + .build(); + })); + addRecipeEntry(new RecipeEntry("trapdoor", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_TRAPDOOR)) + .checkConfig(config) + .setOutputCount(2) + .setShape("###", "###") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_trapdoors") + .build(); + })); + addRecipeEntry(new RecipeEntry("door", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_DOOR)) + .checkConfig(config) + .setOutputCount(3) + .setShape("##", "##", "##") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_doors") + .build(); + })); + addRecipeEntry(new RecipeEntry("crafting_table", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_CRAFTING_TABLE)) + .checkConfig(config) + .setShape("##", "##") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_tables") + .build(); + })); + addRecipeEntry(new RecipeEntry("ladder", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_LADDER)) + .checkConfig(config) + .setOutputCount(3) + .setShape("I I", "I#I", "I I") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup(receipGroupPrefix + "_ladders") + .build(); + })); + addRecipeEntry(new RecipeEntry("sign", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_SIGN)) + .checkConfig(config) + .setOutputCount(3) + .setShape("###", "###", " I ") + .addMaterial('#', planks) + .addMaterial('I', Items.STICK) + .setGroup(receipGroupPrefix + "_signs") + .build(); + })); + addRecipeEntry(new RecipeEntry("chest", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_CHEST)) + .checkConfig(config) + .setShape("###", "# #", "###") + .addMaterial('#', planks) + .setGroup(receipGroupPrefix + "_chests") + .build(); + })); + addRecipeEntry(new RecipeEntry("barrel", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_BARREL)) + .checkConfig(config) + .setShape("#S#", "# #", "#S#") + .addMaterial('#', planks) + .addMaterial('S', getBlock(BLOCK_SLAB)) + .setGroup(receipGroupPrefix + "_barrels") + .build(); + })); + addRecipeEntry(new RecipeEntry("bookshelf", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_BOOKSHELF)) + .checkConfig(config) + .setShape("###", "PPP", "###") + .addMaterial('#', planks) + .addMaterial('P', Items.BOOK) + .setGroup(receipGroupPrefix + "_bookshelves") + .build(); + })); + addRecipeEntry(new RecipeEntry("bark", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_BARK)) + .checkConfig(config) + .setShape("##", "##") + .addMaterial('#', getBlock(BLOCK_LOG)) + .setOutputCount(3) + .build(); + })); + addRecipeEntry(new RecipeEntry("log", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_LOG)) + .checkConfig(config) + .setShape("##", "##") + .addMaterial('#', getBlock(BLOCK_BARK)) + .setOutputCount(3) + .build(); + })); + addRecipeEntry(new RecipeEntry("stripped_bark", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_STRIPPED_BARK)) + .checkConfig(config) + .setShape("##", "##") + .addMaterial('#', getBlock(BLOCK_STRIPPED_LOG)) + .setOutputCount(3) + .build(); + })); + addRecipeEntry(new RecipeEntry("stripped_log", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_STRIPPED_LOG)) + .checkConfig(config) + .setShape("##", "##") + .addMaterial('#', getBlock(BLOCK_STRIPPED_BARK)) + .setOutputCount(3) + .build(); + })); + addRecipeEntry(new RecipeEntry("composter", (material, config, id) -> { + GridRecipe.make(id, getBlock(BLOCK_COMPOSTER)) + .checkConfig(config) + .setShape("# #", "# #", "###") + .addMaterial('#', getBlock(BLOCK_SLAB)) + .build(); + })); + addRecipeEntry(new RecipeEntry("shulker", (material, config, id) -> { + GridRecipe.make(id, Blocks.SHULKER_BOX) + .checkConfig(config) + .setShape("S", "#", "S") + .addMaterial('S', Items.SHULKER_SHELL) + .addMaterial('#', getBlock(BLOCK_CHEST)) + .build(); + })); + } } \ No newline at end of file diff --git a/src/main/java/ru/bclib/config/ClientConfig.java b/src/main/java/ru/bclib/config/ClientConfig.java index 8ba337b1..97866f5e 100644 --- a/src/main/java/ru/bclib/config/ClientConfig.java +++ b/src/main/java/ru/bclib/config/ClientConfig.java @@ -4,45 +4,45 @@ import ru.bclib.api.dataexchange.handler.autosync.AutoSync; public class ClientConfig extends NamedPathConfig { - public static final ConfigToken ENABLED = ConfigToken.Boolean(true, "enabled", AutoSync.SYNC_CATEGORY); - @ConfigUI(leftPadding = 8) - public static final DependendConfigToken ACCEPT_CONFIGS = DependendConfigToken.Boolean(true, "acceptConfigs", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - @ConfigUI(leftPadding = 8) - public static final DependendConfigToken ACCEPT_FILES = DependendConfigToken.Boolean(true, "acceptFiles", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - @ConfigUI(leftPadding = 8) - public static final DependendConfigToken ACCEPT_MODS = DependendConfigToken.Boolean(false, "acceptMods", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - @ConfigUI(leftPadding = 8) - public static final DependendConfigToken DISPLAY_MOD_INFO = DependendConfigToken.Boolean(true, "displayModInfo", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - - @ConfigUI(topPadding = 12) - public static final ConfigToken DEBUG_HASHES = ConfigToken.Boolean(false, "debugHashes", AutoSync.SYNC_CATEGORY); - - - public ClientConfig() { - super(BCLib.MOD_ID, "client", false); - } - - public boolean shouldPrintDebugHashes() { - return get(DEBUG_HASHES); - } - - public boolean isAllowingAutoSync() { - return get(ENABLED); - } - - public boolean isAcceptingMods() { - return get(ACCEPT_MODS) /*&& isAllowingAutoSync()*/; - } - - public boolean isAcceptingConfigs() { - return get(ACCEPT_CONFIGS) /*&& isAllowingAutoSync()*/; - } - - public boolean isAcceptingFiles() { - return get(ACCEPT_FILES) /*&& isAllowingAutoSync()*/; - } - - public boolean isShowingModInfo() { - return get(DISPLAY_MOD_INFO) /*&& isAllowingAutoSync()*/; - } + public static final ConfigToken ENABLED = ConfigToken.Boolean(true, "enabled", AutoSync.SYNC_CATEGORY); + @ConfigUI(leftPadding = 8) + public static final DependendConfigToken ACCEPT_CONFIGS = DependendConfigToken.Boolean(true, "acceptConfigs", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + @ConfigUI(leftPadding = 8) + public static final DependendConfigToken ACCEPT_FILES = DependendConfigToken.Boolean(true, "acceptFiles", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + @ConfigUI(leftPadding = 8) + public static final DependendConfigToken ACCEPT_MODS = DependendConfigToken.Boolean(false, "acceptMods", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + @ConfigUI(leftPadding = 8) + public static final DependendConfigToken DISPLAY_MOD_INFO = DependendConfigToken.Boolean(true, "displayModInfo", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + + @ConfigUI(topPadding = 12) + public static final ConfigToken DEBUG_HASHES = ConfigToken.Boolean(false, "debugHashes", AutoSync.SYNC_CATEGORY); + + + public ClientConfig() { + super(BCLib.MOD_ID, "client", false); + } + + public boolean shouldPrintDebugHashes() { + return get(DEBUG_HASHES); + } + + public boolean isAllowingAutoSync() { + return get(ENABLED); + } + + public boolean isAcceptingMods() { + return get(ACCEPT_MODS) /*&& isAllowingAutoSync()*/; + } + + public boolean isAcceptingConfigs() { + return get(ACCEPT_CONFIGS) /*&& isAllowingAutoSync()*/; + } + + public boolean isAcceptingFiles() { + return get(ACCEPT_FILES) /*&& isAllowingAutoSync()*/; + } + + public boolean isShowingModInfo() { + return get(DISPLAY_MOD_INFO) /*&& isAllowingAutoSync()*/; + } } diff --git a/src/main/java/ru/bclib/config/ConfigKeeper.java b/src/main/java/ru/bclib/config/ConfigKeeper.java index e3711670..32936e14 100644 --- a/src/main/java/ru/bclib/config/ConfigKeeper.java +++ b/src/main/java/ru/bclib/config/ConfigKeeper.java @@ -66,7 +66,7 @@ private static Pair> find(JsonObject json, Pai /** * Called for content based auto-sync. * - * @param me - When called in AutoSync this represents the content of the client. + * @param me - When called in AutoSync this represents the content of the client. * @param other - When called in AutoSync, this represents the content of the server * @return {@code true} if content was changed */ diff --git a/src/main/java/ru/bclib/config/ServerConfig.java b/src/main/java/ru/bclib/config/ServerConfig.java index bf8a66b7..811a71a9 100644 --- a/src/main/java/ru/bclib/config/ServerConfig.java +++ b/src/main/java/ru/bclib/config/ServerConfig.java @@ -7,44 +7,44 @@ import java.util.List; public class ServerConfig extends NamedPathConfig { - public static final ConfigToken ENABLED = ConfigToken.Boolean(true, "enabled", AutoSync.SYNC_CATEGORY); - public static final DependendConfigToken OFFER_CONFIGS = DependendConfigToken.Boolean(true, "offerConfigs", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - public static final DependendConfigToken OFFER_FILES = DependendConfigToken.Boolean(true, "offerFiles", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - public static final DependendConfigToken OFFER_MODS = DependendConfigToken.Boolean(true, "offerMods", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - public static final DependendConfigToken OFFER_ALL_MODS = DependendConfigToken.Boolean(false, "offerAllMods", AutoSync.SYNC_CATEGORY, (config) -> config.get(OFFER_MODS)); - public static final DependendConfigToken SEND_ALL_MOD_INFO = DependendConfigToken.Boolean(false, "sendAllModInfo", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + public static final ConfigToken ENABLED = ConfigToken.Boolean(true, "enabled", AutoSync.SYNC_CATEGORY); + public static final DependendConfigToken OFFER_CONFIGS = DependendConfigToken.Boolean(true, "offerConfigs", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + public static final DependendConfigToken OFFER_FILES = DependendConfigToken.Boolean(true, "offerFiles", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + public static final DependendConfigToken OFFER_MODS = DependendConfigToken.Boolean(true, "offerMods", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); + public static final DependendConfigToken OFFER_ALL_MODS = DependendConfigToken.Boolean(false, "offerAllMods", AutoSync.SYNC_CATEGORY, (config) -> config.get(OFFER_MODS)); + public static final DependendConfigToken SEND_ALL_MOD_INFO = DependendConfigToken.Boolean(false, "sendAllModInfo", AutoSync.SYNC_CATEGORY, (config) -> config.get(ENABLED)); - public static final ConfigToken> ADDITIONAL_MODS = ConfigToken.StringArray(new ArrayList<>(0), "additionalMods", AutoSync.SYNC_CATEGORY); - public static final ConfigToken> EXCLUDED_MODS = ConfigToken.StringArray(new ArrayList<>(0), "excludeMods", AutoSync.SYNC_CATEGORY); + public static final ConfigToken> ADDITIONAL_MODS = ConfigToken.StringArray(new ArrayList<>(0), "additionalMods", AutoSync.SYNC_CATEGORY); + public static final ConfigToken> EXCLUDED_MODS = ConfigToken.StringArray(new ArrayList<>(0), "excludeMods", AutoSync.SYNC_CATEGORY); - public ServerConfig() { - super(BCLib.MOD_ID, "server", false); - } + public ServerConfig() { + super(BCLib.MOD_ID, "server", false); + } - public boolean isAllowingAutoSync() { - return get(ENABLED); - } + public boolean isAllowingAutoSync() { + return get(ENABLED); + } - public boolean isOfferingConfigs() { - return get(OFFER_CONFIGS) /*&& isAllowingAutoSync()*/; - } + public boolean isOfferingConfigs() { + return get(OFFER_CONFIGS) /*&& isAllowingAutoSync()*/; + } - public boolean isOfferingFiles() { - return get(OFFER_FILES) /*&& isAllowingAutoSync()*/; - } + public boolean isOfferingFiles() { + return get(OFFER_FILES) /*&& isAllowingAutoSync()*/; + } - public boolean isOfferingMods() { - return get(OFFER_MODS) /*&& isAllowingAutoSync()*/; - } + public boolean isOfferingMods() { + return get(OFFER_MODS) /*&& isAllowingAutoSync()*/; + } - public boolean isOfferingAllMods() { - return get(OFFER_ALL_MODS) /*&& isAllowingAutoSync()*/; - } + public boolean isOfferingAllMods() { + return get(OFFER_ALL_MODS) /*&& isAllowingAutoSync()*/; + } - public boolean isOfferingInfosForMods() { - return get(SEND_ALL_MOD_INFO) /*&& isAllowingAutoSync()*/; - } - + public boolean isOfferingInfosForMods() { + return get(SEND_ALL_MOD_INFO) /*&& isAllowingAutoSync()*/; + } + } diff --git a/src/main/java/ru/bclib/gui/gridlayout/GridColumn.java b/src/main/java/ru/bclib/gui/gridlayout/GridColumn.java index 65511063..d363061b 100644 --- a/src/main/java/ru/bclib/gui/gridlayout/GridColumn.java +++ b/src/main/java/ru/bclib/gui/gridlayout/GridColumn.java @@ -9,64 +9,64 @@ @Environment(EnvType.CLIENT) public class GridColumn extends GridContainer { - GridColumn(double width) { - super(width); - } - - GridColumn(double width, GridLayout.GridValueType widthType) { - super(width, widthType); - } - - public GridRow addRow() { - return addRow(VerticalAlignment.TOP); - } - - public GridRow addRow(VerticalAlignment align) { - GridRow row = new GridRow(1.0, widthType==GridValueType.INHERIT?GridValueType.INHERIT:GridLayout.GridValueType.PERCENTAGE, align); - this.cells.add(row); - return row; - } - - - public void addSpacerRow() { - this.addSpacerRow(4); - } - - public void addSpacerRow(int height) { - GridCell cell = new GridCell(1.0, height, GridValueType.PERCENTAGE, null, null); - this.cells.add(cell); - } - - @Override - public int calculateWidth(final int parentWidth){ - if (widthType == GridValueType.INHERIT) { - return cells.stream() - .filter(row->row.widthType == GridValueType.INHERIT) - .map(row -> row.buildElement(0, 0, 1, 0, 0, null).width) - .reduce(0, (p, c) -> Math.max(p, c)); - - } else { - return super.calculateWidth(parentWidth); - } - } + GridColumn(double width) { + super(width); + } + + GridColumn(double width, GridLayout.GridValueType widthType) { + super(width, widthType); + } + + public GridRow addRow() { + return addRow(VerticalAlignment.TOP); + } + + public GridRow addRow(VerticalAlignment align) { + GridRow row = new GridRow(1.0, widthType==GridValueType.INHERIT?GridValueType.INHERIT:GridLayout.GridValueType.PERCENTAGE, align); + this.cells.add(row); + return row; + } + + + public void addSpacerRow() { + this.addSpacerRow(4); + } + + public void addSpacerRow(int height) { + GridCell cell = new GridCell(1.0, height, GridValueType.PERCENTAGE, null, null); + this.cells.add(cell); + } + + @Override + public int calculateWidth(final int parentWidth){ + if (widthType == GridValueType.INHERIT) { + return cells.stream() + .filter(row->row.widthType == GridValueType.INHERIT) + .map(row -> row.buildElement(0, 0, 1, 0, 0, null).width) + .reduce(0, (p, c) -> Math.max(p, c)); + + } else { + return super.calculateWidth(parentWidth); + } + } - @Override - protected GridElement buildElementAt(int left, int inTop, int width, final List collector) { - int height = 0; - int top = inTop; + @Override + protected GridElement buildElementAt(int left, int inTop, int width, final List collector) { + int height = 0; + int top = inTop; - if (widthType == GridValueType.INHERIT) { + if (widthType == GridValueType.INHERIT) { width = calculateWidth(width); } - for (GridCellDefinition row : cells) { - GridElement element = row.buildElement(width, 0, 1, left, top, collector); - top += element.height; - height += element.height; - } + for (GridCellDefinition row : cells) { + GridElement element = row.buildElement(width, 0, 1, left, top, collector); + top += element.height; + height += element.height; + } - return new GridElement(left, inTop, width, height); - } + return new GridElement(left, inTop, width, height); + } } diff --git a/src/main/java/ru/bclib/gui/screens/AtomicProgressListener.java b/src/main/java/ru/bclib/gui/screens/AtomicProgressListener.java index c1b1c7e1..6600449d 100644 --- a/src/main/java/ru/bclib/gui/screens/AtomicProgressListener.java +++ b/src/main/java/ru/bclib/gui/screens/AtomicProgressListener.java @@ -3,8 +3,8 @@ import net.minecraft.network.chat.Component; public interface AtomicProgressListener { - public void incAtomic(int maxProgress); - public void resetAtomic(); - public void stop(); - public void progressStage(Component component); + public void incAtomic(int maxProgress); + public void resetAtomic(); + public void stop(); + public void progressStage(Component component); } diff --git a/src/main/java/ru/bclib/gui/screens/ConfirmRestartScreen.java b/src/main/java/ru/bclib/gui/screens/ConfirmRestartScreen.java index f4138f50..ef873fac 100644 --- a/src/main/java/ru/bclib/gui/screens/ConfirmRestartScreen.java +++ b/src/main/java/ru/bclib/gui/screens/ConfirmRestartScreen.java @@ -11,41 +11,41 @@ @Environment(EnvType.CLIENT) public class ConfirmRestartScreen extends BCLibScreen { - private final Component description; - private final ConfirmRestartScreen.Listener listener; - - public ConfirmRestartScreen(ConfirmRestartScreen.Listener listener) { - this(listener, null); - } - - public ConfirmRestartScreen(ConfirmRestartScreen.Listener listener, Component message) { - super(new TranslatableComponent("title.bclib.confirmrestart")); - - this.description = message==null?new TranslatableComponent("message.bclib.confirmrestart"):message; - this.listener = listener; - } - - protected void initLayout() { - final int BUTTON_HEIGHT = 20; - - grid.addRow().addMessage(this.description, this.font, Alignment.CENTER); - - grid.addSpacerRow(); - - GridRow row = grid.addRow(); - row.addFiller(); - row.addButton(CommonComponents.GUI_PROCEED, BUTTON_HEIGHT, font, (button) -> { - listener.proceed(); - }); - row.addFiller(); - } - - public boolean shouldCloseOnEsc() { - return false; - } - - @Environment(EnvType.CLIENT) - public interface Listener { - void proceed(); - } + private final Component description; + private final ConfirmRestartScreen.Listener listener; + + public ConfirmRestartScreen(ConfirmRestartScreen.Listener listener) { + this(listener, null); + } + + public ConfirmRestartScreen(ConfirmRestartScreen.Listener listener, Component message) { + super(new TranslatableComponent("title.bclib.confirmrestart")); + + this.description = message==null?new TranslatableComponent("message.bclib.confirmrestart"):message; + this.listener = listener; + } + + protected void initLayout() { + final int BUTTON_HEIGHT = 20; + + grid.addRow().addMessage(this.description, this.font, Alignment.CENTER); + + grid.addSpacerRow(); + + GridRow row = grid.addRow(); + row.addFiller(); + row.addButton(CommonComponents.GUI_PROCEED, BUTTON_HEIGHT, font, (button) -> { + listener.proceed(); + }); + row.addFiller(); + } + + public boolean shouldCloseOnEsc() { + return false; + } + + @Environment(EnvType.CLIENT) + public interface Listener { + void proceed(); + } } diff --git a/src/main/java/ru/bclib/gui/screens/LevelFixErrorScreen.java b/src/main/java/ru/bclib/gui/screens/LevelFixErrorScreen.java index 1615c0f2..8885892f 100644 --- a/src/main/java/ru/bclib/gui/screens/LevelFixErrorScreen.java +++ b/src/main/java/ru/bclib/gui/screens/LevelFixErrorScreen.java @@ -12,49 +12,49 @@ @Environment(EnvType.CLIENT) public class LevelFixErrorScreen extends BCLibScreen { - private final String[] errors; - final Listener onContinue; - - public LevelFixErrorScreen(Screen parent, String[] errors, Listener onContinue) { - super(parent, new TranslatableComponent("title.bclib.datafixer.error"), 10, true); - this.errors = errors; - this.onContinue = onContinue; - } - - @Override - protected void initLayout() { - grid.addSpacerRow(); - grid.addRow().addMessage(new TranslatableComponent("message.bclib.datafixer.error"), font, GridLayout.Alignment.CENTER); - grid.addSpacerRow(8); - - GridRow row = grid.addRow(); - row.addSpacer(10); - GridColumn col = row.addColumn(300, GridLayout.GridValueType.CONSTANT); - for (String error : errors){ - TextComponent dash = new TextComponent("-"); - row = col.addRow(); - row.addString(dash, this); - - row.addSpacer(4); - row.addString(new TextComponent(error), this); - } - - grid.addSpacerRow(8); - row = grid.addRow(); - row.addFiller(); - row.addButton(new TranslatableComponent("title.bclib.datafixer.error.continue"), 0.5f, 20, font, (n)-> { - onClose(); - onContinue.doContinue(true); - }); - row.addSpacer(); - row.addButton(CommonComponents.GUI_CANCEL, 20, font, (n)-> { - this.minecraft.setScreen(null); - }); - row.addFiller(); - } - - @Environment(EnvType.CLIENT) - public interface Listener { - void doContinue(boolean markFixed); - } + private final String[] errors; + final Listener onContinue; + + public LevelFixErrorScreen(Screen parent, String[] errors, Listener onContinue) { + super(parent, new TranslatableComponent("title.bclib.datafixer.error"), 10, true); + this.errors = errors; + this.onContinue = onContinue; + } + + @Override + protected void initLayout() { + grid.addSpacerRow(); + grid.addRow().addMessage(new TranslatableComponent("message.bclib.datafixer.error"), font, GridLayout.Alignment.CENTER); + grid.addSpacerRow(8); + + GridRow row = grid.addRow(); + row.addSpacer(10); + GridColumn col = row.addColumn(300, GridLayout.GridValueType.CONSTANT); + for (String error : errors){ + TextComponent dash = new TextComponent("-"); + row = col.addRow(); + row.addString(dash, this); + + row.addSpacer(4); + row.addString(new TextComponent(error), this); + } + + grid.addSpacerRow(8); + row = grid.addRow(); + row.addFiller(); + row.addButton(new TranslatableComponent("title.bclib.datafixer.error.continue"), 0.5f, 20, font, (n)-> { + onClose(); + onContinue.doContinue(true); + }); + row.addSpacer(); + row.addButton(CommonComponents.GUI_CANCEL, 20, font, (n)-> { + this.minecraft.setScreen(null); + }); + row.addFiller(); + } + + @Environment(EnvType.CLIENT) + public interface Listener { + void doContinue(boolean markFixed); + } } diff --git a/src/main/java/ru/bclib/gui/screens/ModListScreen.java b/src/main/java/ru/bclib/gui/screens/ModListScreen.java index f2af5008..4a923aad 100644 --- a/src/main/java/ru/bclib/gui/screens/ModListScreen.java +++ b/src/main/java/ru/bclib/gui/screens/ModListScreen.java @@ -26,193 +26,193 @@ @Environment(EnvType.CLIENT) public class ModListScreen extends BCLibScreen { - private final List mods; - private final HelloClient.IServerModMap serverInfo; - private final Component description; - private final Component buttonTitle; - - private static List extractModList(Map mods){ - List list = new LinkedList(); - ModUtil.getMods().forEach((id, info) -> list.add(info)); - return list; - } - - public ModListScreen(Screen parent, Component title, Component description, Map mods, HelloClient.IServerModMap serverInfo) { - this(parent, title, description, CommonComponents.GUI_BACK, mods, serverInfo); - } - - public ModListScreen(Screen parent, Component title, Component description, List mods, HelloClient.IServerModMap serverInfo) { - this(parent, title, description, CommonComponents.GUI_BACK, mods, serverInfo); - } - - public ModListScreen(Screen parent, Component title, Component description, Component button, Map mods, HelloClient.IServerModMap serverInfo) { - this(parent, title, description, button, extractModList(mods), serverInfo); - } - - public ModListScreen(Screen parent, Component title, Component description, Component button, List mods, HelloClient.IServerModMap serverInfo) { - super(parent, title, 10, true); - this.mods = mods; - this.serverInfo = serverInfo; - this.description = description; - this.buttonTitle = button; - } - - public static List localMissing(HelloClient.IServerModMap serverInfo){ - return serverInfo.keySet() - .stream() - .filter(modid -> !ModUtil.getMods().keySet().stream().filter(mod -> mod.equals(modid)).findFirst().isPresent()).collect(Collectors.toList()); - } - - public static List serverMissing(HelloClient.IServerModMap serverInfo){ - return ModUtil.getMods().entrySet() - .stream() - .filter(entry -> entry.getValue().metadata.getEnvironment() != ModEnvironment.CLIENT) - .map(entry -> entry.getKey()) - .filter(modid -> !serverInfo.keySet().stream().filter(mod -> mod.equals(modid)).findFirst().isPresent()).collect(Collectors.toList()); - } - - - public static void addModDesc(GridColumn grid, java.util.List mods, HelloClient.IServerModMap serverInfo, GridScreen parent) { - final int STATE_OK = 6; - final int STATE_SERVER_MISSING_CLIENT_MOD = 5; - final int STATE_MISSING_NOT_OFFERED = 4; - final int STATE_VERSION_NOT_OFFERED = 3; - final int STATE_VERSION = 2; - final int STATE_SERVER_MISSING = 1; - final int STATE_MISSING = 0; - - - List> items = new LinkedList<>(); - if (serverInfo!=null) { - serverInfo.keySet() - .stream() - .filter(modid -> !mods.stream().filter(mod -> mod.metadata.getId().equals(modid)).findFirst().isPresent()) - .forEach(modid -> { - HelloClient.OfferedModInfo nfo = serverInfo.get(modid); - String stateString = nfo.version(); - if (nfo.size()>0) { - stateString = "Version: " + stateString + ", Size: " + PathUtil.humanReadableFileSize(nfo.size()); - } - if (nfo.canDownload()) { - stateString += ", offered by server"; - } - - items.add(new Triple<>(modid, nfo.canDownload()?STATE_MISSING:STATE_MISSING_NOT_OFFERED, stateString)); - }); - } - - mods.forEach(mod -> { - String serverVersion = null; - int serverSize = 0; - int state = STATE_OK; - if (serverInfo != null) { - final String modID = mod.metadata.getId(); - - - HelloClient.OfferedModInfo data = serverInfo.get(modID); - if (data!=null) { - final String modVer = data.version(); - final int size = data.size(); - if (!modVer.equals(mod.getVersion())) { - state = data.canDownload()?STATE_VERSION:STATE_VERSION_NOT_OFFERED; - serverVersion = modVer; - serverSize = size; - } - } else if (mod.metadata.getEnvironment() == ModEnvironment.CLIENT){ - state = STATE_SERVER_MISSING_CLIENT_MOD; - } else { - state = STATE_SERVER_MISSING; - } - } - - String stateString = mod.metadata.getVersion().toString(); - if (serverVersion!=null) { - stateString = "Client: " + stateString; - stateString += ", Server: " + serverVersion; - if (serverSize>0) { - stateString += ", Size: " + PathUtil.humanReadableFileSize(serverSize); - } - } - if (mod.metadata.getEnvironment() == ModEnvironment.CLIENT) { - stateString+= ", client-only"; - } else if (mod.metadata.getEnvironment() == ModEnvironment.SERVER) { - stateString+= ", server-only"; - } - items.add(new Triple<>(mod.metadata.getName(), state, stateString)); - }); - - items.stream() - .sorted(Comparator.comparing(a -> a.second + a.first.toLowerCase(Locale.ROOT))) - .forEach(t -> { - final String name = t.first; - final int state = t.second; - final String stateString = t.third; - - int color = GridLayout.COLOR_RED; - final String typeText; - if (state==STATE_VERSION || state==STATE_VERSION_NOT_OFFERED) { - typeText = "[VERSION]"; - if (state == STATE_VERSION_NOT_OFFERED) { - color = GridLayout.COLOR_YELLOW; - } - } else if (state==STATE_MISSING || state==STATE_MISSING_NOT_OFFERED) { - typeText = "[MISSING]"; - if (state == STATE_MISSING_NOT_OFFERED) { - color = GridLayout.COLOR_YELLOW; - } - } else if (state==STATE_SERVER_MISSING || state == STATE_SERVER_MISSING_CLIENT_MOD) { - if (state == STATE_SERVER_MISSING_CLIENT_MOD) { - color = GridLayout.COLOR_CYAN; - typeText = "[OK]"; - } else { - typeText = "[NOT ON SERVER]"; - } - } else { - color = GridLayout.COLOR_DARK_GREEN; - typeText = "[OK]"; - } - TextComponent dash = new TextComponent("-"); - TextComponent typeTextComponent = new TextComponent(typeText); - GridRow row = grid.addRow(); - - row.addString(dash, parent); - - row.addSpacer(4); - row.addString(new TextComponent(name), parent); - - row.addSpacer(4); - row.addString(typeTextComponent, color, parent); - - if (!stateString.isEmpty()) { - row = grid.addRow(); - row.addSpacer(4 + parent.getWidth(dash)); - row.addString(new TextComponent(stateString), GridLayout.COLOR_GRAY, parent); - } - - grid.addSpacerRow(); - }); - } - - @Override - protected void initLayout() { - if (description != null) { - grid.addSpacerRow(); - grid.addRow().addMessage(description, font, GridLayout.Alignment.CENTER); - grid.addSpacerRow(8); - } - - GridRow row = grid.addRow(); - row.addSpacer(10); - GridColumn col = row.addColumn(200, GridLayout.GridValueType.CONSTANT); - addModDesc(col, mods, serverInfo, this); - - grid.addSpacerRow(8); - row = grid.addRow(); - row.addFiller(); - row.addButton(buttonTitle, 20, font, (n)-> { - onClose(); - }); - row.addFiller(); - } + private final List mods; + private final HelloClient.IServerModMap serverInfo; + private final Component description; + private final Component buttonTitle; + + private static List extractModList(Map mods){ + List list = new LinkedList(); + ModUtil.getMods().forEach((id, info) -> list.add(info)); + return list; + } + + public ModListScreen(Screen parent, Component title, Component description, Map mods, HelloClient.IServerModMap serverInfo) { + this(parent, title, description, CommonComponents.GUI_BACK, mods, serverInfo); + } + + public ModListScreen(Screen parent, Component title, Component description, List mods, HelloClient.IServerModMap serverInfo) { + this(parent, title, description, CommonComponents.GUI_BACK, mods, serverInfo); + } + + public ModListScreen(Screen parent, Component title, Component description, Component button, Map mods, HelloClient.IServerModMap serverInfo) { + this(parent, title, description, button, extractModList(mods), serverInfo); + } + + public ModListScreen(Screen parent, Component title, Component description, Component button, List mods, HelloClient.IServerModMap serverInfo) { + super(parent, title, 10, true); + this.mods = mods; + this.serverInfo = serverInfo; + this.description = description; + this.buttonTitle = button; + } + + public static List localMissing(HelloClient.IServerModMap serverInfo){ + return serverInfo.keySet() + .stream() + .filter(modid -> !ModUtil.getMods().keySet().stream().filter(mod -> mod.equals(modid)).findFirst().isPresent()).collect(Collectors.toList()); + } + + public static List serverMissing(HelloClient.IServerModMap serverInfo){ + return ModUtil.getMods().entrySet() + .stream() + .filter(entry -> entry.getValue().metadata.getEnvironment() != ModEnvironment.CLIENT) + .map(entry -> entry.getKey()) + .filter(modid -> !serverInfo.keySet().stream().filter(mod -> mod.equals(modid)).findFirst().isPresent()).collect(Collectors.toList()); + } + + + public static void addModDesc(GridColumn grid, java.util.List mods, HelloClient.IServerModMap serverInfo, GridScreen parent) { + final int STATE_OK = 6; + final int STATE_SERVER_MISSING_CLIENT_MOD = 5; + final int STATE_MISSING_NOT_OFFERED = 4; + final int STATE_VERSION_NOT_OFFERED = 3; + final int STATE_VERSION = 2; + final int STATE_SERVER_MISSING = 1; + final int STATE_MISSING = 0; + + + List> items = new LinkedList<>(); + if (serverInfo!=null) { + serverInfo.keySet() + .stream() + .filter(modid -> !mods.stream().filter(mod -> mod.metadata.getId().equals(modid)).findFirst().isPresent()) + .forEach(modid -> { + HelloClient.OfferedModInfo nfo = serverInfo.get(modid); + String stateString = nfo.version(); + if (nfo.size()>0) { + stateString = "Version: " + stateString + ", Size: " + PathUtil.humanReadableFileSize(nfo.size()); + } + if (nfo.canDownload()) { + stateString += ", offered by server"; + } + + items.add(new Triple<>(modid, nfo.canDownload()?STATE_MISSING:STATE_MISSING_NOT_OFFERED, stateString)); + }); + } + + mods.forEach(mod -> { + String serverVersion = null; + int serverSize = 0; + int state = STATE_OK; + if (serverInfo != null) { + final String modID = mod.metadata.getId(); + + + HelloClient.OfferedModInfo data = serverInfo.get(modID); + if (data!=null) { + final String modVer = data.version(); + final int size = data.size(); + if (!modVer.equals(mod.getVersion())) { + state = data.canDownload()?STATE_VERSION:STATE_VERSION_NOT_OFFERED; + serverVersion = modVer; + serverSize = size; + } + } else if (mod.metadata.getEnvironment() == ModEnvironment.CLIENT){ + state = STATE_SERVER_MISSING_CLIENT_MOD; + } else { + state = STATE_SERVER_MISSING; + } + } + + String stateString = mod.metadata.getVersion().toString(); + if (serverVersion!=null) { + stateString = "Client: " + stateString; + stateString += ", Server: " + serverVersion; + if (serverSize>0) { + stateString += ", Size: " + PathUtil.humanReadableFileSize(serverSize); + } + } + if (mod.metadata.getEnvironment() == ModEnvironment.CLIENT) { + stateString+= ", client-only"; + } else if (mod.metadata.getEnvironment() == ModEnvironment.SERVER) { + stateString+= ", server-only"; + } + items.add(new Triple<>(mod.metadata.getName(), state, stateString)); + }); + + items.stream() + .sorted(Comparator.comparing(a -> a.second + a.first.toLowerCase(Locale.ROOT))) + .forEach(t -> { + final String name = t.first; + final int state = t.second; + final String stateString = t.third; + + int color = GridLayout.COLOR_RED; + final String typeText; + if (state==STATE_VERSION || state==STATE_VERSION_NOT_OFFERED) { + typeText = "[VERSION]"; + if (state == STATE_VERSION_NOT_OFFERED) { + color = GridLayout.COLOR_YELLOW; + } + } else if (state==STATE_MISSING || state==STATE_MISSING_NOT_OFFERED) { + typeText = "[MISSING]"; + if (state == STATE_MISSING_NOT_OFFERED) { + color = GridLayout.COLOR_YELLOW; + } + } else if (state==STATE_SERVER_MISSING || state == STATE_SERVER_MISSING_CLIENT_MOD) { + if (state == STATE_SERVER_MISSING_CLIENT_MOD) { + color = GridLayout.COLOR_CYAN; + typeText = "[OK]"; + } else { + typeText = "[NOT ON SERVER]"; + } + } else { + color = GridLayout.COLOR_DARK_GREEN; + typeText = "[OK]"; + } + TextComponent dash = new TextComponent("-"); + TextComponent typeTextComponent = new TextComponent(typeText); + GridRow row = grid.addRow(); + + row.addString(dash, parent); + + row.addSpacer(4); + row.addString(new TextComponent(name), parent); + + row.addSpacer(4); + row.addString(typeTextComponent, color, parent); + + if (!stateString.isEmpty()) { + row = grid.addRow(); + row.addSpacer(4 + parent.getWidth(dash)); + row.addString(new TextComponent(stateString), GridLayout.COLOR_GRAY, parent); + } + + grid.addSpacerRow(); + }); + } + + @Override + protected void initLayout() { + if (description != null) { + grid.addSpacerRow(); + grid.addRow().addMessage(description, font, GridLayout.Alignment.CENTER); + grid.addSpacerRow(8); + } + + GridRow row = grid.addRow(); + row.addSpacer(10); + GridColumn col = row.addColumn(200, GridLayout.GridValueType.CONSTANT); + addModDesc(col, mods, serverInfo, this); + + grid.addSpacerRow(8); + row = grid.addRow(); + row.addFiller(); + row.addButton(buttonTitle, 20, font, (n)-> { + onClose(); + }); + row.addFiller(); + } } diff --git a/src/main/java/ru/bclib/integration/ModMenuIntegration.java b/src/main/java/ru/bclib/integration/ModMenuIntegration.java index d375b96d..77bc0fed 100644 --- a/src/main/java/ru/bclib/integration/ModMenuIntegration.java +++ b/src/main/java/ru/bclib/integration/ModMenuIntegration.java @@ -55,16 +55,16 @@ public static ModMenuScreenFactory create(ModMenuScreenFactory act) { *

* Example: *

{@code public class ModMenu extends ModMenuIntegration {
- *     public static final ModMenuApiMarker entrypointObject = createEntrypoint(new EntryPoint());
+ *	 public static final ModMenuApiMarker entrypointObject = createEntrypoint(new EntryPoint());
  *
- * 	    public EntryPoint() {
- * 		    super(GridScreen::new);
- *      }
+ * 		public EntryPoint() {
+ * 			super(GridScreen::new);
+ *	  }
  * }}
* You'd also need to add the ModMenu-Entrypoint to your fabric.mod.json: *
"entrypoints": {
- * 	    ...
- *     "modmenu": [ "your.mod.ModMenu::entrypointObject" ]
+ * 		...
+ *	 "modmenu": [ "your.mod.ModMenu::entrypointObject" ]
  * }
*/ public abstract class ModMenuIntegration { @@ -101,7 +101,7 @@ public static ModMenuApi createEntrypoint(ModMenuIntegration target) { /** * Create a new ModMenu delegate * @param screenFactory A Factory. The Factory receives the currently visible {@code parent}-Screen - * and must return a new Screen Object. + * and must return a new Screen Object. */ public ModMenuIntegration(ModMenuScreenFactory screenFactory){ this.screenFactory = screenFactory; diff --git a/src/main/java/ru/bclib/interfaces/SurfaceMaterialProvider.java b/src/main/java/ru/bclib/interfaces/SurfaceMaterialProvider.java index a7584b19..e6b7488e 100644 --- a/src/main/java/ru/bclib/interfaces/SurfaceMaterialProvider.java +++ b/src/main/java/ru/bclib/interfaces/SurfaceMaterialProvider.java @@ -3,7 +3,7 @@ import net.minecraft.world.level.block.state.BlockState; public interface SurfaceMaterialProvider { - BlockState getTopMaterial(); - BlockState getUnderMaterial(); - BlockState getAltTopMaterial(); + BlockState getTopMaterial(); + BlockState getUnderMaterial(); + BlockState getAltTopMaterial(); } diff --git a/src/main/java/ru/bclib/interfaces/TriConsumer.java b/src/main/java/ru/bclib/interfaces/TriConsumer.java index dab5678f..bdece152 100644 --- a/src/main/java/ru/bclib/interfaces/TriConsumer.java +++ b/src/main/java/ru/bclib/interfaces/TriConsumer.java @@ -2,5 +2,5 @@ @FunctionalInterface public interface TriConsumer { - void accept(A a, B b, C c); + void accept(A a, B b, C c); } diff --git a/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java b/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java index 7be3364a..b0a83ed9 100644 --- a/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java +++ b/src/main/java/ru/bclib/mixin/client/MinecraftMixin.java @@ -1,12 +1,6 @@ package ru.bclib.mixin.client; -import com.google.common.collect.HashMultimap; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Multimap; import com.mojang.datafixers.util.Function4; -import net.fabricmc.fabric.api.event.registry.DynamicRegistrySetupCallback; -import net.fabricmc.fabric.api.event.registry.RegistryEntryAddedCallback; import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft.ExperimentalDialogType; import net.minecraft.client.color.block.BlockColors; @@ -15,17 +9,10 @@ import net.minecraft.core.Registry; import net.minecraft.core.RegistryAccess; import net.minecraft.core.RegistryAccess.RegistryHolder; -import net.minecraft.data.BuiltinRegistries; -import net.minecraft.resources.ResourceKey; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.level.DataPackConfig; import net.minecraft.world.level.LevelSettings; -import net.minecraft.world.level.biome.Biome; -import net.minecraft.world.level.levelgen.NoiseGeneratorSettings; -import net.minecraft.world.level.levelgen.SurfaceRules; import net.minecraft.world.level.levelgen.WorldGenSettings; -import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; -import net.minecraft.world.level.levelgen.feature.StructureFeature; import net.minecraft.world.level.storage.LevelStorageSource; import net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess; import net.minecraft.world.level.storage.WorldData; @@ -35,18 +22,12 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import ru.bclib.BCLib; import ru.bclib.api.LifeCycleAPI; import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.dataexchange.DataExchangeAPI; import ru.bclib.api.datafixer.DataFixerAPI; import ru.bclib.interfaces.CustomColorProvider; -import ru.bclib.mixin.common.StructureSettingsAccessor; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; -import java.util.function.Consumer; import java.util.function.Function; @Mixin(Minecraft.class) diff --git a/src/main/java/ru/bclib/mixin/common/MinecraftServerMixin.java b/src/main/java/ru/bclib/mixin/common/MinecraftServerMixin.java index e337b2c6..31ca331d 100644 --- a/src/main/java/ru/bclib/mixin/common/MinecraftServerMixin.java +++ b/src/main/java/ru/bclib/mixin/common/MinecraftServerMixin.java @@ -31,35 +31,35 @@ @Mixin(MinecraftServer.class) public class MinecraftServerMixin { - @Shadow - private ServerResources resources; + @Shadow + private ServerResources resources; - @Final - @Shadow - private Map, ServerLevel> levels; + @Final + @Shadow + private Map, ServerLevel> levels; - @Final - @Shadow - protected WorldData worldData; + @Final + @Shadow + protected WorldData worldData; - @Inject(method = "*", at = @At("TAIL")) - private void bclib_onServerInit(Thread thread, RegistryHolder registryHolder, LevelStorageAccess levelStorageAccess, WorldData worldData, PackRepository packRepository, Proxy proxy, DataFixer dataFixer, ServerResources serverResources, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, GameProfileCache gameProfileCache, ChunkProgressListenerFactory chunkProgressListenerFactory, CallbackInfo ci) { - DataExchangeAPI.prepareServerside(); - } + @Inject(method = "*", at = @At("TAIL")) + private void bclib_onServerInit(Thread thread, RegistryHolder registryHolder, LevelStorageAccess levelStorageAccess, WorldData worldData, PackRepository packRepository, Proxy proxy, DataFixer dataFixer, ServerResources serverResources, MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository, GameProfileCache gameProfileCache, ChunkProgressListenerFactory chunkProgressListenerFactory, CallbackInfo ci) { + DataExchangeAPI.prepareServerside(); + } - @Inject(method = "reloadResources", at = @At(value = "RETURN"), cancellable = true) - private void bclib_reloadResources(Collection collection, CallbackInfoReturnable> info) { - bclib_injectRecipes(); - } + @Inject(method = "reloadResources", at = @At(value = "RETURN"), cancellable = true) + private void bclib_reloadResources(Collection collection, CallbackInfoReturnable> info) { + bclib_injectRecipes(); + } - @Inject(method = "loadLevel", at = @At(value = "RETURN"), cancellable = true) - private void bclib_loadLevel(CallbackInfo info) { - bclib_injectRecipes(); - //BiomeAPI.initRegistry(MinecraftServer.class.cast(this)); - } + @Inject(method = "loadLevel", at = @At(value = "RETURN"), cancellable = true) + private void bclib_loadLevel(CallbackInfo info) { + bclib_injectRecipes(); + //BiomeAPI.initRegistry(MinecraftServer.class.cast(this)); + } - private void bclib_injectRecipes() { - RecipeManagerAccessor accessor = (RecipeManagerAccessor) resources.getRecipeManager(); - accessor.bclib_setRecipes(BCLRecipeManager.getMap(accessor.bclib_getRecipes())); - } + private void bclib_injectRecipes() { + RecipeManagerAccessor accessor = (RecipeManagerAccessor) resources.getRecipeManager(); + accessor.bclib_setRecipes(BCLRecipeManager.getMap(accessor.bclib_getRecipes())); + } } diff --git a/src/main/java/ru/bclib/mixin/common/NetherBiomeDataMixin.java b/src/main/java/ru/bclib/mixin/common/NetherBiomeDataMixin.java index 1a941711..36f5933b 100644 --- a/src/main/java/ru/bclib/mixin/common/NetherBiomeDataMixin.java +++ b/src/main/java/ru/bclib/mixin/common/NetherBiomeDataMixin.java @@ -12,8 +12,8 @@ @Mixin(value = NetherBiomeData.class, remap = false) public class NetherBiomeDataMixin { - @Inject(method = "addNetherBiome", at = @At(value = "HEAD")) - private static void bclib_addNetherBiome(ResourceKey biome, Climate.ParameterPoint spawnNoisePoint, CallbackInfo info) { - FabricBiomesData.NETHER_BIOMES.add(biome); - } + @Inject(method = "addNetherBiome", at = @At(value = "HEAD")) + private static void bclib_addNetherBiome(ResourceKey biome, Climate.ParameterPoint spawnNoisePoint, CallbackInfo info) { + FabricBiomesData.NETHER_BIOMES.add(biome); + } } diff --git a/src/main/java/ru/bclib/mixin/common/NoiseGeneratorSettingsMixin.java b/src/main/java/ru/bclib/mixin/common/NoiseGeneratorSettingsMixin.java index 144eacc2..8b3afa9c 100644 --- a/src/main/java/ru/bclib/mixin/common/NoiseGeneratorSettingsMixin.java +++ b/src/main/java/ru/bclib/mixin/common/NoiseGeneratorSettingsMixin.java @@ -3,7 +3,6 @@ import net.minecraft.world.level.levelgen.NoiseGeneratorSettings; import net.minecraft.world.level.levelgen.SurfaceRules; import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource; -import org.apache.commons.codec.language.bm.Rule; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mutable; diff --git a/src/main/java/ru/bclib/mixin/common/SurfaceRulesContextAccessor.java b/src/main/java/ru/bclib/mixin/common/SurfaceRulesContextAccessor.java index 59886394..b1bd7a6b 100644 --- a/src/main/java/ru/bclib/mixin/common/SurfaceRulesContextAccessor.java +++ b/src/main/java/ru/bclib/mixin/common/SurfaceRulesContextAccessor.java @@ -12,39 +12,39 @@ @Mixin(SurfaceRules.Context.class) public interface SurfaceRulesContextAccessor { - @Accessor("blockX") - int getBlockX(); - - @Accessor("blockY") - int getBlockY(); - - @Accessor("blockZ") - int getBlockZ(); - - @Accessor("surfaceDepth") - int getSurfaceDepth(); - - @Accessor("biome") - Supplier getBiome(); - - @Accessor("biomeKey") - Supplier> getBiomeKey(); - - @Accessor("chunk") - ChunkAccess getChunk(); - - @Accessor("noiseChunk") - NoiseChunk getNoiseChunk(); - - @Accessor("stoneDepthAbove") - int getStoneDepthAbove(); - - @Accessor("stoneDepthBelow") - int getStoneDepthBelow(); - - @Accessor("lastUpdateY") - long getLastUpdateY(); - - @Accessor("lastUpdateXZ") - long getLastUpdateXZ(); + @Accessor("blockX") + int getBlockX(); + + @Accessor("blockY") + int getBlockY(); + + @Accessor("blockZ") + int getBlockZ(); + + @Accessor("surfaceDepth") + int getSurfaceDepth(); + + @Accessor("biome") + Supplier getBiome(); + + @Accessor("biomeKey") + Supplier> getBiomeKey(); + + @Accessor("chunk") + ChunkAccess getChunk(); + + @Accessor("noiseChunk") + NoiseChunk getNoiseChunk(); + + @Accessor("stoneDepthAbove") + int getStoneDepthAbove(); + + @Accessor("stoneDepthBelow") + int getStoneDepthBelow(); + + @Accessor("lastUpdateY") + long getLastUpdateY(); + + @Accessor("lastUpdateXZ") + long getLastUpdateXZ(); } diff --git a/src/main/java/ru/bclib/mixin/common/TheEndBiomeDataMixin.java b/src/main/java/ru/bclib/mixin/common/TheEndBiomeDataMixin.java index 93bca16f..ee60a786 100644 --- a/src/main/java/ru/bclib/mixin/common/TheEndBiomeDataMixin.java +++ b/src/main/java/ru/bclib/mixin/common/TheEndBiomeDataMixin.java @@ -12,24 +12,24 @@ @Mixin(value = TheEndBiomeData.class, remap = false) public class TheEndBiomeDataMixin { - @Inject(method = "addEndBiomeReplacement", at = @At(value = "HEAD")) - private static void bclib_addEndBiomeReplacement(ResourceKey replaced, ResourceKey variant, double weight, CallbackInfo info) { - if (replaced == Biomes.END_BARRENS || replaced == Biomes.SMALL_END_ISLANDS) { - FabricBiomesData.END_VOID_BIOMES.put(variant, (float) weight); - } - else { - FabricBiomesData.END_LAND_BIOMES.put(variant, (float) weight); - } - } + @Inject(method = "addEndBiomeReplacement", at = @At(value = "HEAD")) + private static void bclib_addEndBiomeReplacement(ResourceKey replaced, ResourceKey variant, double weight, CallbackInfo info) { + if (replaced == Biomes.END_BARRENS || replaced == Biomes.SMALL_END_ISLANDS) { + FabricBiomesData.END_VOID_BIOMES.put(variant, (float) weight); + } + else { + FabricBiomesData.END_LAND_BIOMES.put(variant, (float) weight); + } + } - @Inject(method = "addEndMidlandsReplacement", at = @At(value = "HEAD")) - private static void bclib_addEndMidlandsReplacement(ResourceKey highlands, ResourceKey midlands, double weight, CallbackInfo info) { - FabricBiomesData.END_LAND_BIOMES.put(midlands, (float) weight); - } + @Inject(method = "addEndMidlandsReplacement", at = @At(value = "HEAD")) + private static void bclib_addEndMidlandsReplacement(ResourceKey highlands, ResourceKey midlands, double weight, CallbackInfo info) { + FabricBiomesData.END_LAND_BIOMES.put(midlands, (float) weight); + } - @Inject(method = "addEndBarrensReplacement", at = @At(value = "HEAD")) - private static void bclib_addEndBarrensReplacement(ResourceKey highlands, ResourceKey barrens, double weight, CallbackInfo info) { - FabricBiomesData.END_LAND_BIOMES.put(barrens, (float) weight); - FabricBiomesData.END_VOID_BIOMES.put(barrens, (float) weight); - } + @Inject(method = "addEndBarrensReplacement", at = @At(value = "HEAD")) + private static void bclib_addEndBarrensReplacement(ResourceKey highlands, ResourceKey barrens, double weight, CallbackInfo info) { + FabricBiomesData.END_LAND_BIOMES.put(barrens, (float) weight); + FabricBiomesData.END_VOID_BIOMES.put(barrens, (float) weight); + } } diff --git a/src/main/java/ru/bclib/recipes/AnvilRecipe.java b/src/main/java/ru/bclib/recipes/AnvilRecipe.java index 4d8eab82..2baf291c 100644 --- a/src/main/java/ru/bclib/recipes/AnvilRecipe.java +++ b/src/main/java/ru/bclib/recipes/AnvilRecipe.java @@ -33,301 +33,299 @@ import java.util.Objects; public class AnvilRecipe implements Recipe, UnknownReceipBookCategory { - public final static String GROUP = "smithing"; - public final static RecipeType TYPE = BCLRecipeManager.registerType(BCLib.MOD_ID, GROUP); - public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer( - BCLib.MOD_ID, - GROUP, - new Serializer() - ); - public final static ResourceLocation ID = BCLib.makeID(GROUP); - - private final ResourceLocation id; - private final Ingredient input; - private final ItemStack output; - private final int damage; - private final int toolLevel; - private final int anvilLevel; - private final int inputCount; - - public AnvilRecipe(ResourceLocation identifier, Ingredient input, ItemStack output, int inputCount, int toolLevel, int anvilLevel, int damage) { - this.id = identifier; - this.input = input; - this.output = output; - this.toolLevel = toolLevel; - this.anvilLevel = anvilLevel; - this.inputCount = inputCount; - this.damage = damage; - } - - public static Builder create(String id) { - return create(BCLib.makeID(id)); - } - - public static Builder create(ResourceLocation id) { - Builder.INSTANCE.id = id; - Builder.INSTANCE.input = null; - Builder.INSTANCE.output = null; - Builder.INSTANCE.inputCount = 1; - Builder.INSTANCE.toolLevel = 1; - Builder.INSTANCE.anvilLevel = 1; - Builder.INSTANCE.damage = 1; - Builder.INSTANCE.alright = true; - Builder.INSTANCE.exist = true; - - return Builder.INSTANCE; - } - - @Override - public RecipeSerializer getSerializer() { - return SERIALIZER; - } - - @Override - public ItemStack getResultItem() { - return this.output; - } - - @Override - public boolean matches(Container craftingInventory, Level world) { - return this.matches(craftingInventory); - } - - @Override - public ItemStack assemble(Container craftingInventory) { - return this.output.copy(); - } - - public ItemStack craft(Container craftingInventory, Player player) { - if (!player.isCreative()) { - if (!checkHammerDurability(craftingInventory, player)) return ItemStack.EMPTY; - ItemStack hammer = craftingInventory.getItem(1); - hammer.hurtAndBreak(this.damage, player, entity -> entity.broadcastBreakEvent((InteractionHand) null)); - } - return this.assemble(craftingInventory); - } - - public boolean checkHammerDurability(Container craftingInventory, Player player) { - if (player.isCreative()) return true; - ItemStack hammer = craftingInventory.getItem(1); - int damage = hammer.getDamageValue() + this.damage; - return damage < hammer.getMaxDamage(); - } - - public boolean matches(Container craftingInventory) { - ItemStack hammer = craftingInventory.getItem(1); - if (hammer.isEmpty() || !TagAPI.ITEM_HAMMERS.contains(hammer.getItem())) { - return false; - } - ItemStack material = craftingInventory.getItem(0); - int materialCount = material.getCount(); - int level = ((TieredItem) hammer.getItem()).getTier().getLevel(); - return this.input.test(craftingInventory.getItem(0)) && materialCount >= this.inputCount && level >= this.toolLevel; - } - - public int getDamage() { - return this.damage; - } - - public int getInputCount() { - return this.inputCount; - } - - public int getAnvilLevel() { - return this.anvilLevel; - } - - @Override - public NonNullList getIngredients() { - NonNullList defaultedList = NonNullList.create(); - defaultedList.add(Ingredient.of(TagAPI.ITEM_HAMMERS - .getValues() - .stream() - .filter(hammer -> ((TieredItem) hammer).getTier().getLevel() >= toolLevel) - .map(ItemStack::new))); - defaultedList.add(input); - return defaultedList; - } - - @Override - @Environment(EnvType.CLIENT) - public boolean canCraftInDimensions(int width, int height) { - return true; - } - - @Override - public ResourceLocation getId() { - return this.id; - } - - @Override - public RecipeType getType() { - return TYPE; - } - - @Override - public boolean isSpecial() { - return true; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - AnvilRecipe that = (AnvilRecipe) o; - return damage == that.damage && toolLevel == that.toolLevel && id.equals(that.id) && input.equals(that.input) && output - .equals(that.output); - } - - @Override - public int hashCode() { - return Objects.hash(id, input, output, damage, toolLevel); - } - - @Override - public String toString() { - return "AnvilRecipe [" + id + "]"; - } - - public static class Builder { - private final static Builder INSTANCE = new Builder(); - - private ResourceLocation id; - private Ingredient input; - private ItemStack output; - private int inputCount = 1; - private int toolLevel = 1; - private int anvilLevel = 1; - private int damage = 1; - private boolean alright; - private boolean exist; - - private Builder() { } - - public Builder setInput(ItemLike... inputItems) { - this.alright &= RecipeHelper.exists(inputItems); - this.setInput(Ingredient.of(inputItems)); - return this; - } - - public Builder setInput(Tag inputTag) { - this.setInput(Ingredient.of(inputTag)); - return this; - } - - public Builder setInput(Ingredient ingredient) { - this.input = ingredient; - return this; - } - - public Builder setInputCount(int count) { - this.inputCount = count; - return this; - } - - public Builder setOutput(ItemLike output) { - return this.setOutput(output, 1); - } - - public Builder setOutput(ItemLike output, int amount) { - this.alright &= RecipeHelper.exists(output); - this.output = new ItemStack(output, amount); - return this; - } - - public Builder setToolLevel(int level) { - this.toolLevel = level; - return this; - } - - public Builder setAnvilLevel(int level) { - this.anvilLevel = level; - return this; - } - - public Builder setDamage(int damage) { - this.damage = damage; - return this; - } - - public Builder checkConfig(PathConfig config) { - exist &= config.getBoolean("anvil", id.getPath(), true); - return this; - } - - public void build() { - if (exist) { - if (input == null) { - BCLib.LOGGER.warning("Input for Anvil recipe can't be 'null', recipe {} will be ignored!", id); - return; - } - if (output == null) { - BCLib.LOGGER.warning("Output for Anvil recipe can't be 'null', recipe {} will be ignored!", id); - return; - } - if (BCLRecipeManager.getRecipe(TYPE, id) != null) { - BCLib.LOGGER.warning("Can't add Anvil recipe! Id {} already exists!", id); - return; - } - if (!alright) { - BCLib.LOGGER.debug("Can't add Anvil recipe {}! Ingeredient or output not exists.", id); - return; - } - BCLRecipeManager.addRecipe( - TYPE, - new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage) - ); - } - } - } - - public static class Serializer implements RecipeSerializer { - @Override - public AnvilRecipe fromJson(ResourceLocation id, JsonObject json) { - Ingredient input = Ingredient.fromJson(json.get("input")); - JsonObject result = GsonHelper.getAsJsonObject(json, "result"); - ItemStack output = ItemUtil.fromJsonRecipe(result); - if (output == null) { - throw new IllegalStateException("Output item does not exists!"); - } - if (result.has("nbt")) { - try { - String nbtData = GsonHelper.getAsString(result, "nbt"); - CompoundTag nbt = TagParser.parseTag(nbtData); - output.setTag(nbt); - } - catch (CommandSyntaxException ex) { - BCLib.LOGGER.warning("Error parse nbt data for output.", ex); - } - } - int inputCount = GsonHelper.getAsInt(json, "inputCount", 1); - int toolLevel = GsonHelper.getAsInt(json, "toolLevel", 1); - int anvilLevel = GsonHelper.getAsInt(json, "anvilLevel", 1); - int damage = GsonHelper.getAsInt(json, "damage", 1); - - return new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage); - } - - @Override - public AnvilRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf packetBuffer) { - Ingredient input = Ingredient.fromNetwork(packetBuffer); - ItemStack output = packetBuffer.readItem(); - int inputCount = packetBuffer.readVarInt(); - int toolLevel = packetBuffer.readVarInt(); - int anvilLevel = packetBuffer.readVarInt(); - int damage = packetBuffer.readVarInt(); - - return new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage); - } - - @Override - public void toNetwork(FriendlyByteBuf packetBuffer, AnvilRecipe recipe) { - recipe.input.toNetwork(packetBuffer); - packetBuffer.writeItem(recipe.output); - packetBuffer.writeVarInt(recipe.inputCount); - packetBuffer.writeVarInt(recipe.toolLevel); - packetBuffer.writeVarInt(recipe.anvilLevel); - packetBuffer.writeVarInt(recipe.damage); - } - } + public final static String GROUP = "smithing"; + public final static RecipeType TYPE = BCLRecipeManager.registerType(BCLib.MOD_ID, GROUP); + public final static Serializer SERIALIZER = BCLRecipeManager.registerSerializer( + BCLib.MOD_ID, + GROUP, + new Serializer() + ); + public final static ResourceLocation ID = BCLib.makeID(GROUP); + + private final ResourceLocation id; + private final Ingredient input; + private final ItemStack output; + private final int damage; + private final int toolLevel; + private final int anvilLevel; + private final int inputCount; + + public AnvilRecipe(ResourceLocation identifier, Ingredient input, ItemStack output, int inputCount, int toolLevel, int anvilLevel, int damage) { + this.id = identifier; + this.input = input; + this.output = output; + this.toolLevel = toolLevel; + this.anvilLevel = anvilLevel; + this.inputCount = inputCount; + this.damage = damage; + } + + public static Builder create(String id) { + return create(BCLib.makeID(id)); + } + + public static Builder create(ResourceLocation id) { + Builder.INSTANCE.id = id; + Builder.INSTANCE.input = null; + Builder.INSTANCE.output = null; + Builder.INSTANCE.inputCount = 1; + Builder.INSTANCE.toolLevel = 1; + Builder.INSTANCE.anvilLevel = 1; + Builder.INSTANCE.damage = 1; + Builder.INSTANCE.alright = true; + Builder.INSTANCE.exist = true; + + return Builder.INSTANCE; + } + + @Override + public RecipeSerializer getSerializer() { + return SERIALIZER; + } + + @Override + public ItemStack getResultItem() { + return this.output; + } + + @Override + public boolean matches(Container craftingInventory, Level world) { + return this.matches(craftingInventory); + } + + @Override + public ItemStack assemble(Container craftingInventory) { + return this.output.copy(); + } + + public ItemStack craft(Container craftingInventory, Player player) { + if (!player.isCreative()) { + if (!checkHammerDurability(craftingInventory, player)) return ItemStack.EMPTY; + ItemStack hammer = craftingInventory.getItem(1); + hammer.hurtAndBreak(this.damage, player, entity -> entity.broadcastBreakEvent((InteractionHand) null)); + } + return this.assemble(craftingInventory); + } + + public boolean checkHammerDurability(Container craftingInventory, Player player) { + if (player.isCreative()) return true; + ItemStack hammer = craftingInventory.getItem(1); + int damage = hammer.getDamageValue() + this.damage; + return damage < hammer.getMaxDamage(); + } + + public boolean matches(Container craftingInventory) { + ItemStack hammer = craftingInventory.getItem(1); + if (hammer.isEmpty() || !TagAPI.ITEM_HAMMERS.contains(hammer.getItem())) { + return false; + } + ItemStack material = craftingInventory.getItem(0); + int materialCount = material.getCount(); + int level = ((TieredItem) hammer.getItem()).getTier().getLevel(); + return this.input.test(craftingInventory.getItem(0)) && materialCount >= this.inputCount && level >= this.toolLevel; + } + + public int getDamage() { + return this.damage; + } + + public int getInputCount() { + return this.inputCount; + } + + public int getAnvilLevel() { + return this.anvilLevel; + } + + @Override + public NonNullList getIngredients() { + NonNullList defaultedList = NonNullList.create(); + defaultedList.add(Ingredient.of(TagAPI.ITEM_HAMMERS + .getValues() + .stream() + .filter(hammer -> ((TieredItem) hammer).getTier().getLevel() >= toolLevel) + .map(ItemStack::new))); + defaultedList.add(input); + return defaultedList; + } + + @Override + @Environment(EnvType.CLIENT) + public boolean canCraftInDimensions(int width, int height) { + return true; + } + + @Override + public ResourceLocation getId() { + return this.id; + } + + @Override + public RecipeType getType() { + return TYPE; + } + + @Override + public boolean isSpecial() { + return true; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + AnvilRecipe that = (AnvilRecipe) o; + return damage == that.damage && toolLevel == that.toolLevel && id.equals(that.id) && input.equals(that.input) && output.equals(that.output); + } + + @Override + public int hashCode() { + return Objects.hash(id, input, output, damage, toolLevel); + } + + @Override + public String toString() { + return "AnvilRecipe [" + id + "]"; + } + + public static class Builder { + private final static Builder INSTANCE = new Builder(); + + private ResourceLocation id; + private Ingredient input; + private ItemStack output; + private int inputCount = 1; + private int toolLevel = 1; + private int anvilLevel = 1; + private int damage = 1; + private boolean alright; + private boolean exist; + + private Builder() {} + + public Builder setInput(ItemLike... inputItems) { + this.alright &= RecipeHelper.exists(inputItems); + this.setInput(Ingredient.of(inputItems)); + return this; + } + + public Builder setInput(Tag inputTag) { + this.setInput(Ingredient.of(inputTag)); + return this; + } + + public Builder setInput(Ingredient ingredient) { + this.input = ingredient; + return this; + } + + public Builder setInputCount(int count) { + this.inputCount = count; + return this; + } + + public Builder setOutput(ItemLike output) { + return this.setOutput(output, 1); + } + + public Builder setOutput(ItemLike output, int amount) { + this.alright &= RecipeHelper.exists(output); + this.output = new ItemStack(output, amount); + return this; + } + + public Builder setToolLevel(int level) { + this.toolLevel = level; + return this; + } + + public Builder setAnvilLevel(int level) { + this.anvilLevel = level; + return this; + } + + public Builder setDamage(int damage) { + this.damage = damage; + return this; + } + + public Builder checkConfig(PathConfig config) { + exist &= config.getBoolean("anvil", id.getPath(), true); + return this; + } + + public void build() { + if (exist) { + return; + } + + if (input == null) { + BCLib.LOGGER.warning("Input for Anvil recipe can't be 'null', recipe {} will be ignored!", id); + return; + } + if (output == null) { + BCLib.LOGGER.warning("Output for Anvil recipe can't be 'null', recipe {} will be ignored!", id); + return; + } + if (BCLRecipeManager.getRecipe(TYPE, id) != null) { + BCLib.LOGGER.warning("Can't add Anvil recipe! Id {} already exists!", id); + return; + } + if (!alright) { + BCLib.LOGGER.debug("Can't add Anvil recipe {}! Ingeredient or output not exists.", id); + return; + } + BCLRecipeManager.addRecipe(TYPE, new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage)); + } + } + + public static class Serializer implements RecipeSerializer { + @Override + public AnvilRecipe fromJson(ResourceLocation id, JsonObject json) { + Ingredient input = Ingredient.fromJson(json.get("input")); + JsonObject result = GsonHelper.getAsJsonObject(json, "result"); + ItemStack output = ItemUtil.fromJsonRecipe(result); + if (output == null) { + throw new IllegalStateException("Output item does not exists!"); + } + if (result.has("nbt")) { + try { + String nbtData = GsonHelper.getAsString(result, "nbt"); + CompoundTag nbt = TagParser.parseTag(nbtData); + output.setTag(nbt); + } + catch (CommandSyntaxException ex) { + BCLib.LOGGER.warning("Error parse nbt data for output.", ex); + } + } + int inputCount = GsonHelper.getAsInt(json, "inputCount", 1); + int toolLevel = GsonHelper.getAsInt(json, "toolLevel", 1); + int anvilLevel = GsonHelper.getAsInt(json, "anvilLevel", 1); + int damage = GsonHelper.getAsInt(json, "damage", 1); + + return new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage); + } + + @Override + public AnvilRecipe fromNetwork(ResourceLocation id, FriendlyByteBuf packetBuffer) { + Ingredient input = Ingredient.fromNetwork(packetBuffer); + ItemStack output = packetBuffer.readItem(); + int inputCount = packetBuffer.readVarInt(); + int toolLevel = packetBuffer.readVarInt(); + int anvilLevel = packetBuffer.readVarInt(); + int damage = packetBuffer.readVarInt(); + + return new AnvilRecipe(id, input, output, inputCount, toolLevel, anvilLevel, damage); + } + + @Override + public void toNetwork(FriendlyByteBuf packetBuffer, AnvilRecipe recipe) { + recipe.input.toNetwork(packetBuffer); + packetBuffer.writeItem(recipe.output); + packetBuffer.writeVarInt(recipe.inputCount); + packetBuffer.writeVarInt(recipe.toolLevel); + packetBuffer.writeVarInt(recipe.anvilLevel); + packetBuffer.writeVarInt(recipe.damage); + } + } } diff --git a/src/main/java/ru/bclib/recipes/FurnaceRecipe.java b/src/main/java/ru/bclib/recipes/FurnaceRecipe.java index a1986232..194aaf3e 100644 --- a/src/main/java/ru/bclib/recipes/FurnaceRecipe.java +++ b/src/main/java/ru/bclib/recipes/FurnaceRecipe.java @@ -9,7 +9,6 @@ import net.minecraft.world.item.crafting.SmeltingRecipe; import net.minecraft.world.item.crafting.SmokingRecipe; import net.minecraft.world.level.ItemLike; -import ru.bclib.BCLib; import ru.bclib.config.PathConfig; public class FurnaceRecipe { @@ -77,54 +76,53 @@ public void buildFoodlike() { public void build(boolean blasting, boolean campfire, boolean smoker) { if (exist) { - SmeltingRecipe recipe = new SmeltingRecipe( + return; + } + + SmeltingRecipe recipe = new SmeltingRecipe( + id, + group, + Ingredient.of(input), + new ItemStack(output, count), + xp, + time + ); + BCLRecipeManager.addRecipe(RecipeType.SMELTING, recipe); + + if (blasting) { + BlastingRecipe recipe2 = new BlastingRecipe( + id, + group, + Ingredient.of(input), + new ItemStack(output, count), + xp, + time / 2 + ); + BCLRecipeManager.addRecipe(RecipeType.BLASTING, recipe2); + } + + if (campfire) { + CampfireCookingRecipe recipe2 = new CampfireCookingRecipe( id, group, Ingredient.of(input), new ItemStack(output, count), xp, - time + time * 3 ); - BCLRecipeManager.addRecipe(RecipeType.SMELTING, recipe); - - if (blasting) { - BlastingRecipe recipe2 = new BlastingRecipe( - id, - group, - Ingredient.of(input), - new ItemStack(output, count), - xp, - time / 2 - ); - BCLRecipeManager.addRecipe(RecipeType.BLASTING, recipe2); - } - - if (campfire) { - CampfireCookingRecipe recipe2 = new CampfireCookingRecipe( - id, - group, - Ingredient.of(input), - new ItemStack(output, count), - xp, - time * 3 - ); - BCLRecipeManager.addRecipe(RecipeType.CAMPFIRE_COOKING, recipe2); - } - - if (smoker) { - SmokingRecipe recipe2 = new SmokingRecipe( - id, - group, - Ingredient.of(input), - new ItemStack(output, count), - xp, - time / 2 - ); - BCLRecipeManager.addRecipe(RecipeType.SMOKING, recipe2); - } + BCLRecipeManager.addRecipe(RecipeType.CAMPFIRE_COOKING, recipe2); } - else { - BCLib.LOGGER.debug("Furnace recipe {} couldn't be added", id); + + if (smoker) { + SmokingRecipe recipe2 = new SmokingRecipe( + id, + group, + Ingredient.of(input), + new ItemStack(output, count), + xp, + time / 2 + ); + BCLRecipeManager.addRecipe(RecipeType.SMOKING, recipe2); } } } diff --git a/src/main/java/ru/bclib/recipes/GridRecipe.java b/src/main/java/ru/bclib/recipes/GridRecipe.java index 95d68cfb..4a1c6155 100644 --- a/src/main/java/ru/bclib/recipes/GridRecipe.java +++ b/src/main/java/ru/bclib/recipes/GridRecipe.java @@ -12,7 +12,6 @@ import net.minecraft.world.item.crafting.ShapedRecipe; import net.minecraft.world.item.crafting.ShapelessRecipe; import net.minecraft.world.level.ItemLike; -import ru.bclib.BCLib; import ru.bclib.config.PathConfig; import java.util.Arrays; @@ -30,7 +29,7 @@ public class GridRecipe { private String[] shape; private Map materialKeys = Maps.newHashMap(); private int count; - private boolean exist = true; + private boolean exist; private GridRecipe() {} @@ -114,24 +113,23 @@ private NonNullList getMaterials(int width, int height) { } public void build() { - if (exist) { - int height = shape.length; - int width = shape[0].length(); - ItemStack result = new ItemStack(output, count); - NonNullList materials = this.getMaterials(width, height); - - CraftingRecipe recipe = shaped ? new ShapedRecipe( - id, - group, - width, - height, - materials, - result - ) : new ShapelessRecipe(id, group, result, materials); - BCLRecipeManager.addRecipe(type, recipe); - } - else { - BCLib.LOGGER.debug("Recipe {} couldn't be added", id); + if (!exist) { + return; } + + int height = shape.length; + int width = shape[0].length(); + ItemStack result = new ItemStack(output, count); + NonNullList materials = this.getMaterials(width, height); + + CraftingRecipe recipe = shaped ? new ShapedRecipe( + id, + group, + width, + height, + materials, + result + ) : new ShapelessRecipe(id, group, result, materials); + BCLRecipeManager.addRecipe(type, recipe); } } diff --git a/src/main/java/ru/bclib/recipes/SmithingTableRecipe.java b/src/main/java/ru/bclib/recipes/SmithingTableRecipe.java index 464ed15d..dc9ad9b7 100644 --- a/src/main/java/ru/bclib/recipes/SmithingTableRecipe.java +++ b/src/main/java/ru/bclib/recipes/SmithingTableRecipe.java @@ -25,7 +25,7 @@ public static SmithingTableRecipe create(ResourceLocation id) { BUILDER.base = null; BUILDER.addition = null; BUILDER.result = null; - BUILDER.alright = true; + BUILDER.exist = true; return BUILDER; } @@ -34,7 +34,6 @@ public static SmithingTableRecipe create(ResourceLocation id) { private Ingredient base; private Ingredient addition; private ItemStack result; - private boolean alright; private boolean exist; private SmithingTableRecipe() {} @@ -49,13 +48,13 @@ public SmithingTableRecipe setResult(ItemLike item) { } public SmithingTableRecipe setResult(ItemLike item, int count) { - this.alright &= BCLRecipeManager.exists(item); + this.exist &= BCLRecipeManager.exists(item); this.result = new ItemStack(item, count); return this; } public SmithingTableRecipe setBase(ItemLike... items) { - this.alright &= BCLRecipeManager.exists(items); + this.exist &= BCLRecipeManager.exists(items); this.base = Ingredient.of(items); return this; } @@ -66,7 +65,7 @@ public SmithingTableRecipe setBase(Tag tag) { } public SmithingTableRecipe setAddition(ItemLike... items) { - this.alright &= BCLRecipeManager.exists(items); + this.exist &= BCLRecipeManager.exists(items); this.addition = Ingredient.of(items); return this; } @@ -97,10 +96,7 @@ public void build() { BCLib.LOGGER.warning("Can't add Smithing recipe! Id {} already exists!", id); return; } - if (!alright) { - BCLib.LOGGER.debug("Can't add Smithing recipe {}! Ingeredients or output not exists.", id); - return; - } + BCLRecipeManager.addRecipe(TYPE, new UpgradeRecipe(id, base, addition, result)); } } diff --git a/src/main/java/ru/bclib/util/BlocksHelper.java b/src/main/java/ru/bclib/util/BlocksHelper.java index 1ba8952a..6bf7c8b1 100644 --- a/src/main/java/ru/bclib/util/BlocksHelper.java +++ b/src/main/java/ru/bclib/util/BlocksHelper.java @@ -94,7 +94,7 @@ public static int raycastSqr(LevelAccessor world, BlockPos pos, int dx, int dy, /** * Rotates {@link BlockState} horizontally. Used in block classes with {@link Direction} {@link Property} in rotate function. * - * @param state - {@link BlockState} to mirror; + * @param state - {@link BlockState} to mirror; * @param rotation - {@link Rotation}; * @param facing - Block {@link Direction} {@link Property}. * @return Rotated {@link BlockState}. diff --git a/src/main/java/ru/bclib/util/PathUtil.java b/src/main/java/ru/bclib/util/PathUtil.java index ddd0c8f1..e66b98ba 100644 --- a/src/main/java/ru/bclib/util/PathUtil.java +++ b/src/main/java/ru/bclib/util/PathUtil.java @@ -45,9 +45,9 @@ public static boolean isChildOf(Path parent, Path child) { /** * A simple directory walker that ignores dot-files * - * @param path The path where you want to start + * @param path The path where you want to start * @param pathConsumer The consumer called for each valid file. The consumer will get an absolute {@link Path}-Object - * for each visited file + * for each visited file */ public static void fileWalker(File path, Consumer pathConsumer) { fileWalker(path, true, pathConsumer); @@ -56,10 +56,10 @@ public static void fileWalker(File path, Consumer pathConsumer) { /** * A simple directory walker that ignores dot-files * - * @param path The path where you want to start - * @param recursive if {@code false}, only the {@code path} is traversed + * @param path The path where you want to start + * @param recursive if {@code false}, only the {@code path} is traversed * @param pathConsumer The consumer called for each valid file. The consumer will get an absolute {@link Path}-Object - * for each visited file + * for each visited file */ public static void fileWalker(File path, boolean recursive, Consumer pathConsumer) { if (!path.exists()) return; diff --git a/src/main/java/ru/bclib/util/TranslationHelper.java b/src/main/java/ru/bclib/util/TranslationHelper.java index d85a07ba..59116a59 100644 --- a/src/main/java/ru/bclib/util/TranslationHelper.java +++ b/src/main/java/ru/bclib/util/TranslationHelper.java @@ -73,12 +73,12 @@ public static void printMissingNames(String modID, String languageCode) { if (!missingNames.isEmpty()) { System.out.println("========================================"); - System.out.println(" MISSING NAMES LIST"); + System.out.println(" MISSING NAMES LIST"); if (!missingNames.isEmpty()) { if (languageCode.equals("en_us")) { System.out.println("========================================"); - System.out.println(" AUTO ENGLISH BEAUTIFICATION"); + System.out.println(" AUTO ENGLISH BEAUTIFICATION"); System.out.println("========================================"); missingNames.stream().sorted().forEach(name -> { System.out.println(" \"" + name + "\": \"" + fastTranslateEn(name) + "\","); @@ -86,7 +86,7 @@ public static void printMissingNames(String modID, String languageCode) { } else { System.out.println("========================================"); - System.out.println(" TEMPLATE: [" + languageCode + "]"); + System.out.println(" TEMPLATE: [" + languageCode + "]"); System.out.println("========================================"); missingNames.stream().sorted().forEach(name -> { System.out.println(" \"" + name + "\": \"\","); diff --git a/src/main/java/ru/bclib/world/features/BCLFeature.java b/src/main/java/ru/bclib/world/features/BCLFeature.java index 6468be84..ea033fa5 100644 --- a/src/main/java/ru/bclib/world/features/BCLFeature.java +++ b/src/main/java/ru/bclib/world/features/BCLFeature.java @@ -102,7 +102,7 @@ public static BCLFeature makeOreFeature(ResourceLocation id, Block blockOre, Blo * @param veins iterations per chunk. * @param veinSize size of ore vein. * @param minY A {@link VerticalAnchor} for the minimum height, for example - * {@code VerticalAnchor.bottom()}, {@code VerticalAnchor.absolute(10)}, {@code VerticalAnchor.aboveBottom(10)} + * {@code VerticalAnchor.bottom()}, {@code VerticalAnchor.absolute(10)}, {@code VerticalAnchor.aboveBottom(10)} * @param maxY A {@link VerticalAnchor} for the maximum height. * @return new BCLFeature instance. */ @@ -113,15 +113,15 @@ public static BCLFeature makeOreFeature(ResourceLocation id, Block blockOre, Blo /** * Will create a basic ore feature. * - * @param id {@link ResourceLocation} feature ID. + * @param id {@link ResourceLocation} feature ID. * @param blockOre {@link Decoration} feature step. * @param hostBlock {@link Block} to generate feature in. - * @param veins iterations per chunk. + * @param veins iterations per chunk. * @param veinSize size of ore vein. * @param minY A {@link VerticalAnchor} for the minimum height, for example - * {@code VerticalAnchor.bottom()}, {@code VerticalAnchor.absolute(10)}, {@code VerticalAnchor.aboveBottom(10)} + * {@code VerticalAnchor.bottom()}, {@code VerticalAnchor.absolute(10)}, {@code VerticalAnchor.aboveBottom(10)} * @param maxY A {@link VerticalAnchor} for the maximum height. - * @param rare when true, this is placed as a rare resource + * @param rare when true, this is placed as a rare resource * @return new BCLFeature instance. */ public static BCLFeature makeOreFeature(ResourceLocation id, Block blockOre, Block hostBlock, int veins, int veinSize, VerticalAnchor minY, VerticalAnchor maxY, boolean rare) { @@ -131,14 +131,14 @@ public static BCLFeature makeOreFeature(ResourceLocation id, Block blockOre, Blo /** * Will create a basic ore feature. * - * @param id {@link ResourceLocation} feature ID. + * @param id {@link ResourceLocation} feature ID. * @param blockOre {@link Decoration} feature step. * @param hostBlock {@link Block} to generate feature in. - * @param veins iterations per chunk. + * @param veins iterations per chunk. * @param veinSize size of ore vein. * @param placement {@link net.minecraft.world.level.levelgen.placement.PlacementModifier} for the ore distribution, - * for example {@code PlacementUtils.FULL_RANGE}, {@code PlacementUtils.RANGE_10_10} - * @param rare when true, this is placed as a rare resource + * for example {@code PlacementUtils.FULL_RANGE}, {@code PlacementUtils.RANGE_10_10} + * @param rare when true, this is placed as a rare resource * @return new BCLFeature instance. */ public static BCLFeature makeOreFeature(ResourceLocation id, Block blockOre, Block hostBlock, int veins, int veinSize, PlacementModifier placement, boolean rare) { diff --git a/src/main/java/ru/bclib/world/generator/BCLBiomeSource.java b/src/main/java/ru/bclib/world/generator/BCLBiomeSource.java index 9c8d8b8d..f9db3a37 100644 --- a/src/main/java/ru/bclib/world/generator/BCLBiomeSource.java +++ b/src/main/java/ru/bclib/world/generator/BCLBiomeSource.java @@ -8,20 +8,20 @@ import java.util.List; public abstract class BCLBiomeSource extends BiomeSource { - protected final Registry biomeRegistry; - protected final long seed; + protected final Registry biomeRegistry; + protected final long seed; - private static List preInit(Registry biomeRegistry, List biomes){ - biomes.forEach(biome -> BiomeAPI.sortBiomeFeatures(biome)); - return biomes; - } + private static List preInit(Registry biomeRegistry, List biomes){ + biomes.forEach(biome -> BiomeAPI.sortBiomeFeatures(biome)); + return biomes; + } - protected BCLBiomeSource(Registry biomeRegistry, long seed, List list) { - super(preInit(biomeRegistry, list)); + protected BCLBiomeSource(Registry biomeRegistry, long seed, List list) { + super(preInit(biomeRegistry, list)); - this.seed = seed; - this.biomeRegistry = biomeRegistry; + this.seed = seed; + this.biomeRegistry = biomeRegistry; - BiomeAPI.initRegistry(biomeRegistry); - } + BiomeAPI.initRegistry(biomeRegistry); + } } diff --git a/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java b/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java index 8be7fafa..006ea5b1 100644 --- a/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java +++ b/src/main/java/ru/bclib/world/generator/BCLibNetherBiomeSource.java @@ -32,20 +32,20 @@ public class BCLibNetherBiomeSource extends BCLBiomeSource { }); private BiomeMap biomeMap; - private static boolean forceLegacyGenerator = false; + private static boolean forceLegacyGenerator = false; private static int lastWorldHeight; private static int worldHeight; - /** - * When true, the older square generator is used for the nether. + /** + * When true, the older square generator is used for the nether. * * This override is used (for example) by BetterNether to force the legacy generation for worlds * that were created before 1.18 - * @param val wether or not you want to force the old generatore. - */ - public static void setForceLegacyGeneration(boolean val){ - forceLegacyGenerator = val; - } + * @param val wether or not you want to force the old generatore. + */ + public static void setForceLegacyGeneration(boolean val){ + forceLegacyGenerator = val; + } /** * Set world height, used when Nether is larger than vanilla 128 blocks tall. diff --git a/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceNoiseCondition.java b/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceNoiseCondition.java index e7405c35..3ec4d123 100644 --- a/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceNoiseCondition.java +++ b/src/main/java/ru/bclib/world/surface/DoubleBlockSurfaceNoiseCondition.java @@ -6,29 +6,29 @@ import ru.bclib.util.MHelper; public class DoubleBlockSurfaceNoiseCondition extends SurfaceNoiseCondition { - public static final DoubleBlockSurfaceNoiseCondition CONDITION = new DoubleBlockSurfaceNoiseCondition(0); - private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(4141); + public static final DoubleBlockSurfaceNoiseCondition CONDITION = new DoubleBlockSurfaceNoiseCondition(0); + private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(4141); - private final double threshold; - public DoubleBlockSurfaceNoiseCondition(double threshold){ - this.threshold = threshold; - } + private final double threshold; + public DoubleBlockSurfaceNoiseCondition(double threshold){ + this.threshold = threshold; + } - private static int lastX = Integer.MIN_VALUE; - private static int lastZ = Integer.MIN_VALUE; - private static double lastValue = 0; + private static int lastX = Integer.MIN_VALUE; + private static int lastZ = Integer.MIN_VALUE; + private static double lastValue = 0; - @Override - public boolean test(SurfaceRulesContextAccessor context) { - final int x = context.getBlockX(); - final int z = context.getBlockZ(); - if (lastX==x && lastZ==z) return lastValue > threshold; + @Override + public boolean test(SurfaceRulesContextAccessor context) { + final int x = context.getBlockX(); + final int z = context.getBlockZ(); + if (lastX==x && lastZ==z) return lastValue > threshold; - double value = NOISE.eval(x * 0.1, z * 0.1) + MHelper.randRange(-0.4, 0.4, MHelper.RANDOM); + double value = NOISE.eval(x * 0.1, z * 0.1) + MHelper.randRange(-0.4, 0.4, MHelper.RANDOM); - lastX=x; - lastZ=z; - lastValue=value; - return value > threshold; - } + lastX=x; + lastZ=z; + lastValue=value; + return value > threshold; + } } diff --git a/src/main/resources/assets/bclib/lang/en_us.json b/src/main/resources/assets/bclib/lang/en_us.json index 68aa85bc..befb9bef 100644 --- a/src/main/resources/assets/bclib/lang/en_us.json +++ b/src/main/resources/assets/bclib/lang/en_us.json @@ -16,7 +16,7 @@ "title.bclib.confirmrestart": "Restart Required", "message.bclib.confirmrestart": "The requested content was synchronized. You need to restart Minecraft now.", "title.link.bclib.discord": "Discord", - "title.bclib.modmenu.main": "BCLib Settings", + "title.bclib.modmenu.main": "BCLib Settings", "title.bclib.progress": "Progress", "title.bclib.filesync.progress": "File Transfer", "message.bclib.filesync.progress": "Syncing File-Content with Server", diff --git a/src/main/resources/assets/bclib/lang/ko_kr.json b/src/main/resources/assets/bclib/lang/ko_kr.json index dddcd4f9..45556bcb 100644 --- a/src/main/resources/assets/bclib/lang/ko_kr.json +++ b/src/main/resources/assets/bclib/lang/ko_kr.json @@ -16,7 +16,7 @@ "title.bclib.confirmrestart": "재시작 필요", "message.bclib.confirmrestart": "요청한 콘텐츠가 동기화되었습니다. 지금 마인크래프트를 다시 시작해야 합니다.", "title.link.bclib.discord": "디스코드", - "title.bclib.modmenu.main": "BCLib 환경설정", + "title.bclib.modmenu.main": "BCLib 환경설정", "title.bclib.progress": "진행", "title.bclib.filesync.progress": "파일 전송", "message.bclib.filesync.progress": "파일 내용을 서버와 동기화하는 중", diff --git a/src/main/resources/assets/bclib/shaders/material/alpha_emission.frag b/src/main/resources/assets/bclib/shaders/material/alpha_emission.frag index 32ae9482..23835661 100644 --- a/src/main/resources/assets/bclib/shaders/material/alpha_emission.frag +++ b/src/main/resources/assets/bclib/shaders/material/alpha_emission.frag @@ -3,7 +3,7 @@ // Value near 254 bool isEmissive(float alpha) { - return 0.9960 < alpha && alpha < 0.9962; + return 0.9960 < alpha && alpha < 0.9962; } void frx_startFragment(inout frx_FragmentData fragData) { diff --git a/src/main/resources/assets/minecraft/shaders/core/rendertype_cutout.fsh b/src/main/resources/assets/minecraft/shaders/core/rendertype_cutout.fsh index c14819e8..873323eb 100644 --- a/src/main/resources/assets/minecraft/shaders/core/rendertype_cutout.fsh +++ b/src/main/resources/assets/minecraft/shaders/core/rendertype_cutout.fsh @@ -32,7 +32,7 @@ vec3 hsvToRGB(vec3 color) { // Value near 254 bool isEmissive(float alpha) { - return 0.9960 < alpha && alpha < 0.9962; + return 0.9960 < alpha && alpha < 0.9962; } void main() { diff --git a/src/main/resources/assets/minecraft/shaders/core/rendertype_entity_cutout.fsh b/src/main/resources/assets/minecraft/shaders/core/rendertype_entity_cutout.fsh index 3e3e352f..5fbf58b5 100644 --- a/src/main/resources/assets/minecraft/shaders/core/rendertype_entity_cutout.fsh +++ b/src/main/resources/assets/minecraft/shaders/core/rendertype_entity_cutout.fsh @@ -34,7 +34,7 @@ vec3 hsvToRGB(vec3 color) { // Value near 254 bool isEmissive(float alpha) { - return 0.9960 < alpha && alpha < 0.9962; + return 0.9960 < alpha && alpha < 0.9962; } void main() { diff --git a/src/main/resources/assets/minecraft/shaders/core/rendertype_item_entity_translucent_cull.fsh b/src/main/resources/assets/minecraft/shaders/core/rendertype_item_entity_translucent_cull.fsh index 453e467f..c2cefa02 100644 --- a/src/main/resources/assets/minecraft/shaders/core/rendertype_item_entity_translucent_cull.fsh +++ b/src/main/resources/assets/minecraft/shaders/core/rendertype_item_entity_translucent_cull.fsh @@ -33,7 +33,7 @@ vec3 hsvToRGB(vec3 color) { // Value near 254 bool isEmissive(float alpha) { - return 0.9960 < alpha && alpha < 0.9962; + return 0.9960 < alpha && alpha < 0.9962; } void main() { diff --git a/src/main/resources/assets/minecraft/shaders/core/rendertype_solid.fsh b/src/main/resources/assets/minecraft/shaders/core/rendertype_solid.fsh index 95c1a52f..421b864a 100644 --- a/src/main/resources/assets/minecraft/shaders/core/rendertype_solid.fsh +++ b/src/main/resources/assets/minecraft/shaders/core/rendertype_solid.fsh @@ -32,7 +32,7 @@ vec3 hsvToRGB(vec3 color) { // Value near 254 bool isEmissive(float alpha) { - return 0.9960 < alpha && alpha < 0.9962; + return 0.9960 < alpha && alpha < 0.9962; } void main() { diff --git a/src/main/resources/bclib.accesswidener b/src/main/resources/bclib.accesswidener index 851b44f6..9fc24c46 100644 --- a/src/main/resources/bclib.accesswidener +++ b/src/main/resources/bclib.accesswidener @@ -1,10 +1,10 @@ accessWidener v1 named # Classes -accessible class net/minecraft/client/Minecraft$ExperimentalDialogType -accessible class net/minecraft/world/level/levelgen/SurfaceRules$Context -accessible class net/minecraft/world/level/levelgen/SurfaceRules$Condition -accessible class net/minecraft/world/level/levelgen/SurfaceRules$SurfaceRule -accessible class net/minecraft/world/level/levelgen/SurfaceRules$LazyXZCondition -accessible class net/minecraft/world/level/levelgen/SurfaceRules$LazyCondition -accessible class net/minecraft/world/level/levelgen/SurfaceRules$SequenceRuleSource \ No newline at end of file +accessible class net/minecraft/client/Minecraft$ExperimentalDialogType +accessible class net/minecraft/world/level/levelgen/SurfaceRules$Context +accessible class net/minecraft/world/level/levelgen/SurfaceRules$Condition +accessible class net/minecraft/world/level/levelgen/SurfaceRules$SurfaceRule +accessible class net/minecraft/world/level/levelgen/SurfaceRules$LazyXZCondition +accessible class net/minecraft/world/level/levelgen/SurfaceRules$LazyCondition +accessible class net/minecraft/world/level/levelgen/SurfaceRules$SequenceRuleSource \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 0aa6b2c6..41071b0d 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -26,10 +26,10 @@ "server": [ "ru.bclib.server.BCLibServer" ], - "modmenu": [ "ru.bclib.gui.modmenu.EntryPoint::entrypointObject" ] + "modmenu": [ "ru.bclib.gui.modmenu.EntryPoint::entrypointObject" ] }, - "accessWidener" : "bclib.accesswidener", - "mixins": [ + "accessWidener" : "bclib.accesswidener", + "mixins": [ "bclib.mixins.common.json", "bclib.mixins.client.json" ], @@ -37,12 +37,12 @@ "fabricloader": ">=0.12.9", "fabric": ">=0.44.0", "minecraft": ">=1.18.1" - }, - "custom":{ - "modmenu":{ - "links":{ - "title.link.bclib.discord":"https://discord.gg/kYuATbYbKW" - } - } - } + }, + "custom":{ + "modmenu":{ + "links":{ + "title.link.bclib.discord":"https://discord.gg/kYuATbYbKW" + } + } + } }
DescriptionDescription
Server