Add Niard (#148) #1096
No reviewers
Labels
No labels
Area-Assets
Area-Backend
Area-Conduits
Area-Datapacks
Area-Lang
Area-Mod Compat
Area-Parity
Area-Rendering
Good first issue
MC-1.19.2
MC-1.20.1
MC-1.20.4
MC-1.20.6
MC-1.21
MC-1.21.1
Modtoberfest
P-0-High
P-1-Medium
P-2-Low
Status-Awaiting Response
Status-Behind-Flag
Status-Blocked
Status-Cannot Reproduce
Status-Duplicate
Status-Help Wanted
Status-Incomplete Report
Status-Invalid
Status-Needs LTS Backport
Status-Needs Updating
Status-Stale
Status-To Implement
Status-Triage
Status-Wontfix
Status-Wontmerge
Type-Backport
Type-Bug
Type-Documentation
Type-Enhancement
Type-Question
Type-RFC
Type-Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Team-EnderIO/EnderIO#1096
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/148-niard-reverse-drain"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Added the Niard Block. This block places fluid around it in a given range when supplied with power and a fluid.
TODO
Changes
I made some util classes to reuse some of the Fluid Tank logic for the Niard
Checklist
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Configuration
Documentation
Chores
Walkthrough
This update introduces a new machine called the "Niard" with full block, entity, menu, GUI, configuration, and recipe integration. It refactors internal fluid tank logic, adds range-based fluid placement mechanics, registers all necessary assets and configuration entries, and provides crafting and block model resources for the new machine.
Changes
.../niard/NiardBlockEntity.java
.../niard/NiardMenu.java
.../niard/NiardRangeIterator.java
.../niard/package-info.java
.../common/blocks/fluid_tank/InternalTankTasks.java
.../client/rendering/item/FluidTankBEWLR.java
.../core/client/FluidRendererUtil.java
.../client/rendering/blockentity/NiardBER.java
Sequence Diagram(s)
Possibly related PRs
Suggested labels
Area-Backend,MC-1.21.1Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
I pushed a fix in commit <commit_id>, please review it.Explain this complex logic.Open a follow-up GitHub issue for this discussion.@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read src/utils.ts and explain its main purpose.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.@coderabbitai help me debug CodeRabbit configuration file.Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.Other keywords and placeholders
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed.@coderabbitai summaryto generate the high-level summary at a specific location in the PR description.@coderabbitaianywhere in the PR title to generate the title automatically.CodeRabbit Configuration File (
.coderabbit.yaml).coderabbit.yamlfile to the root of your repository.# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.jsonDocumentation and Community
Actionable comments posted: 4
🧹 Nitpick comments (6)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
84bfe2477aand467e4bd9f9.⛔ Files ignored due to path filters (10)
enderio-machines/src/generated/resources/assets/enderio/blockstates/niard.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/assets/enderio/lang/en_us.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/assets/enderio/models/block/niard_combined.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/assets/enderio/models/item/niard.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/data/enderio/advancement/recipes/misc/erase_niard.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/data/enderio/advancement/recipes/misc/niard.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/data/enderio/loot_table/blocks/niard.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/data/enderio/recipe/erase_niard.jsonis excluded by!**/generated/**enderio-machines/src/generated/resources/data/enderio/recipe/niard.jsonis excluded by!**/generated/**enderio-machines/src/main/resources/assets/enderio/textures/block/niard_front.pngis excluded by!**/*.png📒 Files selected for processing (16)
enderio-machines/src/main/java/com/enderio/machines/client/gui/screen/NiardScreen.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/fluid_tank/FluidTankBlockEntity.java(2 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/fluid_tank/InternalTankTasks.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardBlock.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardBlockEntity.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardMenu.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardRangeIterator.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/package-info.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/config/MachinesConfigLang.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/config/client/MachinesClientBlocksConfig.java(2 hunks)enderio-machines/src/main/java/com/enderio/machines/common/config/common/EnergyConfig.java(2 hunks)enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java(2 hunks)enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java(2 hunks)enderio-machines/src/main/java/com/enderio/machines/common/init/MachineMenus.java(3 hunks)enderio-machines/src/main/java/com/enderio/machines/data/recipes/MachineRecipeProvider.java(2 hunks)enderio-machines/src/main/resources/assets/enderio/models/block/niard.json(1 hunks)🧰 Additional context used
🧬 Code Graph Analysis (5)
enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java (2)
enderio-machines/src/main/java/com/enderio/machines/common/init/MachineMenus.java (2)
enderio-machines/src/main/java/com/enderio/machines/common/blocks/fluid_tank/FluidTankBlockEntity.java (1)
enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardMenu.java (5)
enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardBlock.java (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (23)
@ -0,0 +1,130 @@package com.enderio.machines.client.gui.screen;⚠️ Potential issue
Use NiardMenu button IDs instead of DrainMenu constants.
The code is using button IDs from
DrainMenuwhich breaks encapsulation. Replace with the corresponding constants fromNiardMenu.📝 Committable suggestion
🤖 Prompt for AI Agents
@ -216,76 +213,21 @@ public abstract class FluidTankBlockEntity extends MachineBlockEntity implementsreturn TANK.getTank(this);⚠️ Potential issue
Fix incorrect parameter in tryMendTool delegation.
The last parameter should be
FLUID_DRAIN_OUTPUTinstead ofFLUID_FILL_INPUTto match the expected slot for the mended tool output.🤖 Prompt for AI Agents
@ -0,0 +119,4 @@if (fluid == Fluids.EMPTY) return;BlockState fluidBlockState = fluid.defaultFluidState().createLegacyBlock();level.setBlock(pos, fluidBlockState, Block.UPDATE_ALL);💡 Verification agent
🧩 Analysis chain
Verify the use of createLegacyBlock() for fluid placement.
The method name suggests this might be a legacy approach. Ensure this is the correct method for placing fluid blocks in the current Minecraft version.
🌐 Web query:
💡 Result:
In recent versions of Minecraft modding, particularly with Forge, the recommended approach for placing fluid blocks has evolved. The
createLegacyBlock()method, which was previously used to create aBlockStatefrom aFluidState, is now considered deprecated. This deprecation indicates that there is a newer, preferred method for handling fluid block placement.The current best practice involves using the
FluidBlockclass, which is designed to handle fluid block behavior more effectively. For example, in Forge 1.20.6, theFluidBlockclass provides methods likegetFluidState()to retrieve the fluid state associated with the block. This approach offers a more streamlined and efficient way to manage fluid blocks in your mod.Therefore, it is advisable to transition away from using
createLegacyBlock()and adopt theFluidBlockclass for fluid block placement in your Minecraft modding projects.Replace deprecated createLegacyBlock() with FluidBlock-based placement
The
createLegacyBlock()call is deprecated in recent Forge versions. Instead, use your fluid’s associated FluidBlock for placement. For example:• In enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardBlockEntity.java (lines 115–116):
This ensures you’re using the modern
FluidBlockAPI rather than the deprecated legacy method.📝 Committable suggestion
🤖 Prompt for AI Agents
@ -24,6 +25,8 @@ public class MachinesClientBlocksConfig {.define("poweredSpawnerRangeColor", "FF0000");⚠️ Potential issue
Fix the duplicate configuration key.
The configuration key "drainRangeColor" is already used by
DRAIN_RANGE_COLORon line 27. This will cause configuration conflicts.Apply this diff to fix the duplicate key:
📝 Committable suggestion
🤖 Prompt for AI Agents
Actionable comments posted: 0
🧹 Nitpick comments (2)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
4b447f8f27andb40bbe78c9.📒 Files selected for processing (8)
endercore/src/main/java/com/enderio/core/client/FluidRendererUtil.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/client/rendering/blockentity/FluidTankBER.java(2 hunks)enderio-machines/src/main/java/com/enderio/machines/client/rendering/blockentity/NiardBER.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/client/rendering/item/FluidTankBEWLR.java(2 hunks)enderio-machines/src/main/java/com/enderio/machines/common/blocks/niard/NiardBlockEntity.java(1 hunks)enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlockEntities.java(3 hunks)enderio-machines/src/main/java/com/enderio/machines/common/init/MachineBlocks.java(2 hunks)enderio-machines/src/main/resources/assets/enderio/models/block/niard.json(1 hunks)✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (3)
🔇 Additional comments (4)
I see you have changed how Tank Filling works. I would prefer if this was split into 2 PRs. One for Tanks and One for Niard