Skip to content

Commit

Permalink
set boussole à l'arrivée du joueur dans le serv
Browse files Browse the repository at this point in the history
  • Loading branch information
Niilyx committed Oct 21, 2022
1 parent c0748fa commit 8f27ba2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/fr/efreicraft/eclobby/listeners/Login.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
package fr.efreicraft.eclobby.listeners;

import fr.efreicraft.eclobby.Main;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.CompassMeta;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.Collections;

import static fr.efreicraft.eclobby.Main.colorize;

public class Login implements Listener {

public static ItemStack menuBoussole;

@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
Expand All @@ -27,5 +41,7 @@ public void onPlayerJoin(PlayerJoinEvent event) {
player.teleport(new Location(player.getWorld(), 0.5, 1, 0.5, 90, 0));
}
}, 0L, 20L);

player.getInventory().setItem(0, menuBoussole);
}
}

0 comments on commit 8f27ba2

Please sign in to comment.