Skip to content

Instantly share code, notes, and snippets.

View TheMasteredPanda's full-sized avatar

Duke Jake Morgan TheMasteredPanda

  • England, London.
View GitHub Profile
import asyncio
import json
import aiohttp
import bs4
from bs4.element import Tag
async def parse_cgs():
async with aiohttp.ClientSession() as session:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.tmp.grpc</groupId>
<artifactId>GRPC</artifactId>
<version>1.0-SNAPSHOT</version>
public void populate(Class<?> clazz, Object instance)
{
this.lib.debug(this, "Attempting to populate class " + clazz.getName() + ".");
for (Field f : clazz.getFields()) {
this.lib.debug(this, "Iteration landed at " + f.getName() + ".");
if (!f.isAnnotationPresent(ConfigPopulate.class)) {
this.lib.debug(this, f.getName() + " does not have the correct annotation.");
continue;
}
/**
* Same as BaseFile#populate but allows for formatting to be automatically done.
* @param clazz - the class.
*/
@Override
public void populate(Class<?> clazz, Object instance)
{
this.lib.debug(this, "Attempting to populate class " + clazz.getName() + ".");
for (Field f : clazz.getFields()) {
this.lib.debug(this, "Iteration landed at " + f.getName() + ".");
Plugin:
Prefix: "&b&Bungee Core &7»"
PluginMessageFormat: "{prefix} &a{message}"
ListHeaderFormat: "todo"
ListFooterFormat: "todo"
PageIndexFormat: "todo"
Modules:
Commands:
Server:
@Override @SneakyThrows
public synchronized void load()
{
if (!this.getInstance().getDataFolder().exists()) {
this.getInstance().getDataFolder().mkdir();
}
if (this.getInstance().getResourceAsStream(this.getName()) != null && !this.getFile().exists()) {
InputStream is = this.getInstance().getResourceAsStream(this.getName());
OutputStream os = new FileOutputStream(this.getFile());
package net.zoramagic.bungee.core.api.module;
import com.google.common.collect.Maps;
import io.pucman.bungee.manager.Manager;
import net.zoramagic.bungee.core.ZCore;
import java.util.Arrays;
import java.util.LinkedHashMap;
public class ModuleManager extends Manager<ZCore>
@TheMasteredPanda
TheMasteredPanda / CommandManager.java
Last active November 1, 2017 19:07
ServerCommand Module
package io.pucman.bungee.command;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import io.pucman.bungee.PLibrary;
import io.pucman.bungee.manager.Manager;
import lombok.AccessLevel;
import lombok.Getter;
import net.md_5.bungee.api.plugin.Plugin;
package io.pucman.common.time;
import io.pucman.common.exception.UtilException;
import java.util.Calendar;
import java.util.concurrent.TimeUnit;
/**
* To map a time into a written, formatted, time.
*/
package io.pucman.server.conversation.action.block;
import io.pucman.common.generic.GenericUtil;
import io.pucman.server.conversation.action.Action;
import io.pucman.server.conversation.conversable.Conversable;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockEvent;