哇……又一个TNT插件。我们不是已经有够多的了吗?不过这个不一样,它在撞击时会爆炸。这是一种摧毁那些烦人建筑的好方法:手里拿着TNT,扔出去……轰!而且,现在我们可以制造大炮了!
工作原理
拿起TNT,拿在手中,用鼠标左键投掷。
从v0.2版本开始,如果在配置文件中将 "reqnamedtnt" 设置为 "true"(默认为 "false",因此插件默认仍像以前一样工作),则插件需要一种名为 "ImpactTNT" 的特殊重命名TNT才能工作。你可以使用铁砧对TNT进行重命名,但这当然会消耗经验等级。这提供了一种理想的方式,让某些玩家群体获得投掷TNT的能力,同时要求他们必须通过积累经验等级来制作这种TNT。
有关简化此类使用的附加命令,请参阅下文。
最初,我的插件功能类似于 Grenades。非常感谢 BlockCat 提出的原始想法,我在此基础上添加了一些自己的内容。
安装插件
只需将 ImpactTNT.jar 拖入你的插件文件夹即可——它会自动创建配置文件。此插件还需要 Bergerkiller 的 BKCommonLib,请确保你也安装了它。
配置
general:
# TNT击中物体时是否爆炸?如果为false,则TNT在引信倒计时结束时引爆
explodeonimpact: true
# 投掷的TNT在此半径内不应爆炸。如果你不小心把它扔到附近的树上,这将非常有用
safetyradius: 10
# 无论如何引爆前的刻数
fuseticks: 100
# 这接近TNT的默认爆炸半径。不要过度夸大半径!(我稍后可能会硬性限制它)
explosionradius: 5
# 是否需要将TNT重命名为 "ImpactTNT" 才能作为投掷TNT使用
reqnamedtnt: false
# 装有ImpactTNT的发射器是否作为大炮工作
dispensercannon: true
权限
- impacttnt.create -> 授予 "/impact" 命令的访问权限(特别针对版主/管理员)
- impacttnt.throw -> 用户需要此权限才能投掷ImpactTNT
命令
/impact -> 当你手中拿着普通TNT时输入此命令,插件会将其重命名为 "ImpactTNT",以便用作可投掷TNT。(仅在配置中 "reqnamedtnt: true" 时相关)。再次输入该命令会将你的TNT恢复为普通状态
/impact all -> 将你库存中的所有TNT(重命名)为 "ImpactTNT"。再次输入该命令会移除重命名
/impact save -> 将服务器的发射器大炮数据保存到 cannons.dat(用于持久化)。服务器关闭时也会自动保存
其他
此插件创建的所有爆炸仍然是普通的TNT爆炸,可以使用 LogBlock 等工具进行日志记录和回滚,如果你愿意的话。

