commit d3c7e8f298e84ab966936fc3deddd14f2bc2948d Author: ZockerKatze Date: Sat Apr 26 17:12:44 2025 +0200 initial diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..a0ccf77 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Environment-dependent path to Maven home directory +/mavenHomeManager.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..39104bc --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..942f3a2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..8c89be5 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..bd1edea --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..54efdf3 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..eda147d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..53b4679 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/CctvPlugin.iml b/CctvPlugin.iml new file mode 100644 index 0000000..3cf00db --- /dev/null +++ b/CctvPlugin.iml @@ -0,0 +1,13 @@ + + + + + + + PAPER + + 1 + + + + \ No newline at end of file diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml new file mode 100644 index 0000000..aae9af2 --- /dev/null +++ b/dependency-reduced-pom.xml @@ -0,0 +1,72 @@ + + + 4.0.0 + org.CctvPlugin + CctvPlugin + CctvPlugin + 1.0-SNAPSHOT + + ${project.basedir}/src/main/kotlin + clean package + + + true + src/main/resources + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + + ${java.version} + + + + maven-shade-plugin + 3.5.3 + + + package + + shade + + + + + + + + + papermc-repo + https://repo.papermc.io/repository/maven-public/ + + + sonatype + https://oss.sonatype.org/content/groups/public/ + + + + + io.papermc.paper + paper-api + 1.21.5-R0.1-SNAPSHOT + provided + + + + UTF-8 + 2.2.0-Beta1 + 21 + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..abf5966 --- /dev/null +++ b/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + org.CctvPlugin + CctvPlugin + 1.0-SNAPSHOT + jar + + CctvPlugin + + + 21 + 2.2.0-Beta1 + UTF-8 + + + + clean package + ${project.basedir}/src/main/kotlin + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + + ${java.version} + + + + org.apache.maven.plugins + maven-shade-plugin + 3.5.3 + + + package + + shade + + + + + + + + src/main/resources + true + + + + + + + papermc-repo + https://repo.papermc.io/repository/maven-public/ + + + sonatype + https://oss.sonatype.org/content/groups/public/ + + + + + + io.papermc.paper + paper-api + 1.21.5-R0.1-SNAPSHOT + provided + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin.version} + + + diff --git a/src/main/kotlin/org/CctvPlugin/cctvPlugin/CctvCommand.kt b/src/main/kotlin/org/CctvPlugin/cctvPlugin/CctvCommand.kt new file mode 100644 index 0000000..d921a24 --- /dev/null +++ b/src/main/kotlin/org/CctvPlugin/cctvPlugin/CctvCommand.kt @@ -0,0 +1,115 @@ +// CctvCommand.kt +package com.example.cctv + +import org.bukkit.command.Command +import org.bukkit.command.CommandExecutor +import org.bukkit.command.CommandSender +import org.bukkit.command.TabCompleter +import org.bukkit.entity.Player +import com.example.cctv.menus.MainMenu +import com.example.cctv.menus.ViewCamerasMenu +import com.example.cctv.menus.ManageCamerasMenu +import com.example.cctv.menus.PlaceCameraMenu + +class CctvCommand(private val plugin: CctvPlugin) : CommandExecutor, TabCompleter { + override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array): Boolean { + if (sender !is Player) { + sender.sendMessage("§cThis command can only be used by players.") + return true + } + + if (!sender.hasPermission("cctv.use")) { + sender.sendMessage("§cYou don't have permission to use this command.") + return true + } + + if (args.isEmpty()) { + MainMenu(plugin, sender).open() + return true + } + + when (args[0].lowercase()) { + "place", "create", "add" -> { + if (!sender.hasPermission("cctv.place")) { + sender.sendMessage("§cYou don't have permission to place cameras.") + return true + } + + if (args.size < 2) { + sender.sendMessage("§cUsage: /cctv place ") + return true + } + + val name = args.drop(1).joinToString(" ") + if (plugin.createCamera(sender, name)) { + sender.sendMessage("§aCamera '$name' placed successfully!") + } else { + sender.sendMessage("§cFailed to place camera.") + } + } + + "list", "view" -> { + ViewCamerasMenu(plugin, sender).open() + } + + "remove", "delete" -> { + if (args.size < 2) { + ManageCamerasMenu(plugin, sender).open() + return true + } + + val id = args[1] + if (plugin.removeCamera(id, sender)) { + sender.sendMessage("§aCamera removed successfully!") + } else { + sender.sendMessage("§cFailed to remove camera. Make sure you own it or have admin permissions.") + } + } + + "help" -> { + sender.sendMessage("§6=== CCTV Plugin Help ===") + sender.sendMessage("§e/cctv §7- Open main menu") + sender.sendMessage("§e/cctv place §7- Place a camera at your location") + sender.sendMessage("§e/cctv list §7- View available cameras") + sender.sendMessage("§e/cctv remove [id] §7- Remove a camera") + sender.sendMessage("§e/cctv help §7- Show this help message") + } + + else -> { + sender.sendMessage("§cUnknown subcommand. Use '/cctv help' for help.") + } + } + + return true + } + + override fun onTabComplete(sender: CommandSender, command: Command, alias: String, args: Array): List { + if (sender !is Player) return emptyList() + + if (args.isEmpty()) { + return emptyList() + } + + if (args.size == 1) { + val subCommands = mutableListOf() + if (sender.hasPermission("cctv.use")) { + subCommands.addAll(listOf("help", "list", "view")) + } + if (sender.hasPermission("cctv.place")) { + subCommands.addAll(listOf("place", "create", "add")) + } + if (sender.hasPermission("cctv.remove") || sender.hasPermission("cctv.admin")) { + subCommands.addAll(listOf("remove", "delete")) + } + + return subCommands.filter { it.startsWith(args[0].lowercase()) } + } + + if (args.size == 2 && (args[0].equals("remove", ignoreCase = true) || args[0].equals("delete", ignoreCase = true))) { + val cameras = plugin.getCameras() + return cameras.keys.filter { it.startsWith(args[1]) } + } + + return emptyList() + } +} \ No newline at end of file diff --git a/src/main/kotlin/org/CctvPlugin/cctvPlugin/CctvPlugin.kt b/src/main/kotlin/org/CctvPlugin/cctvPlugin/CctvPlugin.kt new file mode 100644 index 0000000..4934134 --- /dev/null +++ b/src/main/kotlin/org/CctvPlugin/cctvPlugin/CctvPlugin.kt @@ -0,0 +1,235 @@ +// CctvPlugin.kt +package com.example.cctv + +import org.bukkit.Bukkit +import org.bukkit.Location +import org.bukkit.Material +import org.bukkit.configuration.file.YamlConfiguration +import org.bukkit.entity.Player +import org.bukkit.event.EventHandler +import org.bukkit.event.Listener +import org.bukkit.event.inventory.InventoryClickEvent +import org.bukkit.event.player.PlayerJoinEvent +import org.bukkit.event.player.PlayerQuitEvent +import org.bukkit.inventory.ItemStack +import org.bukkit.plugin.java.JavaPlugin +import org.bukkit.scheduler.BukkitTask +import java.io.File +import java.util.* +import com.example.cctv.menus.CctvMenu +import com.example.cctv.menus.MainMenu +import com.example.cctv.menus.ViewCamerasMenu +import com.example.cctv.menus.ManageCamerasMenu +import com.example.cctv.menus.PlaceCameraMenu + +class CctvPlugin : JavaPlugin(), Listener { + private val cameras = mutableMapOf() + private val playerViewing = mutableMapOf() + private val viewingTasks = mutableMapOf() + private lateinit var cameraFile: File + private lateinit var cameraConfig: YamlConfiguration + + override fun onEnable() { + // Create config if it doesn't exist + saveDefaultConfig() + + // Register command + getCommand("cctv")?.setExecutor(CctvCommand(this)) + + // Register events + server.pluginManager.registerEvents(this, this) + + // Initialize camera data + cameraFile = File(dataFolder, "cameras.yml") + if (!cameraFile.exists()) { + saveResource("cameras.yml", false) + } + cameraConfig = YamlConfiguration.loadConfiguration(cameraFile) + + // Load cameras from configuration + loadCameras() + + logger.info("CCTV Plugin enabled!") + } + + override fun onDisable() { + // Stop all viewing sessions + playerViewing.keys.forEach { stopViewing(it) } + + // Save cameras to configuration + saveCameras() + + logger.info("CCTV Plugin disabled!") + } + + @EventHandler + fun onPlayerQuit(event: PlayerQuitEvent) { + // Stop viewing when player leaves + stopViewing(event.player.uniqueId) + } + + private fun loadCameras() { + if (cameraConfig.contains("cameras")) { + val camerasSection = cameraConfig.getConfigurationSection("cameras") + camerasSection?.getKeys(false)?.forEach { id -> + val section = camerasSection.getConfigurationSection(id) + if (section != null) { + val world = Bukkit.getWorld(section.getString("world") ?: "world") + if (world != null) { + val x = section.getDouble("x") + val y = section.getDouble("y") + val z = section.getDouble("z") + val yaw = section.getDouble("yaw").toFloat() + val pitch = section.getDouble("pitch").toFloat() + val name = section.getString("name") ?: "Camera $id" + val owner = UUID.fromString(section.getString("owner") ?: "00000000-0000-0000-0000-000000000000") + + val location = Location(world, x, y, z, yaw, pitch) + cameras[id] = Camera(id, name, location, owner) + } + } + } + } + } + + private fun saveCameras() { + // Clear existing cameras + cameraConfig.set("cameras", null) + + // Save each camera + cameras.forEach { (id, camera) -> + val path = "cameras.$id" + cameraConfig.set("$path.name", camera.name) + cameraConfig.set("$path.world", camera.location.world?.name) + cameraConfig.set("$path.x", camera.location.x) + cameraConfig.set("$path.y", camera.location.y) + cameraConfig.set("$path.z", camera.location.z) + cameraConfig.set("$path.yaw", camera.location.yaw) + cameraConfig.set("$path.pitch", camera.location.pitch) + cameraConfig.set("$path.owner", camera.owner.toString()) + } + + // Save to file + cameraConfig.save(cameraFile) + } + + fun getCameras(): Map { + return cameras.toMap() + } + + fun createCamera(player: Player, name: String): Boolean { + val id = UUID.randomUUID().toString().substring(0, 8) + val camera = Camera(id, name, player.location.clone(), player.uniqueId) + cameras[id] = camera + saveCameras() + return true + } + + fun removeCamera(id: String, player: Player): Boolean { + val camera = cameras[id] ?: return false + + // Check if the player is the owner or has permission + if (camera.owner != player.uniqueId && !player.hasPermission("cctv.admin")) { + return false + } + + // Stop anyone viewing this camera + playerViewing.forEach { (uuid, cam) -> + if (cam.id == id) { + stopViewing(uuid) + } + } + + cameras.remove(id) + saveCameras() + return true + } + + fun startViewing(player: Player, cameraId: String): Boolean { + // Stop current viewing if any + stopViewing(player.uniqueId) + + val camera = cameras[cameraId] ?: return false + + // Store original location + val originalLocation = player.location.clone() + camera.viewerLocations[player.uniqueId] = originalLocation + + // Teleport to camera view (spectator mode) + val gameMode = player.gameMode + camera.viewerGameModes[player.uniqueId] = gameMode + + player.gameMode = org.bukkit.GameMode.SPECTATOR + player.teleport(camera.location) + + // Set up viewing task + playerViewing[player.uniqueId] = camera + + // Create a task to check if player tries to exit spectator + val task = Bukkit.getScheduler().runTaskTimer(this, Runnable { + val currentPlayer = Bukkit.getPlayer(player.uniqueId) + if (currentPlayer == null || !currentPlayer.isOnline) { + stopViewing(player.uniqueId) + return@Runnable + } + + // Keep the player at the camera location + if (currentPlayer.location.distance(camera.location) > 0.5) { + currentPlayer.teleport(camera.location) + } + }, 5L, 5L) + + viewingTasks[player.uniqueId] = task + + return true + } + + fun stopViewing(uuid: UUID) { + val camera = playerViewing[uuid] ?: return + val player = Bukkit.getPlayer(uuid) ?: return + + // Restore original location + val originalLocation = camera.viewerLocations[uuid] + if (originalLocation != null) { + player.teleport(originalLocation) + camera.viewerLocations.remove(uuid) + } + + // Restore game mode + val originalGameMode = camera.viewerGameModes[uuid] + if (originalGameMode != null) { + player.gameMode = originalGameMode + camera.viewerGameModes.remove(uuid) + } + + // Cancel task + viewingTasks[uuid]?.cancel() + viewingTasks.remove(uuid) + + // Remove from viewing map + playerViewing.remove(uuid) + } + + @EventHandler + fun onInventoryClick(event: InventoryClickEvent) { + val player = event.whoClicked as? Player ?: return + val inventory = event.inventory + + if (inventory.holder is CctvMenu) { + event.isCancelled = true + val item = event.currentItem ?: return + + val menu = inventory.holder as CctvMenu + menu.handleClick(player, item, event.slot) + } + } + + data class Camera( + val id: String, + val name: String, + val location: Location, + val owner: UUID, + val viewerLocations: MutableMap = mutableMapOf(), + val viewerGameModes: MutableMap = mutableMapOf() + ) +} \ No newline at end of file diff --git a/src/main/kotlin/org/CctvPlugin/cctvPlugin/Menus.kt b/src/main/kotlin/org/CctvPlugin/cctvPlugin/Menus.kt new file mode 100644 index 0000000..4456b81 --- /dev/null +++ b/src/main/kotlin/org/CctvPlugin/cctvPlugin/Menus.kt @@ -0,0 +1,288 @@ +// Menus.kt +package com.example.cctv.menus + +import org.bukkit.Bukkit +import org.bukkit.Material +import org.bukkit.entity.Player +import org.bukkit.inventory.Inventory +import org.bukkit.inventory.InventoryHolder +import org.bukkit.inventory.ItemStack +import org.bukkit.inventory.meta.ItemMeta +import java.util.* +import com.example.cctv.CctvPlugin + +interface CctvMenu : InventoryHolder { + fun open() + fun handleClick(player: Player, item: ItemStack, slot: Int) +} + +class MainMenu(private val plugin: CctvPlugin, private val player: Player) : CctvMenu { + private val inventory: Inventory = Bukkit.createInventory(this, 27, "CCTV System") + + override fun getInventory(): Inventory = inventory + + override fun open() { + // Create menu items + val placeCameraItem = createItem(Material.ENDER_EYE, "§aPlace New Camera", listOf("§7Click to place a camera", "§7at your current location")) + val viewCamerasItem = createItem(Material.SPYGLASS, "§bView Cameras", listOf("§7Click to view available cameras")) + val manageCamerasItem = createItem(Material.REDSTONE_BLOCK, "§cManage Your Cameras", listOf("§7Click to manage your cameras")) + + // Place items in inventory + inventory.setItem(11, placeCameraItem) + inventory.setItem(13, viewCamerasItem) + inventory.setItem(15, manageCamerasItem) + + // Open inventory for player + player.openInventory(inventory) + } + + override fun handleClick(player: Player, item: ItemStack, slot: Int) { + when (slot) { + 11 -> { + if (player.hasPermission("cctv.place")) { + player.closeInventory() + PlaceCameraMenu(plugin, player).open() + } else { + player.sendMessage("§cYou don't have permission to place cameras.") + } + } + 13 -> { + player.closeInventory() + ViewCamerasMenu(plugin, player).open() + } + 15 -> { + player.closeInventory() + ManageCamerasMenu(plugin, player).open() + } + } + } + + private fun createItem(material: Material, name: String, lore: List): ItemStack { + val item = ItemStack(material) + val meta = item.itemMeta + + meta?.setDisplayName(name) + meta?.lore = lore + + item.itemMeta = meta + return item + } +} + +class PlaceCameraMenu(private val plugin: CctvPlugin, private val player: Player) : CctvMenu { + private val inventory: Inventory = Bukkit.createInventory(this, 36, "Place Camera") + + override fun getInventory(): Inventory = inventory + + override fun open() { + // Create menu items + for (i in 0..7) { + val cameraItem = createItem(Material.ENDER_EYE, "§aCamera ${i + 1}", listOf("§7Click to place", "§7Camera ${i + 1} at your location")) + inventory.setItem(10 + i, cameraItem) + } + + val closeItem = createItem(Material.BARRIER, "§cCancel", listOf("§7Click to return to main menu")) + inventory.setItem(31, closeItem) + + // Open inventory for player + player.openInventory(inventory) + } + + override fun handleClick(player: Player, item: ItemStack, slot: Int) { + if (slot in 10..17) { + val name = item.itemMeta?.displayName?.replace("§a", "") ?: "Camera" + if (plugin.createCamera(player, name)) { + player.sendMessage("§aCamera '$name' placed successfully at your location!") + } else { + player.sendMessage("§cFailed to place camera.") + } + player.closeInventory() + MainMenu(plugin, player).open() + } else if (slot == 31) { + player.closeInventory() + MainMenu(plugin, player).open() + } + } + + private fun createItem(material: Material, name: String, lore: List): ItemStack { + val item = ItemStack(material) + val meta = item.itemMeta + + meta?.setDisplayName(name) + meta?.lore = lore + + item.itemMeta = meta + return item + } +} + +class ViewCamerasMenu(private val plugin: CctvPlugin, private val player: Player) : CctvMenu { + private val inventory: Inventory = Bukkit.createInventory(this, 54, "View Cameras") + + override fun getInventory(): Inventory = inventory + + override fun open() { + val cameras = plugin.getCameras() + + if (cameras.isEmpty()) { + val noItem = createItem(Material.BARRIER, "§cNo Cameras Available", listOf("§7No cameras have been placed yet")) + inventory.setItem(22, noItem) + } else { + var slot = 0 + cameras.forEach { (id, camera) -> + if (slot < 45) { + val cameraItem = createItem( + Material.ENDER_EYE, + "§a${camera.name}", + listOf( + "§7ID: §f$id", + "§7Location: §f${camera.location.world?.name} (${camera.location.blockX}, ${camera.location.blockY}, ${camera.location.blockZ})", + "§7Owner: §f${Bukkit.getOfflinePlayer(camera.owner).name ?: "Unknown"}", + "", + "§eClick to view this camera" + ) + ) + + // Store camera ID in item NBT + val meta = cameraItem.itemMeta + meta?.persistentDataContainer?.set( + org.bukkit.NamespacedKey(plugin, "camera-id"), + org.bukkit.persistence.PersistentDataType.STRING, + id + ) + cameraItem.itemMeta = meta + + inventory.setItem(slot, cameraItem) + slot++ + } + } + } + + val backItem = createItem(Material.ARROW, "§cBack", listOf("§7Return to main menu")) + inventory.setItem(49, backItem) + + // Open inventory for player + player.openInventory(inventory) + } + + override fun handleClick(player: Player, item: ItemStack, slot: Int) { + if (slot == 49) { + player.closeInventory() + MainMenu(plugin, player).open() + return + } + + if (item.type == Material.ENDER_EYE) { + val meta = item.itemMeta ?: return + val cameraId = meta.persistentDataContainer.get( + org.bukkit.NamespacedKey(plugin, "camera-id"), + org.bukkit.persistence.PersistentDataType.STRING + ) ?: return + + player.closeInventory() + if (plugin.startViewing(player, cameraId)) { + player.sendMessage("§aViewing camera feed. Type /cctv to return.") + } else { + player.sendMessage("§cFailed to view camera.") + MainMenu(plugin, player).open() + } + } + } + + private fun createItem(material: Material, name: String, lore: List): ItemStack { + val item = ItemStack(material) + val meta = item.itemMeta + + meta?.setDisplayName(name) + meta?.lore = lore + + item.itemMeta = meta + return item + } +} + +class ManageCamerasMenu(private val plugin: CctvPlugin, private val player: Player) : CctvMenu { + private val inventory: Inventory = Bukkit.createInventory(this, 54, "Manage Cameras") + + override fun getInventory(): Inventory = inventory + + override fun open() { + val cameras = plugin.getCameras().filter { + it.value.owner == player.uniqueId || player.hasPermission("cctv.admin") + } + + if (cameras.isEmpty()) { + val noItem = createItem(Material.BARRIER, "§cNo Cameras Available", listOf("§7You don't have any cameras to manage")) + inventory.setItem(22, noItem) + } else { + var slot = 0 + cameras.forEach { (id, camera) -> + if (slot < 45) { + val cameraItem = createItem( + Material.ENDER_EYE, + "§a${camera.name}", + listOf( + "§7ID: §f$id", + "§7Location: §f${camera.location.world?.name} (${camera.location.blockX}, ${camera.location.blockY}, ${camera.location.blockZ})", + "", + "§eClick to remove this camera" + ) + ) + + // Store camera ID in item NBT + val meta = cameraItem.itemMeta + meta?.persistentDataContainer?.set( + org.bukkit.NamespacedKey(plugin, "camera-id"), + org.bukkit.persistence.PersistentDataType.STRING, + id + ) + cameraItem.itemMeta = meta + + inventory.setItem(slot, cameraItem) + slot++ + } + } + } + + val backItem = createItem(Material.ARROW, "§cBack", listOf("§7Return to main menu")) + inventory.setItem(49, backItem) + + // Open inventory for player + player.openInventory(inventory) + } + + override fun handleClick(player: Player, item: ItemStack, slot: Int) { + if (slot == 49) { + player.closeInventory() + MainMenu(plugin, player).open() + return + } + + if (item.type == Material.ENDER_EYE) { + val meta = item.itemMeta ?: return + val cameraId = meta.persistentDataContainer.get( + org.bukkit.NamespacedKey(plugin, "camera-id"), + org.bukkit.persistence.PersistentDataType.STRING + ) ?: return + + player.closeInventory() + if (plugin.removeCamera(cameraId, player)) { + player.sendMessage("§aCamera removed successfully!") + } else { + player.sendMessage("§cFailed to remove camera. Make sure you own it or have admin permissions.") + } + ManageCamerasMenu(plugin, player).open() + } + } + + private fun createItem(material: Material, name: String, lore: List): ItemStack { + val item = ItemStack(material) + val meta = item.itemMeta + + meta?.setDisplayName(name) + meta?.lore = lore + + item.itemMeta = meta + return item + } +} \ No newline at end of file diff --git a/src/main/resources/cameras.yml b/src/main/resources/cameras.yml new file mode 100644 index 0000000..85d1a3c --- /dev/null +++ b/src/main/resources/cameras.yml @@ -0,0 +1,2 @@ +cameras: + ## data is here automatically \ No newline at end of file diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml new file mode 100644 index 0000000..37583e9 --- /dev/null +++ b/src/main/resources/config.yml @@ -0,0 +1,4 @@ +settings: + max-cameras-per-player: 10 + camera-range: 50 # Maximum viewing distance + diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..29860f3 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,24 @@ +name: CctvPlugin +version: 1.0.0 +main: com.example.cctv.CctvPlugin +api-version: '1.21' +description: CCTV camera system for Minecraft +author: YourName +commands: + cctv: + description: Manage CCTV cameras + usage: /cctv [place|list|remove|help] + permission: cctv.use +permissions: + cctv.use: + description: Allows using the CCTV system + default: true + cctv.place: + description: Allows placing cameras + default: op + cctv.admin: + description: Allows managing all cameras + default: op + children: + cctv.use: true + cctv.place: true diff --git a/target/CctvPlugin-1.0-SNAPSHOT.jar b/target/CctvPlugin-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..20d71fe Binary files /dev/null and b/target/CctvPlugin-1.0-SNAPSHOT.jar differ diff --git a/target/classes/META-INF/CctvPlugin.kotlin_module b/target/classes/META-INF/CctvPlugin.kotlin_module new file mode 100644 index 0000000..ef915de Binary files /dev/null and b/target/classes/META-INF/CctvPlugin.kotlin_module differ diff --git a/target/classes/cameras.yml b/target/classes/cameras.yml new file mode 100644 index 0000000..85d1a3c --- /dev/null +++ b/target/classes/cameras.yml @@ -0,0 +1,2 @@ +cameras: + ## data is here automatically \ No newline at end of file diff --git a/target/classes/com/example/cctv/CctvCommand.class b/target/classes/com/example/cctv/CctvCommand.class new file mode 100644 index 0000000..7b6432d Binary files /dev/null and b/target/classes/com/example/cctv/CctvCommand.class differ diff --git a/target/classes/com/example/cctv/CctvPlugin$Camera.class b/target/classes/com/example/cctv/CctvPlugin$Camera.class new file mode 100644 index 0000000..63bb850 Binary files /dev/null and b/target/classes/com/example/cctv/CctvPlugin$Camera.class differ diff --git a/target/classes/com/example/cctv/CctvPlugin.class b/target/classes/com/example/cctv/CctvPlugin.class new file mode 100644 index 0000000..33b2fac Binary files /dev/null and b/target/classes/com/example/cctv/CctvPlugin.class differ diff --git a/target/classes/com/example/cctv/menus/CctvMenu.class b/target/classes/com/example/cctv/menus/CctvMenu.class new file mode 100644 index 0000000..21a7ec4 Binary files /dev/null and b/target/classes/com/example/cctv/menus/CctvMenu.class differ diff --git a/target/classes/com/example/cctv/menus/MainMenu.class b/target/classes/com/example/cctv/menus/MainMenu.class new file mode 100644 index 0000000..277120a Binary files /dev/null and b/target/classes/com/example/cctv/menus/MainMenu.class differ diff --git a/target/classes/com/example/cctv/menus/ManageCamerasMenu.class b/target/classes/com/example/cctv/menus/ManageCamerasMenu.class new file mode 100644 index 0000000..22a9049 Binary files /dev/null and b/target/classes/com/example/cctv/menus/ManageCamerasMenu.class differ diff --git a/target/classes/com/example/cctv/menus/PlaceCameraMenu.class b/target/classes/com/example/cctv/menus/PlaceCameraMenu.class new file mode 100644 index 0000000..e270ad9 Binary files /dev/null and b/target/classes/com/example/cctv/menus/PlaceCameraMenu.class differ diff --git a/target/classes/com/example/cctv/menus/ViewCamerasMenu.class b/target/classes/com/example/cctv/menus/ViewCamerasMenu.class new file mode 100644 index 0000000..ce5e344 Binary files /dev/null and b/target/classes/com/example/cctv/menus/ViewCamerasMenu.class differ diff --git a/target/classes/config.yml b/target/classes/config.yml new file mode 100644 index 0000000..37583e9 --- /dev/null +++ b/target/classes/config.yml @@ -0,0 +1,4 @@ +settings: + max-cameras-per-player: 10 + camera-range: 50 # Maximum viewing distance + diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml new file mode 100644 index 0000000..29860f3 --- /dev/null +++ b/target/classes/plugin.yml @@ -0,0 +1,24 @@ +name: CctvPlugin +version: 1.0.0 +main: com.example.cctv.CctvPlugin +api-version: '1.21' +description: CCTV camera system for Minecraft +author: YourName +commands: + cctv: + description: Manage CCTV cameras + usage: /cctv [place|list|remove|help] + permission: cctv.use +permissions: + cctv.use: + description: Allows using the CCTV system + default: true + cctv.place: + description: Allows placing cameras + default: op + cctv.admin: + description: Allows managing all cameras + default: op + children: + cctv.use: true + cctv.place: true diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..470e01e --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=CctvPlugin +groupId=org.CctvPlugin +version=1.0-SNAPSHOT diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/target/original-CctvPlugin-1.0-SNAPSHOT.jar b/target/original-CctvPlugin-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..f048d99 Binary files /dev/null and b/target/original-CctvPlugin-1.0-SNAPSHOT.jar differ