Alright, I gave up trying to edit MinecraftServer.java. It's just not going to compile and I cannot for the life of me figure out why.
Other classes compile fine. The way I'm doing things is a little different than blitz but those directions are basically the same. If anyone has managed to edit and recompile MinecraftServer.java and lived to tell the tale, would you care to share?
@donkey kong
I tried to do that with TerrainMod, but it would give me some errors unless i passed the WHOLE path to the minecraft_server.jar...
But it's just me i guess...
The jar was in working directory but let me give this a shot. Nah, same error.
I still can't seem to get that far. I mean, I tried doing exactly what you said, but it didn't change whatever is holding me up. I added minecraft_server.jar to the class path, and it appears under referenced libraries, but no matter what I do, Eclipse says "The import ai cannot be resolved", referring to the first line of minecraft_server.java. Then hundreds of errors, one for each import and another each time something that would have been defined in that import is used.
I feel like I'm missing something super obvious. The import statement is not searching the default package (or I guess, unpackaged) classes in the jar. From what I know about Java, it's not supposed to search there. But clearly you've gotten it to do something that has worked.
Presumably if you take the one class and compile it with the original jar in the class path, it should be able to link against the standard classes. So that would be how you only compile however many files you modified. I just don't know how to do this.
Ok, this just isn't working for me. I've tried eclipse and netbeans, tried getting "minecraft_server.jar" into the classpath and nothing seems to work. I even tried compiling from the command line:
And on and on for 33+ errors. It's like it's ignoring my -cp flag altogether, both in the IDEs and on the command line. What super obvious thing am I missing?!
I'm also looking for some help with creating some mods. I'm a proficient coder and I like to think that I won't need my hand held.
I'm interested as a first little project to alter the SMP server to allow getting and setting of player coordinates by OPs and the console. So I got a fresh copy and JD-GUI and decompiled. Opened up MinecraftServer.java and found the tp command. Based on what I gathered from that, I guessed getting and setting the coordinates with a command would look something like this:
// Getting coordinates
} else if (str1.toLowerCase().startsWith("getcoords ")) {
localObject1 = str1.split(" ");
if (localObject1.length == 2) {
localObject2 = this.f.h(localObject1[1]);
if (localObject2 == null) {
localef.b("Can't find user " + localObject1[1] + ". No coords.");
} else {
a(str2, "Coords: " + localObject2.l + " , " + localObject2.m + " , " + localObject2.n + " , " + localObject2.r + " , " + localObject2.s);
}
} else {
localef.b("Syntax error, please provide a source.");
}
// Setting coordinates
} else if (str1.toLowerCase().startsWith("setcoords ")) {
localObject1 = str1.split(" ");
if (localObject1.length == 7) {
localObject2 = this.f.h(localObject1[1]);
if (localObject2 == null) {
localef.b("Can't find user " + localObject1[1] + ". No tp.");
} else {
try {
((ea)localObject2).a.a(Double(localObject1[2]),Double(localObject1[3]),Double(localObject1[4]),Double(localObject1[5]),Double(localObject1[6]));
a(str2, "Teleporting " + localObject1[1] + " to location...");
}
catch (NumberFormatException e)
{
localef.b("Syntax error, bad coords.");
}
}
} else {
localef.b("Syntax error, please provide a source and 5 coords.");
}
So now I'm working on recompiling this and getting it back into the JAR. I tried using eclipse and adding the server jar to the project's path but I had no luck getting the compiler to recognize the classes from the jar and link against them.
Trying Netbeans now, because I really never liked eclipse.
0
Other classes compile fine. The way I'm doing things is a little different than blitz but those directions are basically the same. If anyone has managed to edit and recompile MinecraftServer.java and lived to tell the tale, would you care to share?
0
The jar was in working directory but let me give this a shot. Nah, same error.
0
Well, then they don't get imported at all, which causes a billion other "cannot find symbol" errors.
0
I did this a few posts back with no luck. Here I try it again but with your exact command:
This is ridiculous. Not you guys who are helping! I appreciate every bit of that. But this whole... situation.
0
I feel like I'm missing something super obvious. The import statement is not searching the default package (or I guess, unpackaged) classes in the jar. From what I know about Java, it's not supposed to search there. But clearly you've gotten it to do something that has worked.
0
0
0
And on and on for 33+ errors. It's like it's ignoring my -cp flag altogether, both in the IDEs and on the command line. What super obvious thing am I missing?!
0
I'm interested as a first little project to alter the SMP server to allow getting and setting of player coordinates by OPs and the console. So I got a fresh copy and JD-GUI and decompiled. Opened up MinecraftServer.java and found the tp command. Based on what I gathered from that, I guessed getting and setting the coordinates with a command would look something like this:
So now I'm working on recompiling this and getting it back into the JAR. I tried using eclipse and adding the server jar to the project's path but I had no luck getting the compiler to recognize the classes from the jar and link against them.
Trying Netbeans now, because I really never liked eclipse.