开源软件名称(OpenSource Name):joshcough/MinecraftPlugins开源软件地址(OpenSource Url):https://github.com/joshcough/MinecraftPlugins开源编程语言(OpenSource Language):Scala 86.6%开源软件介绍(OpenSource Introduction):OverviewThis project contains an API for building Minecraft Plugins in Scala. It is currently made up of several sub-projects, but the most important ones to know about are:
Why?There are several reasons for building this API, but the three that pop to mind immediately are:
Note: The core API is built on Bukkit version 1.7.2-R0.2 (http://bukkit.org/), which works with Minecraft 1.7.2. ExamplesListener example: LightningArrowsThe following example demonstrates how to use listeners in Scala. This plugin strikes an entity (any player or mob) with lightning if that entity is hit with an arrow: import com.joshcough.minecraft.Listeners._
import org.bukkit.entity.EntityType.ARROW
class LightningArrows extends ListeningFor(OnEntityDamageByEntity { e =>
if (e.getDamager isAn ARROW) e.world.strikeLightning(e.loc)
}) Commands example: ShockThe following example demonstrates how to write commands in Scala. It has one command called "shock" which takes a player as input, and shocks that player with lightning. import com.joshcough.minecraft.CommandPlugin
class Shock extends CommandPlugin {
val command = Command("shock", "shock a player", player){ case (you, them) =>
them.shock
}
} Other StuffOther subprojectsThere are a few other sub projects and I'll mention them just very briefly here.
Links |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论