-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,016 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
lobby: | ||
maintenance: | ||
1: false | ||
2: false | ||
3: false | ||
4: false | ||
5: false | ||
servers: | ||
1: | ||
enabled: false | ||
host: 167.86.92.68 | ||
port: 25567 | ||
2: | ||
enabled: false | ||
host: 167.86.92.68 | ||
port: 25568 | ||
3: | ||
enabled: false | ||
host: 167.86.92.68 | ||
port: 25569 | ||
4: | ||
enabled: false | ||
host: 167.86.92.68 | ||
port: 25570 | ||
5: | ||
enabled: false | ||
host: 167.86.92.68 | ||
port: 25571 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package me.Drison64.Lobby; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Entity; | ||
import org.bukkit.entity.EntityType; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.entity.EntityDamageByEntityEvent; | ||
import org.bukkit.event.entity.EntityDamageEvent; | ||
import org.bukkit.event.entity.EntityInteractEvent; | ||
import org.bukkit.event.inventory.InventoryType; | ||
import org.bukkit.event.player.PlayerInteractAtEntityEvent; | ||
import org.bukkit.event.player.PlayerInteractEntityEvent; | ||
import org.bukkit.inventory.ItemStack; | ||
|
||
import java.time.Instant; | ||
import java.util.Arrays; | ||
import java.util.Date; | ||
import java.util.Timer; | ||
|
||
public class ASclick implements Listener { | ||
|
||
public void clicked(Entity entity, Player player) { | ||
if (entity.getType().equals(EntityType.ARMOR_STAND)) { | ||
if (entity.getCustomName().equals(ChatColor.BLUE + "Daily Reward")) { | ||
customConfig.reload(); | ||
/* | ||
if (customConfig.get().isSet("dailyreward." + player.getName() + ".timestamp")) { | ||
long now = Instant.now().getEpochSecond(); | ||
long finish = customConfig.get().getLong("dailyreward." + player.getName() + ".timestamp") + 86400; | ||
player.openInventory(dailyReward.inv); | ||
long seconds = (finish - now) % 60; | ||
long hours = (finish - now) / 60; | ||
long minutes = hours % 60; | ||
hours = hours / 60; | ||
if (!((finish - now) == 0)) { | ||
dailyReward.inv.setItem(1, new ItemStack(mkitem.mkitem(1, Material.COAL, "Daily Reward", Arrays.asList("", "Next in " + hours + ":" + minutes + ":" + seconds)))); | ||
} else { | ||
customConfig.get().set("dailyreward." + player.getName() + ".timestamp", null); | ||
} | ||
} else { | ||
dailyReward.inv.setItem(1, new ItemStack(mkitem.mkitem(1, Material.DIAMOND, "Daily Reward", Arrays.asList("", "Click to get!")))); | ||
} | ||
*/ | ||
player.openInventory(dailyReward.inv); | ||
} else if (entity.getCustomName().equals(ChatColor.BLUE + "Tic Tac Toe")) { | ||
player.openInventory(Bukkit.createInventory(null, 27, "Tic tac toe menu")); | ||
customConfig.save(); | ||
player.getOpenInventory().getTopInventory().setItem(11, mkitem.mkitem(1, Material.DIRT, "Random", Arrays.asList(""))); | ||
player.getOpenInventory().getTopInventory().setItem(15, mkitem.mkitem(1, Material.DIAMOND_BLOCK, "Enter name", Arrays.asList(""))); | ||
} | ||
} | ||
} | ||
|
||
@EventHandler | ||
public void onEntityClick(PlayerInteractAtEntityEvent e) { | ||
e.setCancelled(true); | ||
clicked(e.getRightClicked(), e.getPlayer()); | ||
} | ||
|
||
@EventHandler | ||
public void onDamage(EntityDamageByEntityEvent e) { | ||
e.setCancelled(true); | ||
if (e.getDamager() instanceof Player) { | ||
clicked(e.getEntity(), (Player) e.getDamager()); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.