IS it even possible to run sdk mod's with bukkit? I would imagine if you put all the files in the correct directorys it would work but theres the problem of the Mincraftserver.class file that is completely different. I decompiled the both of them but i don't know enough about java coding to splice them together. I wondering if anyone could work out somthing that would work as both of them heres the code from both
Minecraftserver.class from SDK mod's
// Decompiled
// Source File Name: MinecraftServer.java
package net.minecraft.server;
import ModLoader;
import aa;
import al;
import ao;
import bc;
import bd;
import be;
import bf;
import cc;
import cg;
import cm;
import cs;
import cv;
import dx;
import dy;
import dz;
import ed;
import fz;
import gy;
import he;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import jg;
import kh;
import ki;
import lg;
import ln;
public class MinecraftServer
implements Runnable, kh
{
public MinecraftServer()
{
p = true;
g = false;
h = 0;
q = new ArrayList();
r = Collections.synchronizedList(new ArrayList());
ModLoader.Init(this);
new bf(this);
}
private boolean d()
throws IOException
{
o = new ki(this);
be threadcommandreader = new be(this);
threadcommandreader.setDaemon(true);
threadcommandreader.start();
dx.a();
a.info("Starting minecraft server version Beta 1.3");
if(Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L)
{
a.warning("**** NOT ENOUGH RAM!");
a.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
a.info("Loading properties");
d = new jg(new File("server.properties"));
String s = d.a("server-ip", "");
this.l = d.a("online-mode", true);
m = d.a("spawn-animals", true);
n = d.a("pvp", true);
InetAddress inetaddress = null;
if(s.length() > 0)
inetaddress = InetAddress.getByName(s);
int i = d.a("server-port", 25565);
a.info((new StringBuilder()).append("Starting Minecraft server on ").append(s.length() == 0 ? "*" : s).append(":").append(i).toString());
c = new cc(this, inetaddress, i);
if(!this.l)
{
a.warning("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
a.warning("The server will make no attempt to authenticate usernames. Beware.");
a.warning("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
a.warning("To change this, set \"online-mode\" to \"true\" in the server.settings file.");
}
f = new ed(this);
k = new ln(this);
long l = System.nanoTime();
String s1 = d.a("level-name", "world");
a.info((new StringBuilder()).append("Preparing level \"").append(s1).append("\"").toString());
a(new dz(new File(".")), s1);
a.info((new StringBuilder()).append("Done (").append(System.nanoTime() - l).append("ns)! For help, type \"help\" or \"?\"").toString());
return true;
}
private void a(he isaveformat, String s)
{
if(isaveformat.a(s))
{
a.info("Converting map!");
isaveformat.a(s, new bd(this));
}
a.info("Preparing start region");
e = new cv(this, new gy(new File("."), s, true), s, d.a("hellworld", false) ? -1 : 0);
e.a(new cs(this));
e.j = d.a("spawn-monsters", true) ? 1 : 0;
e.a(d.a("spawn-monsters", true), m);
f.a(e);
char c = '\304';
long l = System.currentTimeMillis();
al chunkcoordinates = e.l();
for(int i = -c; i <= c && p; i += 16)
{
for(int j = -c; j <= c && p; j += 16)
{
long l1 = System.currentTimeMillis();
if(l1 < l)
l = l1;
if(l1 > l + 1000L)
{
int k = (c * 2 + 1) * (c * 2 + 1);
int i1 = (i + c) * (c * 2 + 1) + (j + 1);
a("Preparing spawn area", (i1 * 100) / k);
l = l1;
}
e.u.d(chunkcoordinates.a + i >> 4, chunkcoordinates.c + j >> 4);
while(e.e() && p) ;
}
}
e();
}
private void a(String s, int i)
{
this.i = s;
j = i;
a.info((new StringBuilder()).append(s).append(": ").append(i).append("%").toString());
}
private void e()
{
i = null;
j = 0;
}
private void f()
{
a.info("Saving chunks");
e.a(true, null);
e.r();
}
private void g()
{
a.info("Stopping server");
if(f != null)
f.d();
if(e != null)
f();
}
public void a()
{
p = false;
}
public void run()
{
if(d())
{
long l = System.currentTimeMillis();
long l1 = 0L;
while(p)
{
ModLoader.OnTick(this);
long l2 = System.currentTimeMillis();
long l3 = l2 - l;
if(l3 > 2000L)
{
a.warning("Can't keep up! Did the system time change, or is the server overloaded?");
l3 = 2000L;
}
if(l3 < 0L)
{
a.warning("Time ran backwards! Did the system time change?");
l3 = 0L;
}
l1 += l3;
l = l2;
if(e.q())
{
h();
l1 = 0L;
} else
{
while(l1 > 50L)
{
l1 -= 50L;
h();
}
}
Thread.sleep(1L);
}
} else
{
while(p)
{
b();
try
{
Thread.sleep(10L);
}
catch(InterruptedException interruptedexception)
{
interruptedexception.printStackTrace();
}
}
}
g();
g = true;
System.exit(0);
break MISSING_BLOCK_LABEL_330;
Throwable localThrowable4;
localThrowable4;
localThrowable4.printStackTrace();
System.exit(0);
break MISSING_BLOCK_LABEL_330;
Exception exception;
exception;
System.exit(0);
throw exception;
Throwable throwable1;
throwable1;
throwable1.printStackTrace();
a.log(Level.SEVERE, "Unexpected exception", throwable1);
while(p)
{
b();
try
{
Thread.sleep(10L);
}
catch(InterruptedException interruptedexception1)
{
interruptedexception1.printStackTrace();
}
}
g();
g = true;
System.exit(0);
break MISSING_BLOCK_LABEL_330;
throwable1;
throwable1.printStackTrace();
System.exit(0);
break MISSING_BLOCK_LABEL_330;
Exception exception1;
exception1;
System.exit(0);
throw exception1;
Exception exception2;
exception2;
g();
g = true;
System.exit(0);
break MISSING_BLOCK_LABEL_327;
Throwable localThrowable4;
localThrowable4;
localThrowable4.printStackTrace();
System.exit(0);
break MISSING_BLOCK_LABEL_327;
Exception exception3;
exception3;
System.exit(0);
throw exception3;
throw exception2;
}
private void h()
{
ArrayList arraylist = new ArrayList();
for(Iterator iterator = b.keySet().iterator(); iterator.hasNext():wink.gif:
{
String s = (String)iterator.next();
int k = ((Integer)b.get(s)).intValue();
if(k > 0)
b.put(s, Integer.valueOf(k - 1));
else
arraylist.add(s);
}
for(int i = 0; i < arraylist.size(); i++)
b.remove(arraylist.get(i));
cg.a();
ao.a();
h++;
if(h % 20 == 0)
f.a(new dy(e.k()));
e.g();
while(e.e()) ;
e.d();
c.a();
f.b();
this.k.a();
for(int j = 0; j < q.size(); j++)
((cm)q.get(j)).a();
try
{
b();
}
catch(Exception exception)
{
a.log(Level.WARNING, "Unexpected exception while parsing console command", exception);
}
}
public void a(String s, kh icommandlistener)
{
r.add(new aa(s, icommandlistener));
}
public void b()
{
aa servercommand;
for(; r.size() > 0; o.a(servercommand))
servercommand = (aa)r.remove(0);
}
public void a(cm iupdateplayerlistbox)
{
q.add(iupdateplayerlistbox);
}
public static void main(String args[])
{
try
{
MinecraftServer minecraftserver = new MinecraftServer();
if(!java.awt.GraphicsEnvironment.isHeadless() && (args.length <= 0 || !args[0].equals("nogui")))
lg.a(minecraftserver);
(new bc("Server thread", minecraftserver)).start();
}
catch(Exception exception)
{
a.log(Level.SEVERE, "Failed to start the minecraft server", exception);
}
}
public File a(String s)
{
return new File(s);
}
public void b(String s)
{
a.info(s);
}
public String c()
{
return "CONSOLE";
}
public static boolean a(MinecraftServer minecraftserver)
{
return minecraftserver.p;
}
public static Logger a = Logger.getLogger("Minecraft");
public static HashMap b = new HashMap();
public cc c;
public jg d;
public cv e;
public ed f;
private ki o;
private boolean p;
public boolean g;
int h;
public String i;
public int j;
private List q;
private List r;
public ln k;
public boolean l;
public boolean m;
public boolean n;
}
Bukkit's Minecraftserver.class
// Decompiled
// Source File Name: MinecraftServer.java
package net.minecraft.server;
import java.io.*;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import jline.ConsoleReader;
import joptsimple.OptionSet;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.LoggerOutputStream;
import org.bukkit.craftbukkit.command.ColouredConsoleSender;
import org.bukkit.craftbukkit.scheduler.CraftScheduler;
import org.bukkit.craftbukkit.util.ServerShutdownThread;
import org.bukkit.event.world.WorldSaveEvent;
import org.bukkit.plugin.PluginManager;
// Referenced classes of package net.minecraft.server:
// ThreadSleepForever, ConsoleCommandHandler, ThreadCommandReader, PropertyManager,
// NetworkListenThread, ServerConfigurationManager, EntityTracker, WorldLoaderServer,
// ConvertProgressUpdater, WorldServer, ServerNBTManager, WorldManager,
// IProgressUpdate, EntityPlayer, Packet4UpdateTime, IUpdatePlayerListBox,
// ServerCommand, ThreadServerApplication, ICommandListener, ConsoleLogManager,
// Convertable, ChunkCoordinates, ChunkProviderServer, AxisAlignedBB,
// Vec3D, World, NetServerHandler
public class MinecraftServer
implements Runnable, ICommandListener
{
public MinecraftServer(OptionSet options)
{
p = true;
g = false;
h = 0;
q = new ArrayList();
r = Collections.synchronizedList(new ArrayList());
worlds = new ArrayList();
new ThreadSleepForever(this);
this.options = options;
try
{
reader = new ConsoleReader();
}
catch(IOException ex)
{
Logger.getLogger(net/minecraft/server/MinecraftServer.getName()).log(Level.SEVERE, null, ex);
}
Runtime.getRuntime().addShutdownHook(new ServerShutdownThread(this));
}
private boolean d()
throws UnknownHostException
{
o = new ConsoleCommandHandler(this);
ThreadCommandReader threadcommandreader = new ThreadCommandReader(this);
threadcommandreader.setDaemon(true);
threadcommandreader.start();
ConsoleLogManager.a(this);
System.setOut(new PrintStream(new LoggerOutputStream(a, Level.INFO), true));
System.setErr(new PrintStream(new LoggerOutputStream(a, Level.SEVERE), true));
a.info("Starting minecraft server version Beta 1.3");
if(Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L)
{
a.warning("**** NOT ENOUGH RAM!");
a.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
a.info("Loading properties");
d = new PropertyManager(options);
String s = d.a("server-ip", "");
l = d.a("online-mode", true);
m = d.a("spawn-animals", true);
n = d.a("pvp", true);
spawnProtection = d.a("spawn-protection", 16);
InetAddress inetaddress = null;
if(s.length() > 0)
inetaddress = InetAddress.getByName(s);
int i = d.a("server-port", 25565);
a.info((new StringBuilder()).append("Starting Minecraft server on ").append(s.length() != 0 ? s : "*").append(":").append(i).toString());
try
{
c = new NetworkListenThread(this, inetaddress, i);
}
catch(Throwable ioexception)
{
a.warning("**** FAILED TO BIND TO PORT!");
a.log(Level.WARNING, (new StringBuilder()).append("The exception was: ").append(ioexception.toString()).toString());
a.warning("Perhaps a server is already running on that port?");
return false;
}
if(!l)
{
a.warning("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
a.warning("The server will make no attempt to authenticate usernames. Beware.");
a.warning("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
a.warning("To change this, set \"online-mode\" to \"true\" in the server.settings file.");
}
f = new ServerConfigurationManager(this);
k = new EntityTracker(this);
long j = System.nanoTime();
String s1 = d.a("level-name", "world");
a.info((new StringBuilder()).append("Preparing level \"").append(s1).append("\"").toString());
a(new WorldLoaderServer(new File(".")), s1);
long elapsed = System.nanoTime() - j;
String time = String.format("%.3fs", new Object[] {
Double.valueOf((double)elapsed / 10000000000D)
});
a.info((new StringBuilder()).append("Done (").append(time).append(")! For help, type \"help\" or \"?\"").toString());
return true;
}
private void a(Convertable convertable, String s)
{
if(convertable.a(s))
{
a.info("Converting map!");
convertable.a(s, new ConvertProgressUpdater(this));
}
a.info("Preparing start region");
WorldServer world = new WorldServer(this, new ServerNBTManager(new File("."), s, true), s, d.a("hellworld", false) ? -1 : 0);
world.a(new WorldManager(this, world));
world.j = d.a("spawn-monsters", true) ? 1 : 0;
world.a(d.a("spawn-monsters", true), m);
f.a(world);
worlds.add(world);
short short1 = 196;
long i = System.currentTimeMillis();
ChunkCoordinates chunkcoordinates = ((WorldServer)worlds.get(0)).l();
for(int j = -short1; j <= short1 && p; j += 16)
{
for(int k = -short1; k <= short1 && p; k += 16)
{
long l = System.currentTimeMillis();
if(l < i)
i = l;
if(l > i + 1000L)
{
int i1 = (short1 * 2 + 1) * (short1 * 2 + 1);
int j1 = (j + short1) * (short1 * 2 + 1) + k + 1;
a("Preparing spawn area", (j1 * 100) / i1);
i = l;
}
for(Iterator i$ = worlds.iterator(); i$.hasNext():wink.gif:
{
WorldServer worldserver = (WorldServer)i$.next();
world.u.d(chunkcoordinates.a + j >> 4, chunkcoordinates.c + k >> 4);
while(world.e() && p) ;
}
}
}
e();
}
private void a(String s, int i)
{
this.i = s;
j = i;
a.info((new StringBuilder()).append(s).append(": ").append(i).append("%").toString());
}
private void e()
{
i = null;
j = 0;
server.loadPlugins();
}
void f()
{
a.info("Saving chunks");
WorldSaveEvent event;
for(Iterator i$ = worlds.iterator(); i$.hasNext(); server.getPluginManager().callEvent(event))
{
WorldServer world = (WorldServer)i$.next();
world.a(true, (IProgressUpdate)null);
world.r();
event = new WorldSaveEvent(world.getWorld());
}
f.d();
}
public void g()
{
a.info("Stopping server");
if(server != null)
server.disablePlugins();
if(f != null)
f.d();
if(worlds.size() > 0)
f();
}
public void a()
{
p = false;
}
public void run()
{
if(d())
{
long i = System.currentTimeMillis();
long j = 0L;
while(p)
{
long k = System.currentTimeMillis();
long l = k - i;
if(l > 2000L)
{
a.warning("Can't keep up! Did the system time change, or is the server overloaded?");
l = 2000L;
}
if(l < 0L)
{
a.warning("Time ran backwards! Did the system time change?");
l = 0L;
}
j += l;
i = k;
if(worlds.size() > 0 && ((WorldServer)worlds.get(0)).q())
{
h();
j = 0L;
} else
{
while(j > 50L)
{
j -= 50L;
h();
}
}
Thread.sleep(1L);
}
} else
{
while(p)
{
b();
try
{
Thread.sleep(10L);
}
catch(InterruptedException interruptedexception)
{
interruptedexception.printStackTrace();
}
}
}
g();
g = true;
System.exit(0);
break MISSING_BLOCK_LABEL_347;
Throwable throwable1;
throwable1;
throwable1.printStackTrace();
System.exit(0);
break MISSING_BLOCK_LABEL_347;
Exception exception;
exception;
System.exit(0);
throw exception;
Throwable throwable;
throwable;
throwable.printStackTrace();
a.log(Level.SEVERE, "Unexpected exception", throwable);
while(p)
{
b();
try
{
Thread.sleep(10L);
}
catch(InterruptedException interruptedexception1)
{
interruptedexception1.printStackTrace();
}
}
g();
g = true;
System.exit(0);
break MISSING_BLOCK_LABEL_347;
throwable;
throwable.printStackTrace();
System.exit(0);
break MISSING_BLOCK_LABEL_347;
Exception exception1;
exception1;
System.exit(0);
throw exception1;
Exception exception2;
exception2;
g();
g = true;
System.exit(0);
break MISSING_BLOCK_LABEL_344;
Throwable throwable1;
throwable1;
throwable1.printStackTrace();
System.exit(0);
break MISSING_BLOCK_LABEL_344;
Exception exception3;
exception3;
System.exit(0);
throw exception3;
throw exception2;
}
private void h()
{
ArrayList arraylist = new ArrayList();
for(Iterator iterator = b.keySet().iterator(); iterator.hasNext():wink.gif:
{
String s = (String)iterator.next();
int i = ((Integer)b.get(s)).intValue();
if(i > 0)
b.put(s, Integer.valueOf(i - 1));
else
arraylist.add(s);
}
for(int j = 0; j < arraylist.size(); j++)
b.remove(arraylist.get(j));
AxisAlignedBB.a();
Vec3D.a();
h++;
if(h % 20 == 0)
{
for(int i = 0; i < f.b.size(); i++)
{
EntityPlayer entityplayer = (EntityPlayer)f.b.get(i);
entityplayer.a.b(new Packet4UpdateTime(entityplayer.world.k()));
}
}
((CraftScheduler)server.getScheduler()).mainThreadHeartbeat(h);
WorldServer world;
for(Iterator i$ = worlds.iterator(); i$.hasNext(); world.d())
{
world = (WorldServer)i$.next();
world.g();
while(world.e()) ;
}
c.a();
f.b();
k.a();
for(int j = 0; j < q.size(); j++)
((IUpdatePlayerListBox)q.get(j)).a();
try
{
b();
}
catch(Exception exception)
{
a.log(Level.WARNING, "Unexpected exception while parsing console command", exception);
}
}
public void a(String s, ICommandListener icommandlistener)
{
r.add(new ServerCommand(s, icommandlistener));
}
public void b()
{
ServerCommand servercommand;
for(; r.size() > 0; server.dispatchCommand(console, servercommand))
servercommand = (ServerCommand)r.remove(0);
}
public void a(IUpdatePlayerListBox iupdateplayerlistbox)
{
q.add(iupdateplayerlistbox);
}
public static void main(OptionSet options)
{
try
{
MinecraftServer minecraftserver = new MinecraftServer(options);
(new ThreadServerApplication("Server thread", minecraftserver)).start();
}
catch(Exception exception)
{
a.log(Level.SEVERE, "Failed to start the minecraft server", exception);
}
}
public File a(String s)
{
return new File(s);
}
public void b(String s)
{
a.info(s);
}
public String c()
{
return "CONSOLE";
}
public static boolean a(MinecraftServer minecraftserver)
{
return minecraftserver.p;
}
public static Logger a = Logger.getLogger("Minecraft");
public static HashMap b = new HashMap();
public NetworkListenThread c;
public PropertyManager d;
public ServerConfigurationManager f;
public ConsoleCommandHandler o;
private boolean p;
public boolean g;
int h;
public String i;
public int j;
private List q;
private List r;
public EntityTracker k;
public boolean l;
public boolean m;
public boolean n;
public int spawnProtection;
public List worlds;
public CraftServer server;
public OptionSet options;
public ColouredConsoleSender console;
public ConsoleReader reader;
}
Minecraftserver.class from SDK mod's
Bukkit's Minecraftserver.class
Basically i need someone to make them work as one