Defenestrate
这是一个 Spigot 插件,旨在赋予玩家拾取并投掷游戏中大多数方块和实体的能力。你可以分别为方块、玩家和其他实体自定义投掷力度,并根据需要禁用任意类别的投掷功能。
用法
只需在主手空出的情况下蹲下并右键点击,即可拾取玩家、实体或方块。之后,看向你想要抛出的方向,然后左键点击即可投掷!
注意:为了尝试为服务器所有者提供某种形式的出生点保护,默认情况下非 OP(操作员)玩家将无法拾取/投掷位于 server.properties 中定义的出生点保护范围内的生物或方块。如果需要,可以在设置中更改此行为。
你可以在这里找到一个“非常高质量”的 stridsfordon 风格演示视频
安装与配置
要安装,只需将最新版本放入任何 Bukkit 衍生版服务器的 Plugins 文件夹中,然后运行 /reload 命令即可。
可以通过插件配置文件修改设置,也可以使用游戏内的 /dSettings 命令进行修改。
/dSettings 命令的使用方法如下:
/dSettings list - 列出所有设置及其对应的值
/dSettings get <setting> - 返回指定设置的值
/dSettings set <setting> <value> - 将指定设置的值设置为指定值
/dsettings blacklist <addBlock/removeBlock> <block> - 向黑名单中添加或移除一个方块
/dsettings blacklist <addEntity/removeEntity> <entity> - 向黑名单中添加或移除一个实体
/dsettings blacklist <listBlock/listEntity> - 返回指定类别的黑名单列表
可更改的设置列表
力度设置:
playerThrowPower (Default: 1.6) - 投掷玩家的力度
entityThrowPower (Default: 1.6) - 投掷其他实体的力度
blockThrowPower (Default: 1.6) - 投掷方块的力度
功能开关:
playerThrowEnabled (Default: true) - 是否允许玩家投掷其他玩家
entityThrowEnabled (Default: true) - 是否允许玩家投掷其他实体
blockThrowEnabled (Default: true) - 是否允许玩家投掷方块
权限设置:
throwPlayersRequiresPermission (Default: false) - 玩家是否需要权限才能投掷其他玩家(仅在 playerThrowEnabled 为 true 时使用)
throwEntitiesRequiresPermission (Default: false) - 玩家是否需要权限才能投掷其他实体(仅在 entityThrowEnabled 为 true 时使用)
throwBlocksRequiresPermission (Default: false) - 玩家是否需要权限才能投掷方块(仅在 blockThrowEnabled 为 true 时使用)
其他设置:
oldBlockHandling (Default: false) - 使用更简单的方法来处理方块的拾取和投掷(不推荐,更多信息见 此处)
useCustomSounds (Default: false) - 如果你想制作一个自定义资源包来替换拾取、投掷以及方块落地时的声音,请启用此选项。在没有资源包的情况下启用此选项将禁用该插件的声音。需要覆盖的声音为 "defenestrate.pickup"、"defenestrate.throw" 和 "defenestrate.place"
blockDespawnMinutes (Default: 5) - 投掷后自定义方块实体消失前的分钟数。值为 0 时禁用
ignoreSpawnProt (Default: false) - 如果插件应忽略出生点保护,并允许非操作员在保护范围内拾取物品。
allowStealing (Default: true) - 是否允许玩家从他人头上拿走方块
权限
本插件没有内置的权限管理器。但是,如果你希望设置等级以授予玩家使用本插件部分功能的权限,你可以使用如 LuckPerms 这样的权限管理器来为玩家分配这些权限。
defenestrate.players - 投掷玩家的权限(仅在 throwPlayersRequiresPermission 为 true 时需要)
defenestrate.entities - 投掷实体的权限(仅在 throwEntitiesRequiresPermission 为 true 时需要)
defenestrate.blocks - 投掷方块的权限(仅在 throwBlocksRequiresPermission 为 true 时需要)
defenestrate.settings - 非操作员使用 /dSettings 所需的权限
defenestrate.all - 授予上述列出的所有权限
旧方块处理
旧的方块处理方法使用 Minecraft 的“掉落方块”实体。问题在于,掉落方块有……随机破碎的习惯。如果你在蹲下时拾取了一个方块,并且恰好处于错误的位置,该方块就会直接掉落。不仅如此,当掉落方块着陆时,它有很大的概率会作为物品掉落而不是作为方块放置。
我的解决方案是利用 1.19.4 的方块显示和交互功能创建一个“自定义”方块实体,并配合一个缩小版的幼僵尸猪灵来处理重力。这意味着方块实体实际上是三个堆叠在一起的实体。如果你的服务器因为玩家投掷方块而出现卡顿,使用旧的方块处理方法可能是值得的。
其他说明
如果将方块投掷力度设置为正好 1.5,直接将方块向上投掷会导致它在空中被放置为一个方块。已经测试过 1.51 和 1.49 的力度,它们可以正常工作。这是由于时间上的巧合,当插件检查方块时,方块的速度会与静止方块的速度完全相同。修复这个问题所需的计算量远大于其带来的收益。
如果你的服务器在方块飞行时崩溃,方块可能不会在下一次启动时被插件正确移除。从版本 1.41 开始,现在有一个 /removeblocks [radius (可选)] 命令,可用于清除所有方块实体(如果不指定半径),或者仅清除指定半径内的方块实体。
问题与额外功能
如果你发现了插件的问题或有新功能请求,请前往 issues 页面并创建一个 issue。请确保在 issue 中尽可能详细地描述 bug 或功能请求的相关信息。
Defenestrate
This is a spigot plugin designed to give players the ability to pick up and throw most blocks and entities in the game. You can customize the throw power individually for blocks, players, and entities, and can disable the throwing of any group if you so choose.
Usage
Simply crouch and right click with no item in your main hand to pick a Player, Entity, or Block up. After that, look in the direction you want to launch, and left click to throw!
Note: In an attempt to add some form of spawn protection for server owners, by default non-op players will not be able to pick up/throw mobs or blocks that are in the spawn protection defined in server.properties. This can be changed in the settings if desired.
You can find a ""very high quality"" stridsfordon-style demonstration video here
Installation and Setup
To install, simply add the latest release to the Plugins folder in any bukkit fork server and run /reload
Settings can be either changed in the plugin config file, or by using the in-game /dSettings command.
The /dSettings command works as follows:
/dSettings list - Lists all settings and their respective values
/dSettings get <setting> - Returns the value of the specified setting
/dSettings set <setting> <value> - Sets the value of the specified setting to the specified value
/dsettings blacklist <addBlock/removeBlock> <block> - Adds or removes a block from the blacklist
/dsettings blacklist <addEntity/removeEntity> <block> - Adds or removes a block from the blacklist
/dsettings blacklist <listBlock/listEntity> - Returns a list of the blacklist for the specified category
List of settings that can be changed
Power settings:
playerThrowPower (Default: 1.6) - The power at which players are thrown
entityThrowPower (Default: 1.6) - The power at which other entities are thrown
blockThrowPower (Default: 1.6) - The power at which blocks are thrown
Feature toggles:
playerThrowEnabled (Default: true) - If any player will be allowed to throw players
entityThrowEnabled (Default: true) - If any player will be allowed to throw other entities
blockThrowEnabled (Default: true) - If any player will be allowed to throw blocks
Permission settings:
throwPlayersRequiresPermission (Default: false) - If players need a permission to throw players (only used if playerThrowEnabled is true)
throwEntitiesRequiresPermission (Default: false) - If players need a permission to throw entities (only used if entityThrowEnabled is true)
throwBlocksRequiresPermission (Default: false) - If players need a permission to throw blocks (only used if blockThrowEnabled is true)
Other settings:
oldBlockHandling (Default: false) - Uses a simpler method of handling the picking up and throwing of blocks (not recommended, more info here)
useCustomSounds (Default: false) - If you want to make a custom texture pack that replaces sounds for picking up, throwing, and when a block lands, enable this option. Enable this option without any texture pack to disable this plugin's sounds. The sounds to overwrite would be "defenestrate.pickup", "defenestrate.throw", and "defenestrate.place"
blockDespawnMinutes (Default: 5) - The amount of minutes before a custom block entity will despawn after being thrown. Disabled when value is 0
ignoreSpawnProt (Default: false) - If the plugin should ignore spawn protection, and allow things to be picked up inside of it from non-operators.
allowStealing (Default: true) - If players should be allowed to take blocks off of others' heads
Permissions
There is no built-in permissions manager in this plugin. However, if you wish to set up ranks to give players permission to use parts of this plugin, you can use a permission manager such as LuckPerms to give players these permissions.
defenestrate.players - Permission for throwing players (only required if throwPlayersRequiresPermission is true)
defenestrate.entities - Permission for throwing entities (only required if throwEntitiesRequiresPermission is true)
defenestrate.blocks - Permission for throwing blocks (only required if throwBlocksRequiresPermission is true)
defenestrate.settings - Permission needed for non-operators to use /dSettings
defenestrate.all - Grants every permission listed
Old Block Handling
The old block handling method uses Minecraft's "falling block" entity. The issue with this is that falling blocks have a habit of just... randomly breaking. If you pick a block up while crouching and just in general being in the wrong area, the block will just drop. Even more than that, when falling blocks land, there's a stupidly large chance that the block just drops as an item instead of being placed as a block.
My solution to this is to create a ""custom"" block entity using the 1.19.4 Block Displays and Interactions, along with a very shrunk down baby zoglin to handle the gravity. This means that the block entities are actually 3 entities stacked on top of each other. If your server starts lagging because of players throwing blocks, it may be worth it to use the old block handling.
Other Notes
If the block throw power is set to exactly 1.5, throwing a block directly upwards will cause it to be placed as a block in midair. Powers 1.51 and 1.49 have been tested and work as usual. This is because of a coincidence in timing where the block will have the exact same velocity as an unmoving block when the plugin checks it. Fixing this would require much more processing power than it is worth.
If your server crashes while blocks are flying, the blocks might not be correctly removed by the plugin upon the next startup. as of version 1.41, there is now a /removeblocks [radius (optional)] command that can be used to kill either all block entities if no radius is specified, or just the block entities within the specified radius.
Issues and Additional Features
If you've found an issue with the plugin or have a request for a new feature, head over to the issues page and create an issue. Please be sure to include as much detail about the bug/feature request as possible in the issue.
评论 0
登录后参与评分
还没有评论,来抢沙发吧