Giter VIP home page Giter VIP logo

recursiveshulker's Introduction

Recursive Shulker

本插件允许手持潜影盒物品堆直接打开潜影盒,免除玩家放置潜影盒方块再行打开之弊。本插件同时允许在潜影盒内嵌套潜影盒(仅限直接打开手中潜影盒时)。

可以使用 /sortshulker 指令对潜影盒内物品堆按照 NBT 数据长度进行排序,sortshulker ascending 为升序,sortshulker descending 为降序。

MineCraft 客户端对物品堆 NBT 数据有限制。如果 NBT 长度过长或数据结构中嵌套层数过多(深度过深),则客户端将直接退出服务器。以后每次尝试进入服务器都将立即下线。唯一的解决办法是清除物品栏内所涉物品堆。而嵌套潜影盒时,NBT 数据极易突破限制,因此本插件对潜影盒相关数据加以验算,在打开手持潜影盒并进行操作时,一旦数据超过最大长度或深度的二分之一,立即中断潜影盒操作并强制弹出所有物品,以免对玩家造成影响。

本插件几乎所有涉及物品堆计算的部分都在异步线程内完成,并在最后同步操作物品栏。即使玩家在打开手持潜影盒时直接关闭客户端界面强行下线,也会通过读写存档内数据的方式将潜影盒内的内容保存。唯一问题是为了避免与服务端本身对存档的读写相冲突,本插件有意延后一段时间读写存档。如果玩家下线后立刻上线可能丢失物品,但这仅限于玩家在未关闭物品栏界面的情况下直接关闭客户端的情况,正常关闭物品栏不会产生问题。

本插件所用代码部分来自开源项目 MXLib (https://github.com/Karlatemp/MxLib) ,该项目的 NBT 模块极富参考价值和借鉴意义。

recursiveshulker's People

Contributors

william-shi233 avatar

Stargazers

Xanadu13 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.