use of ivorius.reccomplex.world.gen.feature.WorldRandomData in project RecurrentComplex by Ivorforce.
the class RCForgeEventHandler method onPlayerJoin.
@SubscribeEvent
public void onPlayerJoin(PlayerEvent.PlayerLoggedInEvent event) {
if (RCConfig.postWorldStatus && event.player.canUseCommand(3, "op")) {
WorldRandomData randomData = WorldRandomData.get(FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld());
if (randomData.postWorldStatus(event.player.getName())) {
event.player.getServer().commandManager.executeCommand(event.player, RCCommands.sanity.getName() + " --silent --short");
ITextComponent count = new TextComponentString("" + StructureRegistry.INSTANCE.activeIDs().size());
count.getStyle().setColor(TextFormatting.AQUA);
ITextComponent list = new TextComponentString("[List]");
list.getStyle().setColor(TextFormatting.AQUA);
list.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("Show List")));
list.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/%s", RCCommands.list.getName())));
ITextComponent add = new TextComponentString("[Add]");
add.getStyle().setColor(TextFormatting.GREEN);
add.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("Browse Repository")));
add.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, Repository.browseURL()));
ITextComponent remove = new TextComponentString("[Remove]");
remove.getStyle().setColor(TextFormatting.RED);
remove.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("Disabling Structures")));
remove.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, Wiki.DISABLING_STRUCTURES));
ITextComponent help = new TextComponentString("[Help]");
help.getStyle().setColor(TextFormatting.AQUA);
help.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("Open Wiki")));
help.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, Wiki.HOME));
ITextComponent statusMessage = ServerTranslations.format("reccomplex.server.status", count, list, add, remove, help);
event.player.sendMessage(statusMessage);
}
}
}
Aggregations