This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.comphenix.example; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.DataInput; | |
import java.io.DataInputStream; | |
import java.io.DataOutput; | |
import java.io.DataOutputStream; | |
import java.lang.reflect.Method; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Object minecraftServer; | |
private static Field recentTps; | |
public static double[] getRecentTps() { | |
try { | |
if (minecraftServer == null) { | |
Server server = Bukkit.getServer(); | |
Field consoleField = server.getClass().getDeclaredField("console"); | |
consoleField.setAccessible(true); | |
minecraftServer = consoleField.get(server); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.bukkit.Bukkit; | |
import org.bukkit.entity.LivingEntity; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class AIUtils { | |
private static Field fromMobSpawner; | |
private static Method getHandle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static Method getHandleMethod; | |
private static Field pingField; | |
private static int getPing(Player player) { | |
try { | |
if (getHandleMethod == null) { | |
getHandleMethod = player.getClass().getDeclaredMethod("getHandle"); | |
getHandleMethod.setAccessible(true); | |
} | |
Object entityPlayer = getHandleMethod.invoke(player); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.base.Charsets; | |
import com.google.common.base.Splitter; | |
import com.google.common.collect.Lists; | |
import org.bukkit.Bukkit; | |
import org.bukkit.ChatColor; | |
import org.bukkit.OfflinePlayer; | |
import org.bukkit.entity.Player; | |
import org.bukkit.scoreboard.*; | |
import java.lang.reflect.Constructor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.hugo4715.paytoprotect.utils; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Map; | |
import org.bukkit.Bukkit; | |
import org.bukkit.Chunk; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.hugo4715.paytoprotect.utils; | |
import java.util.Arrays; | |
import org.bukkit.DyeColor; | |
import org.bukkit.Material; | |
import org.bukkit.inventory.ItemStack; | |
import org.bukkit.inventory.meta.ItemMeta; | |
public class ItemFactory { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.hugo4715.paytoprotect; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.List; | |
import org.bukkit.Bukkit; | |
import org.bukkit.Location; | |
import org.bukkit.Material; | |
import org.bukkit.World; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// package tld.domain.project.name; | |
import net.minecraft.server.v1_8_R1.ChatSerializer; | |
import net.minecraft.server.v1_8_R1.PacketPlayOutChat; | |
import org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer; | |
import org.bukkit.entity.Player; | |
import java.lang.reflect.Field; | |
import java.util.HashMap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************IMPORTANT********************************************* | |
* Need to figure out how to remove the fakePlayer's name in the tab list.** | |
***************************************************************************/ | |
public class NPCUtils { | |
private static List<Integer> npcs = new ArrayList<Integer>(); | |
public static void despawnAll(){ | |
for(ForcePlayer cur : PlayerManager.getPlayers()){ | |
for(Integer i : npcs){ | |
if(!cur.getPlayer().isOnline())continue; |
OlderNewer