From 6b5d559e76dd5f52397719ae5ebaf9f1d8876c8f Mon Sep 17 00:00:00 2001 From: CoasterFreakDE Date: Wed, 12 Jun 2024 15:38:15 +0200 Subject: [PATCH] chore: Readme Update --- README.md | 31 +++++++------------ .../liamxsage/energeticstorage/Variables.kt | 8 ++++- .../commands/ESGiveCommand.kt | 3 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f8114d3..d006dd5 100644 --- a/README.md +++ b/README.md @@ -54,31 +54,24 @@ If you run into any issues, * All drives have a type limit set at 64, 128, 256 or 512. This means that only this amount of different item types can be added to a single drive. * Can be changed in config. -* ES System - * The ES System is what keeps the drives inside it and is used to access the items stored on the drives. - * You can trust players into the system; they will have just as much access as you do. - * Only the system owner can trust players. - * If you have Lands installed, you can trust areas to access the system. - * Public ES Systems: - * **_Anybody_** will have access to take items from the system. - * Only trusted players and the owner of the system can destroy it. +* DiskDrive +* Terminal +* NetworkCore +* Importer +* Exporter +* *More info coming soon* ## Permissions -* `energeticstorage.*`: Gives all Energetic Storage permissions. Default: `op` -* `energeticstorage.reload`: Gives permission to reload the Energetic Storage configuration files. Default: `op` -* `energeticstorage.esgive`: Gives permission to give an Energetic Storage item to themselves. Default: `op` -* `energeticstorage.esgive.others`: Gives permission to give an Energetic Storage item to others. Default: `op` -* `energeticstorage.system.open.untrusted`: Gives permission to open an ES System that the player is not trusted on. - Default: `op` -* `energeticstorage.system.create`: Gives permission to create an ES System. Default: `Everyone` -* `energeticstorage.system.destroy.untrusted`: Gives permission to destroy a system the player isn't trusted on. - Default: `op` +* `energeticstorage.give`: Gives permission to give an Energetic Storage item to themselves. Default: `op` +* `energeticstorage.give.others`: Gives permission to give an Energetic Storage item to others. Default: `op` +* `energeticstorage.debug`: Gives permission to toggle debug mode. Default: `op` ## Commands -* /esreload -* /esgive [1k, 4k, 16k, 64k, system] (player) +* `/esdebug`: Toggles debug mode. +* `/esgive [player]` : Gives an Energetic Storage item to the player. If no player is specified, it gives it to the + command sender. ## Config: diff --git a/src/main/kotlin/com/liamxsage/energeticstorage/Variables.kt b/src/main/kotlin/com/liamxsage/energeticstorage/Variables.kt index 7d1184e..3f75873 100644 --- a/src/main/kotlin/com/liamxsage/energeticstorage/Variables.kt +++ b/src/main/kotlin/com/liamxsage/energeticstorage/Variables.kt @@ -1,6 +1,8 @@ package com.liamxsage.energeticstorage import org.bukkit.NamespacedKey +import org.bukkit.permissions.Permission +import org.bukkit.permissions.PermissionDefault const val PREFIX = "Energetic Storage >> " const val BLOCK_PREFIX = @@ -20,4 +22,8 @@ val GUI_FIXED_ITEM_NAMESPACE = NamespacedKey(EnergeticStorage.instance, "gui_fix val PLAYER_DEBUG_MODE_NAMESPACE = NamespacedKey(EnergeticStorage.instance, "debug_mode") -var MAX_NETWORK_LENGTH = 512 \ No newline at end of file +var MAX_NETWORK_LENGTH = 512 + + +// Permissions +val GIVE_OTHERS_PERMISSION = Permission("energeticstorage.give.others", PermissionDefault.OP) \ No newline at end of file diff --git a/src/main/kotlin/com/liamxsage/energeticstorage/commands/ESGiveCommand.kt b/src/main/kotlin/com/liamxsage/energeticstorage/commands/ESGiveCommand.kt index d5a7c8b..1044a0c 100644 --- a/src/main/kotlin/com/liamxsage/energeticstorage/commands/ESGiveCommand.kt +++ b/src/main/kotlin/com/liamxsage/energeticstorage/commands/ESGiveCommand.kt @@ -1,5 +1,6 @@ package com.liamxsage.energeticstorage.commands +import com.liamxsage.energeticstorage.GIVE_OTHERS_PERMISSION import com.liamxsage.energeticstorage.annotations.RegisterCommand import com.liamxsage.energeticstorage.extensions.sendMessagePrefixed import com.liamxsage.energeticstorage.extensions.sendSuccessSound @@ -29,7 +30,7 @@ class ESGiveCommand : CommandExecutor, TabExecutor { } val item = args[0].lowercase(Locale.getDefault()) - val player = if (args.size > 1) Bukkit.getPlayer(args[1]) else sender + val player = if (args.size > 1 && sender.hasPermission(GIVE_OTHERS_PERMISSION)) Bukkit.getPlayer(args[1]) else sender if (player !is Player) { sender.sendMessagePrefixed("Only players can receive items")