秘密通道
你是否曾想过创造一堵轻触即可消失的墙壁?或者一个能将你的“朋友”困住的大坑?如果活塞无法满足你打造梦想中秘密门的需求,那就别再犹豫了!
致谢:
这个插件的最初创意并非由我提出。在 hMod 和 Alpha 时代,我在一个名为 “Kingdom of Strongholds” 的服务器上游玩,该服务器由 Rockslide 运营。在服务器关闭前几周,加入了一个与此类似的插件,使用体验非常棒。遗憾的是,我未能找到适用于 hMod 或 Bukkit 的同类插件,因此我决定从头编写自己的版本……
另外,我要感谢 @nisovin 帮我解决了物品栏相关的问题。
安装方法:
下载 .jar 文件并将其放入你的 plugins 文件夹中。按常规方式启动服务器。然后,停止服务器并修改 plugins/SecretPassage/ 目录下的 config.yml 配置文件以符合你的需求。最后,重新启动服务器。
使用方法:
1) 首先,使用你在配置文件中选择的任意一种“活动材料”搭建出结构的形状。如果你没有更改配置文件,请使用下界岩 (Netherrack) 或海绵 (Sponge)。(我为一个没有下界的服务器制作了此插件,所以下界岩并不常见……)
2) 输入以下命令来创建通道。需要注意的是,你可以在配置文件中更改命令中的 “create” 部分,因此具体命令可能因你的设置而有所不同。
3) 手持你想要用来替换活动材料的方块,并对活动材料进行拳击(左键点击)。如果该材料被允许(同样在配置文件中设定),活动材料将吸收你手持的物品,并改变外观以模仿该物品。重复此操作直到结构搭建完成——如果需要,你可以安全地放置更多的活动材料,插件仅在你手持其他物品且拳击活动材料时才会响应。默认情况下,任何不受重力影响的实心方块(除了下界岩和海绵)都可以用于装饰通道。
3b) 如果你击打(并激活)了错误的方块,可以通过破坏它来将其从结构中移除。这样做不会退回所使用的活动材料,因此需要重新放置。
4) 在你记得的地方放置另一个活动方块,然后手持你在配置文件中选择用于创建开关的物品之一,并对其拳击。该方块将吸收物品并转变为另一种材料(在配置文件中选定),以显示其现在是一个开关方块。默认情况下,你使用石质按钮来制作开关,它们会变成木板以示确认。
5) 如果需要,可以破坏开关方块并用你选择的另一个方块替换。新方块必须能够通过右键点击进行选择才能生效(因此不能是水、岩浆或空气)。
6) 右键点击开关以测试闸门是否正常工作。如果是,步骤 3 中放置的所有方块将变为空气。再次右键点击开关以恢复结构。
7) 输入命令 /spass 结束通道的建造过程。你始终可以使用 create 命令再次回来对其进行修改。
命令列表:
- /spass [别名: /sp, /secretpassage] 插件的主要命令。同时用于结束通道建造过程。
- /spass create* (通道名称) - 开始构建指定名称的通道,如有必要则创建它。
- /spass destroy* (通道名称) - 销毁你拥有的通道(方块不会被移除)。你可以授予权限节点,允许玩家销毁服务器上的任何通道。
- /spass destroy* switch - 设置状态,使你右键点击的下一个方块所绑定的开关将被销毁。
- /spass list* - 按创建顺序列出你拥有的所有通道。
- /spass list* (玩家名称) - 基于权限的命令,列出指定玩家拥有的通道。
- /spass toggle* (通道名称) - 基于权限的命令,用于切换指定通道的状态,前提是你与通道位于同一世界中。
- /spass reset* - 基于权限的命令,根据红石信号将所有通道重置为开关状态。
- /spass timer (刻数) - 添加重置计时器,以便在设定的延迟后自动关闭通道。(专门设计以防止意外自动打开……)
- /spass timer 0 - 移除你当前正在处理的通道的计时器。
- /spass info (通道名称) - 提供所列通道的信息。如果不提供通道名称,则提供你当前正在处理的通道的信息(如果有)。
- /spass help - 列出你有权访问的所有基本命令及其正确的输入格式。
- /spass access - 列出用于管理通道白名单或黑名单的命令。
- /spass access allow (名称) (名称) (名称) (名称) - 将包含的名称添加到当前通道的白名单中,并将通道设置为使用白名单。
- /spass access deny (名称) (名称) (名称) (名称) - 将包含的名称添加到当前通道的黑名单中,并将通道设置为使用黑名单。
- /spass access remove (名称) (名称) (名称) (名称) - 从当前通道的白名单/黑名单中移除指定的名称。
- /spass access clear - 移除通道的访问限制,允许任何人使用它。
功能特性:
- 创建可以消失的结构。
- 包含防止通道内方块被破坏的选项(以防止简单的复制漏洞)
- 包含在装饰通道时消耗资源的选项,以及选择可用于创建通道的材料的能力。
- 自定义用于替代 create、destroy、toggle 和 list 的命令。
- 包含选项,使只有通道(或管理员)的所有者可以修改它,而任何人都可以使用他们制作的开关来切换通道。
- 一个通道可以关联多个开关,但一个开关只能关联一个通道。
- 通道不需要是连续的,但不能跨世界放置方块。如果你愿意,你可以建造一个消失的村庄。
- 支持 SuperPerms(自 v1.0 起)
- 初步的红石支持(自 v1.2 起)
- 能够在设定的延迟后自动关闭通道(自 v1.4 起)
- 提供基于通道的访问控制(自 v1.6 起)
- 如果启用了通道保护,当尝试推动通道方块时,活塞会损坏;如果是粘性活塞,则无法拉出通道方块(自 v1.6 起)
权限节点:
- secretpassage.* - 提供除 lockout 和 deny 之外的所有节点(默认:Op)
- secretpassage.create.other - 允许用户绕过所有者独占保护选项(如果已启用)
- secretpassage.destroy.other - 允许用户销毁服务器上的任何通道,无论所有者是谁
- secretpassage.list.other - 允许用户查看其他玩家拥有的通道
- secretpassage.toggle - 提供对 toggle 命令的访问权限
- secretpassage.reset - 提供对 reset 命令的访问权限。
- secretpassage.lockout - 阻止用户使用插件的任何部分
- secretpassage.antilockout - 防止管理员在使用全节点插件时意外将自己排除在插件使用之外
关于其他插件支持的说明:虽然许多其他插件与此插件非常契合(例如 iConomy 等),但我个人不会为这些选项添加支持。不过,源代码已包含在 .jar 文件中,因此任何想要进行修改的人都可以尝试一下。遗憾的是,我在代码结构统一性和注释方面并不擅长,因此你唯一能找到的帮助是每个函数顶部的一小段注释,用于描述该函数。
如果你添加了你认为应该分享的功能,我有一个请求:请在此处分享并通知我,这样我可以查看它。我会对其进行测试并将其作为正式版本添加,确保在致谢部分加入你的名字。
Secret Passage
Have you ever wanted to create a wall that could disappear at a touch? Or a massive pit to trap your "friends" in? Are pistons just not enough to make the secret door of your dreams? Look no further!
Credit:
I did not come up with the original idea of this plugin. During the days of hMod and Alpha, I played on a server called "Kingdom of Strongholds", run by Rockslide. A few weeks before the server was shut down, a plugin similar to this one was added, and it was a blast to use. Sadly, I haven't been able to find anything like this for hMod or Bukkit, so I opted to write my own version from scratch...
Also, I would like to thank @nisovin for helping me solve an inventory issue.
How to Install:
Download the .jar file and place it in your plugins folder. Start the server as normal. Then, stop the server and modify the config.yml file in plugins/SecretPassage/ to your liking. Finally, restart the server.
How to Use:
1) Start by building the shape of the structure out of any of the "active materials" you chose in the config. If you didn't change the config, use either Netherrack or Sponge. (I made this for a server with no nether, so netherrack isn't common...)
2) Type in the command below to create a passage. It's worth noting that you can change the "create" part of the command in the config file, so it may be different based on what you entered.
3) Hold the block that you want to replace the active material with, and punch it. If the material is allowed (also in config), the active material will absorb the item you're holding, and change to look like it. Repeat this until you have the structure built - you can safely place more active material if you need to, the plugin will only respond if the active material is punched while holding another item. By default, any solid block unaffected by gravity (aside from netherrack and sponge) can be used to decorate a passage.
3b) If you punch (and activate) the wrong block, you can break it to remove it from the structure. Doing so will not return the active material used, so that will need to be placed again.
4) Place another active block somewhere that you'll remember, then hold one of the items you chose for creating switches (in config) and punch it. The block will absorb the item and change into another material (chosen in config) to show that it is now a switch block. By default, you use a stone button to make switches, which turn into wooden planks for confirmation.
5) If desired, break the switch block and replace with another block of your choosing. It must be selectable with a right-click to work (so no water, lava or air).
6) Right-click the switch to test if the gate is working. If so, all the blocks you placed in step 3 will turn into air. Right-click the switch again to bring the structure back.
7) Type the command /spass to end the passage construction process. You can always come back and modify it by using the create command again.
Command List:
- /spass [Alias: /sp, /secretpassage] The main command for the plugin. Also ends the passage building process.
- /spass create* (PassageName) - Starts building on the named passage, creating it if necessary.
- /spass destroy* (PassageName) - Destroys a passage you own (blocks are not removed). You can give a permissions node to let people destroy any passage on the server.
- /spass destroy* switch - Sets you up so that a switch bound to the next block you right-click on is destroyed.
- /spass list* - Lists all the passages that you own, in order of creation.
- /spass list* (PlayerName) - Permissions-based command that lists passages owned by the named player.
- /spass toggle* (PassageName) - Permissions-based command to toggle a named passage, provided you are in the same world.
- /spass reset* - Permissions-based command that resets all passages based on redstone power to switches.
- /spass timer (ticks) - Adds a reset timer to auto-close the passage after a set delay (specifically built to prevent making it accidentally auto-open...)
- /spass timer 0 - Removes the timer of the passage you are working on.
- /spass info (Passage Name) - Provides information on the listed passage. If you do not give a passage name, it provides information on the passage you are working on (if any).
- /spass help - Lists all basic commands you have access to, as well as the proper structure for typing them.
- /spass access - Lists the commands for working with white or black lists for passages.
- /spass access allow (Name) (Name) (Name) (Name) - Adds the names included to the whitelist of your current passage, and sets the passage to use a whitelist.
- /spass access deny (Name) (Name) (Name) (Name) - Adds the names included to the blacklist of your current passage, and sets the passage to use a blacklist.
- /spass access remove (Name) (Name) (Name) (Name) - Removes the name from the whitelist/blacklist of your current passage.
- /spass access clear - Removes the access restrictions on your passage, allowing anyone to use it.
Features:
- Create structures that can disappear.
- Includes option to prevent blocks in passages from being broken (to stop easy duplication)
- Includes options to consume resources when decorating passages, as well as the ability to choose what can be used in their creation.
- Choose your own commands to replace create, destroy, toggle, and list.
- Includes option so that only the owner of a passage (or an op) can modify it, while anyone can use the switches made by them to toggle the passage.
- More than one switch can be assigned to a passage, but only one passage can be assigned to a switch.
- Passages do not have to be continuous, but cannot have blocks on multiple worlds. You could build a disappearing village if you felt so inclined.
- SuperPerms support (as of v1.0)
- Preliminary Redstone support (as of v1.2)
- Ability to have passages close themselves after a set delay (as of v1.4)
- Provide access on a passage-by-passage basis (as of v1.6)
- If passage protection is active, pistons will break when trying to push a passage block, and cannot pull out a passage block if sticky (as of v1.6)
Permissions Nodes:
- secretpassage.* - Provides all nodes other than lockout and deny (Default: Op)
- secretpassage.create.other - Allows user to bypass the owner-only protection option if it is enabled
- secretpassage.destroy.other - Allows user to destroy any passage on server, regardless of owner
- secretpassage.list.other - Allows user to check passages owned by other players
- secretpassage.toggle - Provides access to the toggle command
- secretpassage.reset - Provides access to the reset command.
- secretpassage.lockout - Prevents user from using any portion of the plugin
- secretpassage.antilockout - Prevents admin using all-nodes plugins from accidentally barring themselves from using plugin
A Note on Other Plugin Support: While a lot of other plugins are great matches with this plugin (iConomy, etc), I will not be personally adding support for these options. However, the source code is included in the .jar file, so that anyone who wants to make changes can take a crack at it. Sadly, I'm not the greatest at uniform code structure or commenting, so the only assistance you'll find in there is a small comment at the top of each function to describe it.
If you add a feature that you believe should be shared, I have a request: share it here and alert me, that way I can take a look at it. I'll test it and add it as a proper version, making sure to include your name in the credits section.
评论 0
登录后参与评分
还没有评论,来抢沙发吧