lingyunmo / Lanthanum

"Lanthanum" is a Minecraft mod created with Fabric.It is a project driven by personal interest and is available for Minecraft version 1.19.4.
MIT License
1 stars 2 forks source link

Add the thirst control part and separate client and server's implemen… #30

Closed lingyunmo closed 8 months ago

lingyunmo commented 8 months ago

…t also update the version

Summary by CodeRabbit

coderabbitai[bot] commented 8 months ago

Walkthrough

The changes introduced a thirst mechanic to the Lanthanum mod, including a HUD overlay, key bindings, and networking packets for thirst data synchronization. The mod version was updated, and the project dependencies were expanded to include an energy module. Some adjustments were made to the GemstoneToolMaterials and LanthanumToolMaterials enums.

Changes

File Change
build.gradle Added teamreborn:energy:3.0.0 to project dependencies.
src/main/java/cn/bzlom/lanthanum/.../Lanthanum.java Added import statements, registered PlayerTickHandler, and called ModMessage.registerS2CPackets().
src/main/java/cn/bzlom/lanthanum/.../LanthanumClient.java New class implementing ClientModInitializer, registering key input handler, C2S packets, and a HUD render callback.
src/main/java/cn/bzlom/lanthanum/client/.../ThirstHudOverlay.java New class implementing HudRenderCallback, rendering a thirst HUD overlay.
src/main/java/cn/bzlom/lanthanum/event/.../KeyInputHandler.java New class registering a key binding for "drink water" action and sending a network message when the key is pressed.
src/main/java/cn/bzlom/lanthanum/event/.../PlayerTickHandler.java New class implementing ServerTickEvents.StartTick, removing thirst from players randomly.
src/main/java/cn/bzlom/lanthanum/item/.../GemstoneToolMaterials.java Made constructor accessible outside the enum and updated getRepairIngredient method return type.
src/main/java/cn/bzlom/lanthanum/item/.../LanthanumToolMaterials.java Made constructor accessible outside the enum and updated getRepairIngredient method return type.
src/main/java/cn/bzlom/lanthanum/mixin/.../ModEntityDataSaverMixin.java New mixin class for Entity, introducing a private field persistentData and overriding getPersistentData method.
src/main/java/cn/bzlom/lanthanum/networking/.../ModMessage.java New class registering packet receivers for DRINKING_ID and THIRST_SYNC_ID.
src/main/java/cn/bzlom/lanthanum/networking/packet/.../DrinkingC2SPacket.java New class handling the reception of a packet, checking for nearby water, and updating player's thirst level.
src/main/java/cn/bzlom/lanthanum/networking/packet/.../ThirstSyncDataS2CPacket.java New class handling the reception of a packet and updating player's thirst level in persistent data.
src/main/java/cn/bzlom/lanthanum/utils/.../IEntityDataSaver.java New interface declaring getPersistentData() method.
src/main/java/cn/bzlom/lanthanum/utils/.../ThirstData.java New class with methods to add, remove, and sync thirst.
gradle.properties Updated mod version from 0.0.16 to 0.0.17.

Poem

🍂 As autumn leaves fall, we code away, 🍁

Adding thirst to our game, a new mechanic to play. 💧

With a key to drink and a HUD to display, 🖥️

We've made our mod a tad more fey. 🎮

So here's to the coders, working night and day, 🌙

Making games better in every way. 🌟

On this day in history, a rabbit might say, 🐇

"Let's celebrate our progress, hip hip hooray!" 🎉


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai help` to get help. - `@coderabbitai resolve` to resolve all the CodeRabbit review comments. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`