Tiquality
Tiquality 是看似很受欢迎的模组 LagGoggles 的继任者。
目前,Tiquality 是一个仅服务端模组,但也支持客户端(局域网主机)。
核心功能是将玩家在游戏中的刻时间限制在固定范围内,以均匀分配时间。
支持
如果您遇到问题,我建议您先在 GitHub 上提交新的问题报告。如果您认为该问题不值得在 GitHub 上提交 issue,还有一个 Discord 频道,您可以通过更非正式的方式联系我。请注意,在 GitHub 上讨论的问题更好,因为其他人可以发现相同的问题并加入讨论,而无需翻阅数百条消息(更有条理)。
下载
您可以在此处下载最新版本 这里。THIN 和 FAT 之间的唯一区别在于 FAT 包含了 Mixin,这是一个 Tiquality 正常运行所需的库。可能另一个模组已经包含了 Mixin 或者拥有不同版本。一般来说,Tiquality 能很好地处理大多数 Mixin 版本。
已知包含 Mixin 的模组是 SpongeForge。如果您有 SpongeForge 或其他需要不同版本 Mixin 的模组,请选择 THIN 版本。
整合包作者
是的,您已获得我的许可!请将其添加到您的整合包中!:thumbsup: 如果您为他们完成所有配置工作,这将节省服务器管理员大量时间!(/tq setblock)
配置
对这个模组感兴趣?查看默认且已记录的配置文件 这里。
这是什么,以及它的 intended use
一个更新节流器,旨在为那些不会给服务器带来沉重负担的用户提供公平的 Minecraft 体验(保持 20 TPS),而对于那些随意建造的玩家,则只给予 10 TPS(随着他们影响增加,他们的 TPS 会逐渐降低)。
这鼓励了对服务器友好的建造行为,并试图不破坏其他关心自己服务器的玩家的游戏体验。
一般来说,玩家不会注意到 Tiquality 的存在,也不需要与其交互。在极少数情况下,/tq claim 可以立即帮助他们。
这不是一个惩罚模组,而是让肇事者独自面对其行为的后果。这意味着其他人都会受益。
这不是什么
这不像 ClearLagg。Tiquality 试图确保每个人都能公平地玩游戏,无论别人在做什么。
行为
没有所有者且在配置文件中未指定的方块无法更新。这包括新生成的区域。为了保持树叶腐烂和草生长等功能,您可以在配置文件中 白名单 方块。白名单中的方块不需要所有者即可进行刻更新。
如果玩家放置了一个方块,Tiquality 会将该方块分配给该玩家的个人追踪器。该追踪器将使用该放置方块的玩家的时限来执行该方块的后续更新。
如果有更多玩家登录,时间将被更多地分割。如果一个玩家没有用完他的刻时间,其他人将获得剩余的时间。
离线玩家的方块比在线玩家的方块有更少的刻时间(可自定义配置)!
当实体生成或在区块间移动时,它们的追踪器会更新以匹配该区块中最主要的追踪器(缓存)。这意味着也完全支持实体节流。最主要的追踪器是通过选择在区块中方块最多的所有者生成的。通过在区块中建造,您会自动获得对该区块的控制权。
集成
以上所有内容都是可选的。
工作原理
所有对 Block.randomTickBlock()、Block.updateTickBlock()、Entity.onUpdate() 和 ITickable.tickTileEntity() 的调用都被重定向到 Tiquality,后者随后使用定制的高性能查找找到方块或实体的所有者。
存在与世界中区块和实体位置相关的追踪器,这些追踪器会记录一次更新所耗费的时间,并从“分配的纳秒数”中减去该时间,直至归零。当归零后,所有后续的更新将被排队等待稍后执行,而不会立即运行。
当下一个游戏刻(tick)到来时,所有追踪器都会获得新的分配追踪时间,这意味着区块将再次进行更新。队列中的任务会优先执行。如果队列未能完成,且尚未添加新任务,则新的更新将被加入队列。
如果一名玩家未耗尽其全部的游戏刻时间,剩余的时间将被那些已耗尽自身时间的玩家所消耗。
你可以使用 /tq share 与其他玩家共享游戏刻时间。这对于基地成员非常有用。
命令与权限
/tiquality
/tq
- /tiquality 的别名
- tiquality.use
/tq info [point]
- 打印你当前站立的区块以及你双脚所在区块(液体)的信息。<br>打印区块的所有者信息。<br>打印区块是否在白名单中的当前状态。<br>若配合 'point' 参数使用,你可以瞄准区块并潜行,以快速获取谁追踪了该区块的信息。
- tiquality.use
/tq share <playername>
- 允许与基地成员共享游戏刻时间,这意味着即使基地所有者离线,你也可以继续游玩。如果双方都在线,游戏刻时间实际上会翻倍。
- tiquality.use
/tq track
- 为玩家认领一个区块,而无需实际重新放置它。(适用于自然生成的物体、现有基地等...)
- tiquality.use
/tq claim [radius]
- 为玩家认领一片区域。最大半径由配置文件中的
MAX_CLAIM_RADIUS 定义。如果省略 radius 参数,则将使用配置中的最大值。如果你刚安装 Tiquality 并需要将基地导入到现有世界中,这将特别有用。
- tiquality.claim
/tq acceptoverride <player>
- 允许另一名玩家在认领尝试失败后认领你的区域。你将收到关于何时使用此命令的消息提示。
- tiquality.use
/tq denyoverride <player>
- 阻止另一名玩家在认领尝试失败后认领你的区域。你将收到关于何时使用此命令的消息提示。
- tiquality.use
/tq unclaim [radius]
- 取消认领一片区域,对管理员很有用。
- tiquality.admin
/tq profile <seconds>
- 对属于你的方块运行一个非常基础的剖析器。更好的替代方案正在开发中。
- tiquality.use
/tq profile <秒数> <uuid 或 玩家名称>
- 对指定的 UUID 或玩家名称运行一个非常基础的剖析器。更好的替代方案正在开发中。
- tiquality.admin
/tq setblock <脚下|下方> <默认|自然|优先级|始终刻|禁止刻>
- 将所有指定类型的方块设置为更改刻行为。<br>
有效类型包括:<br>
默认:
- 仅当分配了追踪器且有时间进行刻时才会刻。可以被节流
优先级:
- 与
默认 类似,但在同一追踪器中的所有其他内容之前进行刻。可以被节流
禁止刻:
自然: 在以下任一情况下刻:
- 当 未分配 任何追踪器时进行刻。当已分配追踪器时,如果没有剩余时间,则可以被节流
始终刻:
- 始终进行刻,从不被节流。如果已分配追踪器,它仍会影响为追踪器授予的时间。
- tiquality.admin
/tq setentity <实体名称> <默认|自然|优先级|始终刻|禁止刻>
- 将所有指定类型的实体设置为更改刻行为。<br>
有效类型包括:<br>
默认:
- 在未分配追踪器时进行刻。当已分配追踪器时,如果没有剩余时间,则可以被节流。
优先级:
- 与
默认 类似,但在同一追踪器中的所有其他内容之前进行刻。可以被节流
禁止刻:
自然: 在以下任一情况下刻:
始终刻:
- 始终进行刻,从不被节流。如果已分配追踪器,它仍会影响为追踪器授予的时间。
- tiquality.admin
/tq reload
- 重新加载配置文件。
- tiquality.admin
常见问题解答
你为什么还不转到 Sponge 去!?
我的目标是让 Tiquality 尽可能广泛地供所有人使用。不需要安装 Sponge、匹配 Forge 版本、寻找同时兼容 Sponge 和该特定 Forge 版本的模组,这使得安装变得更容易。每个人都应该能够使用 Tiquality,即使你运行的是无 Sponge 的服务器。
不过,Sponge 仍然受到支持。
/tq info 命令有什么作用?
它有助于诊断方块是否可以被刻(tick),以及查找在配置文件中使用的名称。
站在方块上方并使用 /tq info。输出结果如下:
No entities are found in your chunk
Block below: minecraft:piston TickType: DEFAULT Status: Tracked by: Terminator_NL
我们可以将其分解为:
- "minecraft:piston" 是方块名称
- "TickType: DEFAULT" 意味着该方块只有在分配了追踪者且其有空闲时间时才会被刻。(参见:/tq track)
- "Tracked by: XXX" 告诉我们该方块是否被追踪,在本例中:它由我追踪。
另一个 tq info 的例子:
Entities in chunk:
minecraft:item PRIORITY Not tracked
Block below: minecraft:grass TickType: NATURAL Status: Not tracked
我们可以将其分解为:
- "minecraft:item" 是区块中掉落物的实体名称
- "minecraft:grass" 是方块名称
- "TickType: NATURAL" 意味着如果该方块类型未被追踪或追踪者有空闲时间,它就会被刻。(参见:/tq setblock)
- "Not tracked" 告诉我们没有追踪者被分配给该方块。
推荐用法:
tq info point,允许你只需看向方块并潜行即可查看哪些方块被追踪。
tq info 用于查看你的配置更改是否生效,或帮助玩家诊断服务器配置问题。
我的方块不工作了!我该怎么做?
如果以下任一陈述为真,方块就会被刻:
- 已分配追踪器,且该追踪器有足够的时间对该方块进行刻处理
- 该方块已在配置中定义(
NATURAL_BLOCKS),且未分配任何追踪器
- 该方块已在配置中定义(
NATURAL_BLOCKS),且追踪器有足够的时间对该方块进行刻处理
- 该方块已在配置中定义(
ALWAYS_TICKED_BLOCKS)。即使分配的追踪器时间耗尽,它仍会进行刻处理。请注意,这仍然会消耗追踪器的时间。
解决此问题最快的方法是直接站在该方块上并运行 /tq setblock below NATURAL。它会将该方块添加到配置中的 NATURAL_BLOCKS 下。
小贴士:先使用 /tq info,以确认你确实正确地位于该方块上方。
我的流体不流动!我该怎么办?
流体的追踪方式与方块相同。
解决此问题最快的方法是直接站在液体中并运行 /tq setblock feet NATURAL。它会将该流体添加到配置中的 NATURAL_BLOCKS 下。
小贴士:先使用 /tq info,以确认你确实正确地处于液体中。
我刚安装了 Tiquality,但 TPS 糟糕透顶!
请记住,导致 TPS 无法达到 20 的原因有很多。加载未加载的区块是主要影响因素之一:例如玩家探索或登录。另一个主要影响因素是世界刻后的处理。
Tiquality 不会挂钩世界事件,因此任何在世界刻之后的处理完全不受 Tiquality 控制。你可以尝试提高配置值 TIME_BETWEEN_TICKS_IN_NS。请记住,增加此值会导致世界更早停止刻处理,从而有效地使世界刻变慢。
数据存储在哪里?
数据存储在世界文件夹下的 TiqualityStorage 中。受 Minecraft 自身代码的启发,Tiquality 也使用位运算来查找方块的正确标识符,而无需遍历任何内容。这意味着 blazing fast performance(极速性能),这是必要的,因为 Tiquality 必须拦截并对每个被刻处理的对象采取行动。
我有一个想法!我能做些什么来帮助吗?
在 GitHub 上创建一个 Issue,我会给你一些反馈。(也许我已经考虑过你的想法了!)之后,Fork Tiquality 并提交一个 Pull Request!
如果你不会编程,你当然仍然可以提交请求,只要它符合项目的范围,我就会实现它。
Tiquality
Tiquality is the successor of the seemingly popular mod: LagGoggles.
At this moment, Tiquality is a server side only mod, but supports clients too (Lan hosted).
The core functionality is limiting a player's tick time in the world to evenly distribute time.
Support
If you have an issue, I'd rather have you submit a new issue report on GitHub. If you think it's not worthy of an issue report on GitHub, there's a discord channel where you can contact me in a more informal way. Please note, issues discussed on GitHub are better because other people can find the same problem, and tune in without digging through hundreds of text messages (More organized)
Download
You can download the latest release here. The ONLY difference between THIN and FAT is that FAT ships Mixin, which is a library that Tiquality needs in order to function. It's possible that another mod already ships Mixin or has another version. Generally speaking, Tiquality can handle most Mixin versions well.
A known mod to ship Mixin is SpongeForge. If you have SpongeForge or another mod that requires a different version of Mixin, choose the THIN release.
Modpack authors
Yes, you have my permission! Please add this to your modpack! :thumbsup: It will save server admins a lot of time if you do all the configuration work for them! (/tq setblock)
Configuration
Interested in this mod? Check out the default and documented configuration here.
What this is, and what it is intended for
An update throttler, that aims to provide a fair Minecraft experience at 20 TPS for users who do not cause a heavy load on the server, whilst players who build carelessly only get 10 TPS (Their TPS gradually decreases as their impact increases).
This encourages server friendly build behavior, and attempts to not ruin gameplay for others who care about their server.
Generally speaking, players won't notice Tiquality's presence, and don't have to interact with it. On rare occasions, /tq claim can help them out instantly.
This isn't a punishment mod, but makes the culprit face the consequences of their actions on their own. This means that everyone else benefits.
What this is not
This is not something like ClearLagg. Tiquality tries to keep the game fair for everyone, regardless of what someone else is doing.
Behavior
Blocks without an owner which are not specified in the config cannot update. This includes freshly generated areas. To keep functionality like leaf decay and grass growth, you can whitelist blocks in the config. Whitelisted blocks do not need an owner in order to tick.
If a player places a block, Tiquality will assign that block to that player's personal tracker. This tracker will perform future updates for that block, using the time constraint of the player that placed the block.
If more players log in, the time will be divided more. If a player doesn't use up all of his tick time, other's will receive the remaining time.
Logged out player's blocks have less tick time than players who are online (Config customizable)!
When entities spawn or move between chunks, their tracker is updated to match the most dominant tracker (cached) from that chunk. This means that there's full support for entity throttling as well. The most dominant tracker is generated by selecting the owner with the most blocks in a chunk. You take control of a chunk by building in it automatically.
Integration
- SpongeForge
- Permissions, commands, customized ticking logic
- GriefPrevention
- Claims automagically set the tracker in the claimed area, and lock it to that owner for as long as that claim is present
- GriefDefender
- Claims automagically set the tracker in the claimed area, and lock it to that owner for as long as that claim is present
- FTB Utilities
- Claims automagically set the tracker in the claimed area, and lock it to that owner for as long as that claim is present (Useful for basemates)
- LagGoggles (Work in progress...)
- Interface for not-so-tech-savvy players.
All of the above are optional.
How it functions
All calls to Block.randomTickBlock(), Block.updateTickBlock(), Entity.onUpdate() and ITickable.tickTileEntity() are redirected to Tiquality, which in turn finds the owner of a block or entity using a customized high performance lookup.
There are trackers associated with the block positions of the world and entities, these trackers record how long an update took, and subtract that from the 'granted nanoseconds' until it reaches zero. When it reaches zero all future updates are queued for later, and the update doesn't execute right away.
When the next tick comes around, all trackers get a granted amount of tracking time, meaning blocks update again. The queue is executed first. If the queue doesn't complete, new updates will be added to the queue if it isn't already.
If a player isn't using up all his tick time, the remaining time will be consumed by players who who have used up all their time.
You can share tick time with other players using /tq share. This is useful for basemates.
Commands and permissions
/tiquality
- Main command
- tiquality.use
/tq
- Alias for /tiquality
- tiquality.use
/tq info [point]
- Prints info about the block you're standing on and the block your feet are inside (Liquids).<br>Prints the owner of the block(s)<br>Prints the current status if a block is on the whitelist or not.<br>If used with the 'point' flag, you can aim at blocks and sneak for quick info on who tracked a block.
- tiquality.use
/tq share <playername>
- Allows sharing tick time with basemates, meaning that you can keep playing if the base owner is offline. If both of you are online, the tick time is effectively doubled.
- tiquality.use
/tq track
- Claims a block for a player without actually having to re-place it. (Things found in nature, existing bases... etc)
- tiquality.use
/tq claim [radius]
- Claims an area for a player. The maximum radius is defined using
MAX_CLAIM_RADIUS in the config. If the radius parameter is omitted, the maximum value in the config is used instead. This is especially useful if you have just installed Tiquality and need to import bases into your existing world.
- tiquality.claim
/tq acceptoverride <player>
- Allows another player to claim your area after a failed claim attempt. You will receive a message on when to use this.
- tiquality.use
/tq denyoverride <player>
- Denies another player to claim your area after a failed claim attempt. You will receive a message on when to use this.
- tiquality.use
/tq unclaim [radius]
- Unclaims an area, useful for admins.
- tiquality.admin
/tq profile <seconds>
- Runs a very basic profiler on blocks that you own. A better alternative is in the works.
- tiquality.use
/tq profile <seconds> <uuid or playername>
- Runs a very basic profiler on the targeted UUID or playername. A better alternative is in the works.
- tiquality.admin
/tq setblock <feet|below> <DEFAULT|NATURAL|PRIORITY|ALWAYS_TICK|TICK_DENIED>
- Sets all the blocks of the specified type to change tick behavior.<br>
Valid types are:<br>
DEFAULT:
- Only ticks when a tracker is assigned AND has time to tick. Can be throttled
PRIORITY:
- Like
DEFAULT, but ticks before everything else in the same tracker. Can be throttled
TICK_DENIED:
NATURAL: Ticks when either:
- Ticks when no tracker is assigned. When a tracker has been assigned, it can be throttled
ALWAYS_TICK:
- Always ticks, never throttled. If a tracker has been assigned, it will still affect the granted time for a tracker.
- tiquality.admin
/tq setentity <entity_name> <DEFAULT|NATURAL|PRIORITY|ALWAYS_TICK|TICK_DENIED>
- Sets all the entities of the specified type to change tick behavior.<br>
Valid types are:<br>
DEFAULT:
- Ticks when no tracker is assigned. When a tracker has been assigned, it can be throttled if no time is left.
PRIORITY:
- Like
DEFAULT, but ticks before everything else in the same tracker. Can be throttled
TICK_DENIED:
NATURAL: Ticks when either:
- Exactly the same as
DEFAULT
ALWAYS_TICK:
- Always ticks, never throttled. If a tracker has been assigned, it will still affect the granted time for a tracker.
- tiquality.admin
/tq reload
- Reloads the config file.
- tiquality.admin
Frequently asked questions
Why don't you move to Sponge already!?
It is my intention to make Tiquality as widely available to everyone. Not having to install Sponge, match the Forge version, find mods that are both compatible with Sponge and that specific Forge version makes it easier to install. Everyone should be able to use Tiquality, even if you run a Sponge-free server.
Sponge is still supported, however.
What does /tq info do?
It helps you diagnose if a block can be ticked or not, as well as finding names to use in the config
Stand on top of the block and use /tq info. The output will be as follows:
No entities are found in your chunk
Block below: minecraft:piston TickType: DEFAULT Status: Tracked by: Terminator_NL
We can break this down:
- "minecraft:piston" is the block name
- "TickType: DEFAULT" means that this block will only tick if a tracker has been assigned and has time to spare. (See: /tq track)
- "Tracked by: XXX" tells us if a block is tracked or not, in this case: It is tracked by me.
Another example of tq info:
Entities in chunk:
minecraft:item PRIORITY Not tracked
Block below: minecraft:grass TickType: NATURAL Status: Not tracked
We can break this down:
- "minecraft:item" is the entity name of a dropped item in the chunk
- "minecraft:grass" is the block name
- "TickType: NATURAL" means that this block type will tick if it's not tracked or the tracker has time to spare. (See: /tq setblock)
- "Not tracked" tells us that no tracker has been assigned to this block.
Recommended usage:
tq info point which allows you to see what blocks are tracked simply by looking at them, and sneaking.
tq info to see if your config changes worked, or helps players diagnose server configuration issues.
My blocks don't tick! What do I do?
A block will tick if at least one of the following statements is true:
- There's a Tracker assigned and the tracker has enough time to tick the block
- The block is defined in the config (
NATURAL_BLOCKS) and there's no tracker assigned to it
- The block is defined in the config (
NATURAL_BLOCKS) and the tracker has enough time to tick the block
- The block is defined in the config (
ALWAYS_TICKED_BLOCKS) It will tick even if a tracker has been assigned that ran out of time. Note that this will still consume the time on the tracker.
The fastest way to solve this is simply by standing on the block and running /tq setblock below NATURAL. It will add the block to the config under NATURAL_BLOCKS.
Pro tip: Use /tq info first, to see if you are actually positioned on the block correctly.
My fluids don't flow! What do I do?
Fluid's are tracked the same way as blocks.
The fastest way to solve this is simply by standing in the liquid and running /tq setblock feet NATURAL. It will add the fluid to the config under NATURAL_BLOCKS.
Pro tip: Use /tq info first, to see if you are actually positioned in the liquid correctly.
I just installed Tiquality, and the TPS is HORRIBLE!
Keep in mind, that there are MANY other reasons the TPS can still not be 20. Chunkloading unloaded chunks is one of the big effectors: people exploring, or logging in. Another big effector is post-world-tick processing.
Tiquality does NOT hook into world events, so any processing AFTER the world tick is completely outside of Tiquality's control. You can try to raise the config value TIME_BETWEEN_TICKS_IN_NS. Remember that increasing this value will cause the world to stop ticking sooner, effectively making the world tick slower.
Where is the data stored?
The data is stored in the world folder under TiqualityStorage. Inspired by minecraft's own code, Tiquality also uses bitshifting to find the right identifier for a block, without having to iterate on anything. This means blazing fast performance, and this is needed because Tiquality has to intercept and act on every ticked object.
I have an idea! What can I do to help?
Make an issue at GitHub and I'll give you some feedback. (I might already have considered your idea!) After that, fork Tiquality and just make a pull request!
If you can't code, you can obviously still submit requests, and I will implement it as long as it fits the scope of the project.
评论 0
登录后参与评分
还没有评论,来抢沙发吧