use of gg.projecteden.nexus.features.events.y2021.pugmas21.Pugmas21 in project Nexus by ProjectEdenGG.
the class AdventMenu method init.
@Override
public void init() {
int row = 1;
int column = Pugmas21.EPOCH.getDayOfWeek().getValue() + 1;
final SlotIterator slotIterator = innerSlotIterator(contents, SlotPos.of(row, column));
for (int day = 1; day <= 25; day++) {
final int _day = day;
final LocalDate date = Pugmas21.EPOCH.plusDays(_day - 1);
final Icon icon = getIcon(date);
final ItemBuilder item = new ItemBuilder(icon.getItem(_day));
ClickableItem clickableItem = ClickableItem.empty(item.build());
if (user.advent().hasFound(_day)) {
item.lore("", "&aShow Waypoint");
clickableItem = ClickableItem.of(item.build(), e -> {
player.closeInventory();
Advent.glow(user, _day);
});
}
slotIterator.next().set(clickableItem);
}
updateTask(player, contents);
}
use of gg.projecteden.nexus.features.events.y2021.pugmas21.Pugmas21 in project Nexus by ProjectEdenGG.
the class Pugmas21Command method advent.
@Path("advent")
@Description("Open the advent calender")
void advent(@Arg(value = "0", permission = Group.ADMIN) @Switch int day, @Arg(value = "30", permission = Group.ADMIN) @Switch int frameTicks) {
verifyDate();
LocalDate date = Pugmas21.TODAY;
if (date.isBefore(Pugmas21.EPOCH) || day > 0)
date = Pugmas21.EPOCH.plusDays(day - 1);
new AdventMenu(user, date, frameTicks).open(player());
}
use of gg.projecteden.nexus.features.events.y2021.pugmas21.Pugmas21 in project Nexus by ProjectEdenGG.
the class Advent method onDistrictEnter.
@EventHandler
public void onDistrictEnter(PlayerEnteredRegionEvent event) {
Player player = event.getPlayer();
if (!Pugmas21.isAtPugmas(player))
return;
District district = District.of(player.getLocation());
if (district != null && district != District.UNKNOWN)
ActionBarUtils.sendActionBar(player, "&a&lEntering " + district.getFullName());
}
use of gg.projecteden.nexus.features.events.y2021.pugmas21.Pugmas21 in project Nexus by ProjectEdenGG.
the class Advent method onDistrictExit.
@EventHandler
public void onDistrictExit(PlayerLeavingRegionEvent event) {
Player player = event.getPlayer();
if (!Pugmas21.isAtPugmas(player))
return;
District district = District.of(player.getLocation());
if (district != null && district != District.UNKNOWN)
ActionBarUtils.sendActionBar(player, "&c&lExiting " + district.getFullName());
}
Aggregations