+Add InventoryFillerCommand #135
@ -632,6 +632,12 @@ SMART_PLACE_INFO = §7Places rotatable blocks §eaway§7 from you when §esneaki
|
||||
SMART_PLACE_ENABLE = §aSmartPlace activated
|
||||
SMART_PLACE_DISABLE = §cSmartPlace deactivated
|
||||
|
||||
# InventoryFiller
|
||||
INVENTORY_FILL_HELP = §8/§einventoryfill §8- §7Toggles InventoryFill
|
||||
INVENTORY_FILL_INFO = §7Helps you fill containers by looking at them while sneaking and dropping the item. Or just scroll on a container to change the amount of the item inside.
|
||||
INVENTORY_FILL_ENABLE = §aInventoryFiller activated
|
||||
INVENTORY_FILL_DISABLE = §cInventoryFiller deactivated
|
||||
|
||||
# BlockCounter
|
||||
BLOCK_COUNTER_HELP_TOGGLE = §8/§eblockcounter §8- §7Toggle on/off
|
||||
BLOCK_COUNTER_HELP_ENABLE = §8/§eblockcounter enable §8- §7Toggles BlockCounter on
|
||||
|
@ -613,6 +613,12 @@ SMART_PLACE_INFO = §7Plaziert rotierbare Blöcke beim §esneaken§7 von dir §e
|
||||
SMART_PLACE_ENABLE = §aSmartPlace aktiviert
|
||||
SMART_PLACE_DISABLE = §cSmartPlace deaktiviert
|
||||
|
||||
# InventoryFiller
|
||||
INVENTORY_FILL_HELP = §8/§einventoryfill §8- §7Toggled InventoryFill
|
||||
INVENTORY_FILL_INFO = §7Hilft dir, Behälter zu füllen, indem du sie beim sneaken ansiehst und den Gegenstand fallen lässt. Oder scrolle einfach auf einen Behälter, um die Menge des gehaltenen Gegenstandes darin zu ändern.
|
||||
INVENTORY_FILL_ENABLE = §aInventoryFiller activated
|
||||
INVENTORY_FILL_DISABLE = §cInventoryFiller deactivated
|
||||
|
||||
# BlockCounter
|
||||
BLOCK_COUNTER_HELP_TOGGLE = §8/§eblockcounter §8- §7Wechsel zwischen an und aus
|
||||
BLOCK_COUNTER_HELP_ENABLE = §8/§eblockcounter enable §8- §7Schalte den BlockCounter an
|
||||
|
@ -17,9 +17,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.bausystem.features.util;
|
||||
package de.steamwar.bausystem.features.inventoryfiller;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.configplayer.Config;
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
import de.steamwar.bausystem.linkage.Linked;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
@ -38,6 +39,8 @@ public class InventoryFiller implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerDropItem(PlayerDropItemEvent event) {
|
||||
|
||||
YoyoNow markierte diese Unterhaltung als gelöst
|
||||
if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("inventoryfill", false)) return;
|
||||
if (!event.getPlayer().isSneaking()) return;
|
||||
Block block = event.getPlayer().getTargetBlockExact(5);
|
||||
if (block == null) return;
|
||||
@ -58,6 +61,8 @@ public class InventoryFiller implements Listener {
|
||||
*/
|
||||
@EventHandler
|
||||
public void onPlayerItemHeld(PlayerItemHeldEvent event) {
|
||||
|
||||
if (!Config.getInstance().get(event.getPlayer()).getPlainValueOrDefault("inventoryfill", false)) return;
|
||||
if (!event.getPlayer().isSneaking()) return;
|
||||
ItemStack itemStack = event.getPlayer().getInventory().getItemInMainHand();
|
||||
if (itemStack.getType() == Material.AIR) return;
|
@ -0,0 +1,30 @@
|
||||
package de.steamwar.bausystem.features.inventoryfiller;
|
||||
|
||||
import de.steamwar.bausystem.BauSystem;
|
||||
import de.steamwar.bausystem.SWUtils;
|
||||
import de.steamwar.bausystem.configplayer.Config;
|
||||
import de.steamwar.bausystem.linkage.LinkageType;
|
||||
import de.steamwar.bausystem.linkage.Linked;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@Linked(LinkageType.COMMAND)
|
||||
public class InventoryFillerCommand extends SWCommand {
|
||||
|
||||
public InventoryFillerCommand() {
|
||||
super("inventoryfill");
|
||||
}
|
||||
|
||||
@Register(description = {"INVENTORY_FILL_HELP", "INVENTORY_FILL_INFO"})
|
||||
public void toggle(Player player) {
|
||||
|
||||
YoyoNow markierte diese Unterhaltung als gelöst
YoyoNow
hat
Leere Zeile? Leere Zeile?
|
||||
boolean inventoryFill = Config.getInstance().get(player).getPlainValueOrDefault("inventoryfill", false);
|
||||
Config.getInstance().get(player).put("inventoryfill", !inventoryFill);
|
||||
|
||||
Chaoscaot
hat
evt. nicht immer die Nachricht senden, vllt. nur unter help evt. nicht immer die Nachricht senden, vllt. nur unter help
|
||||
if(!inventoryFill) {
|
||||
YoyoNow markierte diese Unterhaltung als gelöst
YoyoNow
hat
Ein if mag auch ' ' danach Ein if mag auch ' ' danach
|
||||
SWUtils.sendToActionbar(player, BauSystem.MESSAGE.parse("INVENTORY_FILL_ENABLE", player));
|
||||
BauSystem.MESSAGE.send("INVENTORY_FILL_INFO", player);
|
||||
}else
|
||||
SWUtils.sendToActionbar(player, BauSystem.MESSAGE.parse("INVENTORY_FILL_DISABLE", player));
|
||||
}
|
||||
}
|
In neuem Issue referenzieren
Einen Benutzer sperren
Leere Zeile?