Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright (C) 2020 Bryan Larson.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@Goblom
Goblom / Async.java
Created February 2, 2015 06:07
4 am coding at its fines
/*
* Copyright 2015 Goblom.
*
* All Rights Reserved unless otherwise explicitly stated.
*/
package codes.goblom.gperms.misc;
import codes.goblom.gperms.GoblomPerms;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Goblom
Goblom / Wrapped.java
Created December 20, 2014 02:30
Wrapped Awesomeness
public class Wrapped<T> {
private T object;
public Wrapped() {
this(null);
}
public Wrapped(T obj) {
this.object = obj;
}
package net.theemeraldisle.core.utils;
import net.minecraft.server.v1_7_R4.ChatSerializer;
import net.minecraft.server.v1_7_R4.IChatBaseComponent;
import net.minecraft.server.v1_7_R4.PacketPlayOutChat;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.json.simple.JSONObject;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
@Goblom
Goblom / rekt?.java
Created August 5, 2014 08:43
Something funny Packeteer can do
@PacketHandler(type = PacketHandleType.INCOMING, forClass = "PacketPlayInUpdateSign")
public void onPlayInSignUpdate(PacketEvent event) {
Packet packet = event.getPacket();
String[] lines = packet.read("d", String[].class);
for (int i = 0; i < lines.length; i++) {
lines[i] = "rekt?";
}
}
@Goblom
Goblom / Ropes.java
Last active August 29, 2015 13:57
Ropes
import net.minecraft.server.v1_7_R1.EntityBat;
import net.minecraft.server.v1_7_R1.EntityWitherSkull;
import net.minecraft.server.v1_7_R1.PacketPlayOutAttachEntity;
import net.minecraft.server.v1_7_R1.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntity;
import net.minecraft.server.v1_7_R1.PacketPlayOutSpawnEntityLiving;
import net.minecraft.server.v1_7_R1.WorldServer;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v1_7_R1.CraftWorld;
@Goblom
Goblom / Hologram.java
Created February 21, 2014 16:10
A not completed version of a hologram type system in bukkit using NMS... A list of what is missing is located above the author tab
/*
* The MIT License
*
* Copyright 2014 Goblom.
*
* 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
@Goblom
Goblom / CachedTable.java
Created February 19, 2014 19:58
Caching System
/*
* Copyright 2014 Goblom.
*/
import java.sql.SQLException;
/**
*
* @author Goblom
*/
public String getPlayersInWorld(World world) {
String message = "[World Players] " + "[" + world.getName() + "] ";
int playerAmount = world.getPlayers().size();
int playersAdded = 0;
for (Player player : world.getPlayers()) {
if (playersAdded == 0) {
message = message + player.getName() + "";
playersAdded = playersAdded + 1; //playersAdded++; ?
} else {
message = message + ", " + player.getName();