Skip to content

Instantly share code, notes, and snippets.

View srleojaco's full-sized avatar
💻

Leo srleojaco

💻
View GitHub Profile
@srleojaco
srleojaco / FakePlayer.java
Created September 21, 2022 13:49 — forked from Swedz/FakePlayer.java
Create Fake Players that are specific for just some players!
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_8_R3.CraftServer;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
@srleojaco
srleojaco / DiscordWebhook.java
Created July 9, 2021 23:58 — forked from k3kdude/DiscordWebhook.java
Java DiscordWebhook class to easily execute Discord Webhooks
import javax.net.ssl.HttpsURLConnection;
import java.awt.Color;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Array;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@srleojaco
srleojaco / CancellationDetector.java
Created September 6, 2020 15:23 — forked from aadnk/CancellationDetector.java
A class that allows you to detect which plugin cancelled a given event.
package com.comphenix.example;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.Iterator;
import java.util.List;
import org.bukkit.event.Cancellable;
// 1. open chrome://settings/searchEngines
// 2. press Ctrl-Shift-J to open console
// 3. paste the following code
// note: you may have to run it multiple times to get rid of all of them
// If you have search engines you want to use add the text "(KEEP)" to their name
// and by name i mean the "Search engine" field when you add/edit one of the search engines
settings.SearchEnginesBrowserProxyImpl.prototype.getSearchEnginesList()
.then(function (val) {