Skip to content

Instantly share code, notes, and snippets.

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;
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"
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;
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();
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";
@zh32
zh32 / gist:5020193
Last active December 14, 2015 03:19
From ee1ac62ba261caeab0f25671cc8daa5e0afd22a2 Mon Sep 17 00:00:00 2001
From: zh32 <[email protected]>
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 +++++--
From 0131b1d1dd39526149324ee43a33cfd3e50326c2 Mon Sep 17 00:00:00 2001
From: zh32 <[email protected]>
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(-)
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());