如果你和我一样,在玩 Minecraft 时木材总是供不应求。于是你去森林里砍了一些树,对吧?这意味着森林里的树变少了。虽然树会掉落树苗,但你真的每次都有时间去重新种植它们吗?其他服务器上的玩家呢?如果不加注意,严重的森林砍伐就会发生,导致无数动物失去家园。请记住,栖息地丧失会导致生物多样性减少!这个问题看起来可能太大,无法独自解决,你的想法是正确的。这就是 Reforestaion 发挥作用的地方!一款革命性的简单插件,让大自然自我恢复!
这是如何实现的?
每当树苗从玩家或树上掉落时,如果它可以在掉落的位置种植,它会自动作为树苗方块放置,并最终长成一棵新树。你无需任何操作!
它可以自定义吗?
如果你正在更新到 v2.2.0,你必须将 itemID 和 blockID 节点更改为使用 Bukkit 材质的 itemName 和 blockName 节点。
是的!如果你编辑位于 /plugins/Reforestaion/reforestation.xml 的配置文件,你可以设置任意方块和元数据组合。默认情况下,只会添加原版树苗,但你可以移除或添加你想要的任何方块。这包括花朵和蘑菇等物品,也可以扩展到模组树苗(当 Bukkit 实现通过 ID 或名称访问这些模组物品的方式时)。你还可以设置插件检查树苗的频率延迟,默认为每 200 刻(即 10 秒)。刻延迟值以刻为单位测量,因此 20 刻等于 1 秒。
在这个 XML 文件中,你还可以指定应禁用的整个世界以及特定的 WorldGuard 区域。如果你想禁用 Residence 区域,请确保在该区域中禁用了标志 "autoplant"(默认启用)。
由于一些用户可能发现更改配置文件中的值很困难,我将发布 reforestation.xml 文件首次生成时的样子。你可以使用任何文本编辑器(如记事本)打开它。
<?xml version="1.0" encoding="UTF-8"?>
<reforestation>
<!-- 你可以使用游戏内的命令 "/reforestation [on|off]" 切换插件是否启用,但这控制的是启动时是否启用 -->
<autoEnable>true</autoEnable>
<!-- 这是插件等待查看是否可以种植树苗的时间间隔。1 秒 = 20 刻 -->
<tickDelay>200</tickDelay>
<!-- 以下展示如何禁用某些世界
<disabled type="world">
<world>要禁用的世界名称</world>
</disabled>
-->
<!-- 这展示了如何禁用某些 WorldGuard 区域
<disabled type="region">
<world>该区域所在的世界</world>
<region>要禁用的区域名称</region>
</disabled>
-->
<!-- 如果你想禁用 Residence 区域,请确保在该区域中禁用了标志 "autoplant" -->
<plant name="Oak">
<itemName>SAPLING</itemName>
</plant>
<plant name="Spruce">
<itemName>SAPLING</itemName>
<itemMeta>1</itemMeta>
</plant>
<plant name="Birch">
<itemName>SAPLING</itemName>
<itemMeta>2</itemMeta>
</plant>
<plant name="Jungle">
<itemName>SAPLING</itemName>
<itemMeta>3</itemMeta>
</plant>
<plant name="Acacia">
<itemName>SAPLING</itemName>
<itemMeta>4</itemMeta>
</plant>
<plant name="Dark Oak">
<itemName>SAPLING</itemName>
<itemMeta>5</itemMeta>
</plant>
<!-- 以下是如何添加种植不同方块的物品的示例
你可以指定 blockName 和 blockMeta 节点来自定义放置哪个方块
默认使用的方块和元数据与物品的相同
<plant name="Wheat Seeds">
<itemName>SEEDS</itemName>
<blockName>CROPS</blockName>
</plant>
-->
</reforestation>
提示:注释是介于
<!-- 和 -->
之间的任何内容。注释完全被忽略,仅用于帮助你理解。
要添加更多树苗,只需创建一个新的 plant 节点,填写 name 属性,然后添加更多子节点。你可以添加的子节点包括:itemName,掉落物品的材质;itemMeta,掉落物品的元数据;blockName,将要放置的方块的材质;以及 blockMeta,将要放置的方块的元数据。如果元数据为 0,则不需要包含 itemMeta;如果方块材质和元数据与原始物品相同,则不需要包含 blockMaterial 和 blockMeta。
要添加一个禁用自动种植的区域,只需取消注释 disabled region 节点,并将世界和区域名称更改为你自己的名称。你可以添加任意数量的禁用区域。禁用世界的工作原理相同,只是你不需要 WorldGuard 插件来使用它们,它们的 type 属性是 "world",并且不使用 region 子节点。为了在 Residence 区域中禁用 Reforestation,只需确保在该区域中禁用了标志 "autoplant" 即可。
如果你在理解如何更改配置时遇到困难,请发表评论,我会尽力帮助你。
你也可以在游戏中随时使用 /reforestation [on|off] 命令来启用或禁用该插件。你需要拥有权限节点 reforestation.toggle 才能使用该命令。如果你希望插件在服务器启动时处于禁用状态,请将 config.yml 中的 auto enable 设置为 false,否则每次启动服务器时插件都会自动启用种植功能。
为什么需要这个?
这是一款有趣的插件,为你的服务器增添了圆润顺滑的体验。其真实性的一个例子是:你可以点燃一场火灾,它会像现实世界中那样促使树苗掉落,从而帮助森林生长。
你是如何制作出如此出色的插件的?
很高兴你问了!如果你想了解我是如何实现各项功能的,请查看插件的源代码:
If you're anything like me, when you're playing Minecraft wood is in a constant demand. So, you go and cut down some trees from a forest, right? That means a few less trees for the forest. The trees do drop saplings, but do you really take the time to replant them every single time? How about other people on your server? If you're not careful, serious deforestation can occur, leaving countless animals without a home. Remember, biodiversity shrinks with habitat loss! This problem may seem too large to tackle all by yourself, and you'd be right to think so. That's where Reforestaion comes in! A revolutionary simple plugin that lets mother nature take care of herself!
How is this possible?
Every time a sapling drops from a player or tree, if it can be planted where it lays, it will automatically be placed as a sapling block and will eventually grow into a new tree. No work required on your part!
Is it customizable?
If you're updating to v2.2.0, you have to change your itemID and blockID nodes to itemName and blockName nodes that use Bukkit materials
Yes! If you edit the config file located in /plugins/Reforestaion/reforestation.xml, you can set any block and metadata combination. By default the vanilla saplings will only be added, but you can remove or add any blocks you want. This includes things like flowers and mushrooms, but also is extendable to modded saplings (when Bukkit implements a way to access those modded items though IDs or names). You can also set the delay for how often the plugin checks for saplings, which is by default every 200 ticks, or 10 seconds. The tick delay value is measured in ticks, so that means 20 ticks equals 1 second.
In this XML file you can also specify entire worlds that should be disabled as well as specific WorldGuard regions. If you would like to disable Residence regions, make sure the flag "autoplant" (which is enabled by default) is disabled in the region.
Because some users may find it difficult to change values in the config, I'll post what the reforestation.xml file will look like when it's first generated. You can open it with any text editor such as Notepad.
<?xml version="1.0" encoding="UTF-8"?>
<reforestation>
<!-- You can toggle whether the plugin is enabled or not using the command "/reforestation [on|off]" in game, but this controls if it's enabled on startup -->
<autoEnable>true</autoEnable>
<!-- This is how long the plugin waits to see if it can plant saplings. 1 second = 20 ticks -->
<tickDelay>200</tickDelay>
<!-- The following shows how to disable certain worlds
<disabled type="world">
<world>name_of_world_to_disable</world>
</disabled>
-->
<!-- This shows how to disable certain WorldGuard regions
<disabled type="region">
<world>world_that_region_is_in</world>
<region>name_of_region_to_disable</region>
</disabled>
-->
<!-- If you want to disable Residence regions, then make sure the flag "autoplant" is disabled in the region -->
<plant name="Oak">
<itemName>SAPLING</itemName>
</plant>
<plant name="Spruce">
<itemName>SAPLING</itemName>
<itemMeta>1</itemMeta>
</plant>
<plant name="Birch">
<itemName>SAPLING</itemName>
<itemMeta>2</itemMeta>
</plant>
<plant name="Jungle">
<itemName>SAPLING</itemName>
<itemMeta>3</itemMeta>
</plant>
<plant name="Acacia">
<itemName>SAPLING</itemName>
<itemMeta>4</itemMeta>
</plant>
<plant name="Dark Oak">
<itemName>SAPLING</itemName>
<itemMeta>5</itemMeta>
</plant>
<!-- Below is an example of how you would add items that plant different blocks
You can specifiy the blockName and blockMeta nodes to customize which block is placed
By default the block and metadata used are the same as the item's
<plant name="Wheat Seeds">
<itemName>SEEDS</itemName>
<blockName>CROPS</blockName>
</plant>
-->
</reforestation>
Tip: A comment is anything between
<!-- and -->
Comments are completely ignored and are only there to help you.
To add more saplings, just create a new plant node, fill out the name attribute, and then add more sub-nodes. The sub-nodes you can add are: itemName, the material of the dropped item; itemMeta, the metadata of the dropped item; blockName, the material of the block that will be placed; and blockMeta, the metadata of the block that will be placed. You do not need to include itemMeta if the metadata is 0 or blockMaterial and blockMeta if those are the same as the original items.
To add a WorldGuard region where auto planting is disabled, simply uncomment out the disabled region node and change the world and region names to your own. You can add as many disabled regions as you'd like. Disabled worlds work the same way, except you don't need the plugin WorldGuard to use them, their type attribute is "world", and they don't use the region sub-node. In order to disable Reforestation in a Residence region, simply make sure the flag "autoplant" is disabled there.
If you're having trouble understanding how to change the config, please post a comment and I'll try to help you.
You can also use /reforestation [on|off] to enable or disable the plugin at any time in game. You need to have the permission node reforestation.toggle in order to use the command. If you want the plugin to be disabled when you start the server, change auto enable to false in the config.yml, or else every time you start the server the plugin will enable planting.
Why do I need this?
It's a fun plugin that adds a nice rounded feel to your server. An example of its realism is that you could start a fire that will actually help the forest grow by causing saplings to fall, just like in the real world.
How did you make such an amazing plugin?
I'm glad you asked! If you're interested in seeing how I accomplished anything, please check out the plugin's source at
评论 0
登录后参与评分
还没有评论,来抢沙发吧