MoNoRi-Chan/Opensourced/Lore

Information from The State of Sarkhan Official Records

MoNoRi-Chan’s Craftbook Adventure: Golden Merge

In the neon-lit coding chambers of NeoPattaya, where MoNoRi-Chan spent his days tinkering with tech, a bug report caught his eye. The issue? A subtle yet frustrating problem with Craftbook's Lift UpDown mechanic, a popular plugin for Minecraft. MoNoRi-Chan’s coding senses tingled. It wasn’t just about fixing a bug—it was about the art of clean code, the craft of crafting a better Craftbook.

The Bug Hunt Begins

Firing up his development environment, MoNoRi-Chan dove into the Craftbook source code. He quickly identified the culprit: a chunk of code in the Lift UpDown interaction logic that mishandled negative Y-coordinates. The problem? It treated the relative height inconsistently when players interacted with the top or bottom half of a block in negative Y-space.

After hours of testing and some not-so-gentle muttering about the complexities of floating-point arithmetic, MoNoRi-Chan crafted a solution:

With this, the Lift mechanic now behaved consistently, regardless of whether players were building their mega-bases at Y=64 or Y=-64. Satisfied, MoNoRi-Chan donned his Royal Decree persona and prepared a Pull Request (PR) to EngineHub, the guardians of Craftbook.


The PR Discussion

The PR titled "CraftBook#1334 fix for Elevator UpDown not working properly in negative y levels" garnered attention from EngineHub’s dev team. Among the first to comment was M. Miller, a seasoned developer with a penchant for concise solutions.

"Couldn’t this be done by just making relativeHeight the absolute value of Y initially? That feels cleaner than having to have two separate code paths where one needs to normalise the range?" — M. Miller

MoNoRi-Chan, ever ready with a technical breakdown, didn’t miss a beat. His response was both thorough and practical:

"I have tested this version:

relativeHeight = Math.abs(relativeHeight % 1.0);

However, using the absolute value introduces unintended results:

  • The UpDown Sign works correctly in positive Y-space.
  • But in negative Y-space, the absolute value flips behavior. For example, the bottom half of a block becomes the top half.
  • This can be reproduced with non-full blocks like farmland, where offsets like -0.93750 in positive Y-space become +0.06250 in negative Y-space. The absolute value adds the offset instead of subtracting it.

The workaround for negative Y conditions prevents unintentional behavior where right-clicking the top half could take you down a floor. Absolute value alone doesn’t account for this edge case."

Miller, impressed by MoNoRi-Chan’s thorough analysis and commitment to accurate behavior, responded with a succinct decision:

"Fair, I'll merge in the current one—thanks :)"


Victory for Open Source

With Miller’s approval, the PR was merged, and MoNoRi-Chan’s code became part of Craftbook’s core. The once-frustrating bug was now a distant memory, and players across the world could build and interact with their elevators without fear of physics-defying antics in the negative Y-realm.

But for MoNoRi-Chan, this was more than just a bug fix. It was a validation of his passion for coding and his commitment to improving the tools that millions of players relied on. A simple UX fix had turned him into an open-source contributor, a title that now gleamed on his digital resume.


The Epilogue

A New Contributor is Born

With a few lines of code and a well-crafted explanation, MoNoRi-Chan had contributed to CraftBook. The pull request was merged, and the bug squashed. He celebrated with a triumphant stretch, his tail flicking in contentment.

"Just a small UX fix," he thought, "but it’s these small contributions are what that keep open-source alive." From that day, MoNoRi-Chan’s name was etched into the annals of EngineHub’s contributor list, a testament to his sharp wit and dedication to the open-source community.

The cyberpunk catboy had done it again—turning a simple bug fix into a triumph of collaboration and creativity.


And thus, MoNoRi-Chan’s journey as an open-source hero continued, one pull request at a time...