Skip to content

Instantly share code, notes, and snippets.

View gist:2b8f00ba6f7cdabef74d
import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.charset.Charset;
View gist:4361a38c22ba04ff74f5
public class Application extends Controller {
static Form<TestData> form = Form.form(TestData.class);
public static Result index() {
return ok(index.render(form));
}
public static Result submit() {
Form<TestData> filledForm = form.bindFromRequest(); //bindFromRequest returns "a copy of this form filled with the new data"
View ServerListPing17.java
package de.zh32.slp;
import com.google.gson.Gson;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
View gist:6991460
public class DamageUtil {
public static void createExplosion(Projectile pro, WeaponType weapontype, LivingEntity shooter) {
int radius = weapontype.getDamage();
Location loc = pro.getLocation();
List<Entity> en = pro.getNearbyEntities(radius, radius, radius);
pro.getLocation().getWorld().createExplosion(loc, 0.0F, false);
for (Entity ent : en) {
if (ent instanceof LivingEntity) {
HumanEntity le = (HumanEntity) ent;
Location eyeloc = le.getEyeLocation();
View MinecraftServer.java
package no.jckf.slplib;
import java.io.*;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.nio.charset.Charset;
public final class MinecraftServer {
private String address = "localhost";
View gist:5020193
From ee1ac62ba261caeab0f25671cc8daa5e0afd22a2 Mon Sep 17 00:00:00 2001
From: zh32 <devnull@zh32.de>
Date: Sat, 23 Feb 2013 04:26:11 +0100
Subject: [PATCH 1/2] it works :D
---
pom.xml | 2 +-
src/main/java/de/zh32/auth/Auth.java | 13 +++++++++++++
src/main/java/net/minecraft/server/EntityPlayer.java | 4 +++-
src/main/java/net/minecraft/server/PendingConnection.java | 7 +++++--
View gist:5020192
From 0131b1d1dd39526149324ee43a33cfd3e50326c2 Mon Sep 17 00:00:00 2001
From: zh32 <devnull@zh32.de>
Date: Sat, 23 Feb 2013 04:32:26 +0100
Subject: [PATCH 1/2] it works :D
---
pom.xml | 2 +-
src/main/java/org/bukkit/entity/Player.java | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
View gist:4595919
package de.zh32.bungeeex;
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.plugin.Plugin;
public class BungeeEx extends Plugin {
@Override
public void onEnable() {
ProxyServer.getInstance().getPluginManager().registerListener(new TestListener());
You can’t perform that action at this time.