Skip to content

Instantly share code, notes, and snippets.

Jaime Martínez Rincón jamezrin

Block or report user

Report or block jamezrin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jamezrin
jamezrin / ReflectPing.java
Last active Jan 11, 2016
Snippet for getting the ping of a player using reflection
View ReflectPing.java
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
public final class ReflectPing {
private String nmsver;
private Class<?> cpc, epc;
View ItemSet.java
import java.util.Arrays;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
View Bots.bat
@echo off
::The number of bots
set BOTS=10
::The ip to connect
set IP=127.0.0.1:25565
::The delay between connections
set DELAY=0
@jamezrin
jamezrin / ConfigurationManager.java
Last active Feb 18, 2016
BungeeConfigurationManager
View ConfigurationManager.java
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
public class ConfigurationManager {
public static Configuration loadConfig(String name, Main main) {
@jamezrin
jamezrin / ConfigurationManager.java
Last active Apr 15, 2016
BukkitConfigurationManager
View ConfigurationManager.java
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
public class ConfigurationManager {
public static FileConfiguration loadConfig(File file, Main main) {
FileConfiguration config = null;
View PingExample.java
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.IOException;
import java.net.InetSocketAddress;
public class PingExample {
private static Gson gson = new Gson();
@jamezrin
jamezrin / EntityUtils.java
Last active Jun 28, 2016
Method utility to get the skull of an entity
View EntityUtils.java
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Skeleton;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
public class EntityUtils {
public static ItemStack getSkull(Entity entity) {
EntityType type = entity.getType();
@jamezrin
jamezrin / SkullType.java
Created Sep 9, 2016
An utility to get heads of all the mobs in minecraft without contacting with Mojang API
View SkullType.java
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import com.mojang.authlib.properties.PropertyMap;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import java.lang.reflect.Field;
@jamezrin
jamezrin / SignTest.java
Last active Sep 11, 2016
An example plugin class that uses ProtocolLib to show a sign with predefined text
View SignTest.java
public final class SignTest extends JavaPlugin {
private ProtocolManager manager;
@Override
public void onEnable() {
manager = ProtocolLibrary.getProtocolManager();
}
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
@jamezrin
jamezrin / AsyncDbQueue.java
Created Oct 1, 2016 — forked from aikar/AsyncDbQueue.java
Empire Minecraft DB Wrapper - EmpireDb - Released as MIT - Ignore the copyright headers
View AsyncDbQueue.java
/*
* Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.systems.db;
import com.empireminecraft.util.Util;
You can’t perform that action at this time.