Skip to content

Instantly share code, notes, and snippets.

View effective-light's full-sized avatar
🎯
Focusing

Effective Light effective-light

🎯
Focusing
View GitHub Profile
@effective-light
effective-light / Database.java
Last active June 20, 2017 07:12
NoSQL connection pooling
package net.atomiccloud.acndatabase.bungee;
import net.atomiccloud.acndatabase.GameMode;
import net.atomiccloud.acndatabase.bungee.data.Statistics;
import net.md_5.bungee.api.connection.ProxiedPlayer;
public interface Database {
Statistics getStatistics(GameMode game, ProxiedPlayer player);
}
public class AcceptCommand implements CommandExecutor
{
private ChallengeMain plugin;
public AcceptCommand(ChallengeMain plugin)
{
this.plugin = plugin;
}
import org.bukkit.Bukkit;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
/*
* Copyright (c) 2014 hamzaxx
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
@effective-light
effective-light / NMSUtils.java
Last active June 20, 2017 07:12
Byte-code engineering
/*
* Copyright (c) 2014 hamzaxx
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
import java.util.List;
public class ItemCreator
{
@effective-light
effective-light / Hologram.java
Last active June 19, 2017 21:19
Holograms.
/**
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@effective-light
effective-light / ProfileFetcher.java
Last active June 20, 2017 07:12 — forked from natemort/UUIDFetcher.java
UUIDFetcher v3 Utilizing Mojang's new profiles API.
/*
* Copyright (c) 2015 Nate Mortensen
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
import org.bukkit.Location;
public class SkyWarsIsland
{
private Location[] spawnLocations;
public SkyWarsIsland(Location[] spawnLocations)
{