From d3e937ec78c88358fb331032d9e4370d3e8bb2ed Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 22 Mar 2022 09:45:10 +0100 Subject: [PATCH] Op on join --- src/de/steamwar/tutorial/TutorialSystem.java | 2 ++ .../steamwar/tutorial/listener/Joining.java | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/de/steamwar/tutorial/listener/Joining.java diff --git a/src/de/steamwar/tutorial/TutorialSystem.java b/src/de/steamwar/tutorial/TutorialSystem.java index 2b90136..2393f69 100644 --- a/src/de/steamwar/tutorial/TutorialSystem.java +++ b/src/de/steamwar/tutorial/TutorialSystem.java @@ -19,6 +19,7 @@ package de.steamwar.tutorial; +import de.steamwar.tutorial.listener.Joining; import de.steamwar.tutorial.listener.RateSign; import org.bukkit.plugin.java.JavaPlugin; @@ -34,6 +35,7 @@ public class TutorialSystem extends JavaPlugin { @Override public void onEnable() { new RateSign(); + new Joining(); } public static TutorialSystem getPlugin() { diff --git a/src/de/steamwar/tutorial/listener/Joining.java b/src/de/steamwar/tutorial/listener/Joining.java new file mode 100644 index 0000000..86df8fb --- /dev/null +++ b/src/de/steamwar/tutorial/listener/Joining.java @@ -0,0 +1,31 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2021 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.tutorial.listener; + +import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerJoinEvent; + +public class Joining extends BasicListener { + + @EventHandler + public void onJoin(PlayerJoinEvent event) { + event.getPlayer().setOp(true); + } +}