1
0
Fork 0
The portal creating plugin for Minecraft.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

31 lines
923 B

package net.deliciousreya.minecraftportal
import org.bukkit.Material
import org.bukkit.event.EventHandler
import org.bukkit.event.block.BlockPlaceEvent
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.inventory.ItemStack
import org.bukkit.plugin.java.JavaPlugin
class MinecraftPortalPlugin() : JavaPlugin()
{
override fun onEnable() {
super.onEnable()
logger.info("Loaded the portal plugin!")
for (player in server.onlinePlayers) {
player.inventory.setItem(0, ItemStack(Material.GLASS, 10))
}
}
@EventHandler
fun onPlayerJoin(e: PlayerJoinEvent) {
e.player.inventory.setItem(0, ItemStack(Material.GLASS, 10))
}
@EventHandler
fun onBlockPlaced(e: BlockPlaceEvent) {
if (e.block.type.equals(Material.GLASS)) {
logger.info("put down glass at " + e.block.location + " in " + e.block.world)
}
}
}