更多有趣功能——大炮
从v0.3版本开始,我们现在拥有可以作为大炮使用的发射器。只需在发射器中放入一些ImpactTNT并激活发射器(就像往常一样,使用开关/红石)。它将把ImpactTNT作为投射物射出,并在撞击时爆炸,就像普通的ImpactTNT一样。
大炮也可以控制。可以改变投射物的方向(-45度...+45度)和角度(0度...60度)。要更改方向参数,你需要一根木棍,并对发射器的不同侧面进行左键点击:
- 点击 左侧 -> 大炮向左旋转1度
- 潜行点击 左侧 -> 大炮向左旋转5度
- 点击 右侧 -> 大炮向右旋转1度
- 潜行点击 右侧 -> 大炮向右旋转5度
- 点击 顶部 -> 大炮的垂直角度增加1度
- 潜行点击 顶部 -> 大炮的垂直角度减少1度
- 点击 背面 -> 显示大炮的当前设置而不更改它们
- 潜行点击 背面 -> 大炮参数重置为 (direction=0, angle=45)
所有服务器发射器大炮的参数都会在服务器关闭时保存,并在启动时调用,这意味着各个发射器大炮的设置得以保留。
源代码
@GitHub
Sheesh...another TNT plugin. Don't we have enough of those already? Except that this one explodes on impact. A fun way to destroy those annoying buildings: hold TNT in your hand, throw it and...KABOOM. Plus, now we have cannons!
How it works
Take TNT, hold it in your hand, throw it with the left mouse button.
As of v0.2, if "reqnamedtnt" has been set to "true" in config (it is by default "false, so the plugin by default works as before), then the plugin requires special TNT renamed as "ImpactTNT" to work. You can rename TNT with an anvil, but it costs levels, of course. This would be a perfect way to give the ability to use throwable TNT to some player groups, while still requiring exp levels from them to be able to build the TNT.
See below for an added command to simplify this kind of use.
Originally, the functionality of my plugin was similar to Grenades. Many thanks to BlockCat about the original idea, which I took and added some of my own.
Installing the plugin
Just drag ImpactTNT.jar to your plugin folder - it auto-creates the configuration. This plugin needs also Bergerkiller's BKCommonLib, so make sure you have it as well.
Configuration
general:
# Make the TNT explode when hitting something? If false, then the TNT detonates when its fuse ticks off
explodeonimpact: true
# The radius closer to which the thrown TNT shouldn't explode. Useful if you accidentally throw it into a nearby tree
safetyradius: 10
# The amount of ticks after which it detonates anyway
fuseticks: 100
# This is close to the default radius of TNT. Do not overexaggerate with the radius! (I might hard-limit it later)
explosionradius: 5
# Whether the player needs TNT renamed as "ImpactTNT" to work as throwable TNT
reqnamedtnt: false
# Whether dispensers with ImpactTNT work as cannons
dispensercannon: true
Permissions
- impacttnt.create -> this gives access to the "/impact" command (especially targeted for moderators/admins)
- impacttnt.throw -> this is needed for the user to be able to throw ImpactTNT
Commands
/impact -> while holding ordinary TNT in your hand, type this and the plugin renames it to "ImpactTNT", to be able to use as throwable TNT. (Only relevant if "reqnamedtnt: true" in config). Typing the command again changes your TNT back to normal
/impact all -> changes (renames) all TNT in your inventory to "ImpactTNT". Typing the command again removes the naming
/impact save -> save the server's dispenser cannon data to cannons.dat (for persistence). Saving is also automatically done on server shutdown
Other
All explosions created by this plugin are still normal TNT explosions and can be logged & rollbacked with etc. LogBlock, should you wish to do so.

More fun stuff - CANNONS
From v0.3 on, we now have dispensers working as cannons. Just put some ImpactTNT inside a dispenser and activate the dispenser (just as usual, with a switch/redstone). It will shoot out the ImpactTNT as a projectile, which explodes on impact, just as the usual ImpactTNT does.
Cannons can also be controlled. The direction (-45 degrees...+45 degrees) and angle (0 degrees...60 degrees) of the projectiles can be changed. To change the direction parameters, get yourself a wooden stick and left-click the dispenser on different sides:
- click on LEFT side -> cannon turns 1 degree to the left
- sneak-click on LEFT side -> cannon turns 5 degrees to the left
- click on RIGHT side -> cannon turns 1 degree to the right
- sneak-click on RIGHT side -> cannon turns 5 degrees to the right
- click on TOP side -> cannon's vertical angle increases by 1 degrees
- sneak-click on TOP side -> cannon's vertical angle decreases by 1 degrees
- click on BACK side -> tells you the cannon's current settings without changing them
- sneak-click on BACK side -> cannon parameters reset to (direction=0, angle=45)
All of the server's dispenser cannon parameters are saved in server shutdown and recalled on startup, which means the settings of individual dispenser cannons are retained.
Source code
@GitHub
评论 0
登录后参与评分
还没有评论,来抢沙发吧