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
/* | |
* File name: Glow.java | |
*/ | |
import java.lang.reflect.Field; | |
import org.bukkit.enchantments.Enchantment; | |
import org.bukkit.enchantments.EnchantmentTarget; | |
import org.bukkit.inventory.ItemStack; |
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 packetplayoutchat; | |
import net.minecraft.server.v1_8_R3.PacketPlayOutChat; | |
import org.bukkit.Bukkit; | |
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; | |
import org.bukkit.entity.Player; | |
import net.minecraft.server.v1_8_R3.IChatBaseComponent.ChatSerializer; |
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.dont.testes.utils; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.function.BiConsumer; | |
import java.util.function.Consumer; |
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 event; | |
public abstract class Event { | |
public String getName() { | |
return getClass().getSimpleName(); | |
} | |
} |
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
public Object nbtToJava(Object nbt) { | |
if (!(nbt instanceof NBTBase)) | |
return nbt; | |
NBTBase base = (NBTBase) nbt; | |
if (base instanceof NBTTagByte) | |
return ((NBTTagByte) base).f(); | |
if (base instanceof NBTTagByteArray) | |
return ((NBTTagByteArray) base).c(); | |
if (base instanceof NBTTagShort) |
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.wizardlybump17.imperiumphones; | |
import org.apache.logging.log4j.Level; | |
import org.apache.logging.log4j.Marker; | |
import org.apache.logging.log4j.core.LogEvent; | |
import org.apache.logging.log4j.core.Logger; | |
import org.apache.logging.log4j.core.filter.AbstractFilter; | |
import org.apache.logging.log4j.message.Message; | |
import org.bukkit.Bukkit; | |
import org.bukkit.entity.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
private static final Map<Material, Material> DROPS = new HashMap<Material, Material>() {{ | |
put(Material.CARROT, Material.CARROT_ITEM); | |
put(Material.POTATO, Material.POTATO_ITEM); | |
put(Material.NETHER_WARTS, Material.NETHER_STALK); | |
put(Material.COCOA, Material.INK_SACK); | |
put(Material.COAL_ORE, Material.COAL); | |
put(Material.DIAMOND_ORE, Material.DIAMOND); | |
put(Material.EMERALD_ORE, Material.EMERALD); | |
put(Material.LAPIS_ORE, Material.INK_SACK); | |
put(Material.REDSTONE_ORE, Material.REDSTONE); |
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 final Map<Material, BlockDrop> FIXED_BLOCKS = new HashMap<Material, BlockDrop>() {{ | |
put(Material.CARROT, new BlockDrop(new MaterialData(Material.CARROT_ITEM))); | |
put(Material.POTATO, new BlockDrop(new MaterialData(Material.POTATO_ITEM))); | |
put(Material.NETHER_WARTS, new BlockDrop(new MaterialData(Material.NETHER_STALK))); | |
put(Material.COCOA, new BlockDrop(new MaterialData(Material.INK_SACK, (byte) 3))); | |
put(Material.IRON_ORE, new BlockDrop(new MaterialData(Material.IRON_ORE))); | |
put(Material.GOLD_ORE, new BlockDrop(new MaterialData(Material.GOLD_ORE))); | |
put(Material.COAL_ORE, new BlockDrop(new MaterialData(Material.COAL), new MaterialData(Material.COAL_ORE))); | |
put(Material.DIAMOND_ORE, new BlockDrop(new MaterialData(Material.DIAMOND), new MaterialData(Material.DIAMOND_ORE))); | |
put(Material.EMERALD_ORE, new BlockDrop(new MaterialData(Material.EMERALD), new MaterialData(Material.EMERALD_ORE))); |
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
@RequiredArgsConstructor | |
public class SQLUtil { | |
private static final Pattern PLACEHOLDER = Pattern.compile("\\{[a-zA-Z0-9_?]+}"); | |
private static final Connection CONNECTION; | |
static { | |
Connection con; | |
try { |
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
ProtocolManager manager = ProtocolLibrary.getProtocolManager(); | |
manager.addPacketListener(new PacketAdapter(Bukkit.getPluginManager().getPlugin("WLib"), PacketType.fromClass(PacketPlayOutSetSlot.class), PacketType.fromClass(PacketPlayOutEntityMetadata.class), PacketType.fromClass(PacketPlayOutEntityEquipment.class)) { | |
@SneakyThrows | |
@Override | |
public void onPacketSending(PacketEvent event) { | |
final Object handle = event.getPacket().getHandle(); | |
if (handle instanceof PacketPlayOutSetSlot) | |
setSlot((PacketPlayOutSetSlot) handle); |
OlderNewer