[quote=Scaevolus]TehKittyCat got McRegion working with Bukkit, here are the steps:
[quote=TehKittyCat]I have managed to get McRegion running on bukkit. Feel free to add it and/or use it for future versions, I didn't post as I was unsure if you would agree. I have no guarantee of the stability and if Bukkit ever patches go.class you'd have to patch it, but currently they don't, so in theory it should work the same as on vanilla.
Here is a working CraftBukkit build w/ it(Build #48): http://www.mediafire.com/?1jdk8z6bcuadsqx
The steps(see below for the actual commands):
1) Applied McRegion to a vanilla minecraft_server.jar
2) Used their rules file for renaming with jarjar for its custom minecraft_server.jar on it. The rules for 1.2_01 are at https://github.com/Bukkit/Bukkit-MinecraftServer/raw/master/rules/1.2.rules.
3) Unzipped minecraft_server-renamed.jar.
4) Then decompiled the resulting ChunkLoader.class(your go.class w/ their renaming).
5) I then added 'package net.minecraft.server;' to the top of RegionFile.java and RegionFileCache.java from RegionTool's src and to ChunkLoader.class, otherwise it won't find the needed classes.
6) Then I compiled them with CraftBukkit's jar in the classpath.
7) I had to move them to the right package. With this done you could just distribute the files as now.
8) Finally, I added them into CraftBukkit's jar. Note the fix, replacing ChunkLoader.class invalidates the CRC for it.
Here are the commands used(note jarjar.jar and jad.exe were already in path, you can find a linux jad, I just used their existing exe):
wget -q http://bamboo.lukegb.com/browse/BUKKIT-CRAFTBUKKIT-JOB1-48/artifact/CraftBukkit-JAR/craftbukkit-0.0.1-SNAPSHOT.jar -O craftbukkit-o.jar
#Build #48:Newer builds are borked(unrelated to mcregion)wget -q http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar -O craftbukkit-o.jar
wget -q --no-check-certificate https://github.com/Bukkit/Bukkit-MinecraftServer/raw/master/rules/1.2.rules
wget -q http://minecraft.net/download/minecraft_server.jar?v=1295064970752 -O minecraft_server.jar
wget -q http://mod.ifies.com/f/110114/mcregion_v5_server_1.2_01.zip -O mcregion.zip
wget -q http://mod.ifies.com/f/110106/RegionTool_source.zip -O mcregion-src.zip
unzip mcregion.zip
unzip mcregion-src.zip
zip minecraft_server.jar go.class
java -jar jarjar.jar process 1.2.rules minecraft_server.jar minecraft_server-renamed.jar
unzip -d mc minecraft_server-renamed.jar
wine jad.exe -safe -ff -nonlb -dead -o -s .java -d . mc/ChunkLoader.class
echo "package net.minecraft.server;"|cat - ChunkLoader.java > /tmp/out && mv /tmp/out ChunkLoader.java
echo "package net.minecraft.server;"|cat - RegionFile.java > /tmp/out && mv /tmp/out RegionFile.java
echo "package net.minecraft.server;"|cat - RegionFileCache.java > /tmp/out && mv /tmp/out RegionFileCache.java
javac -cp craftbukkit-o.jar {ChunkLoader,RegionFile,RegionFileCache}.java
mkdir -p net/minecraft/server;cp -v {ChunkLoader.class,RegionFileCache.class,'RegionFile$ChunkBuffer.class',RegionFile.class} net/minecraft/server
zip -rv craftbukkit-o.jar net
zip -F craftbukkit-o.jar --out craftbukkit.jar[/quote]
[quote=TehKittyCat]I've made it into a full script, just note jarjar and jad are scripted into my path.
#!/bin/bash
BUKKIT='http://artifacts.lukegb.com/artifactory/plugins-snapshot/org/bukkit/craftbukkit/0.0.1-SNAPSHOT/craftbukkit-0.0.1-SNAPSHOT.jar'
MCREGION='http://mod.ifies.com/f/110114/mcregion_v5_server_1.2_01.zip'
REGIONSRC='http://mod.ifies.com/f/110106/RegionTool_source.zip'
RULES='https://github.com/Bukkit/Bukkit-MinecraftServer/raw/master/rules/1.2.rules'
echo "McRegion for Bukkit generator..."
if [ ! -d mcregion ]; then
mkdir mcregion
fi
cd mcregion
if [ ! $1 ]; then
echo "Downloading CraftBukkit"
wget -q $BUKKIT -O craftbukkit-o.jar
else
echo "Copying CraftBukkit"
cp $1 craftbukkit-o.jar
fi
echo "Downloading CraftBukkit's rules for renaming"
wget -q --no-check-certificate $RULES -O rules
echo "Downloading vanilla Minecraft Server"
wget -q http://minecraft.net/download/minecraft_server.jar
echo "Downloading McRegion for Server"
wget -q $MCREGION -O mcregion.zip
echo "Downloading RegionTool's source"
wget -q $REGIONSRC -O mcregion-src.zip
echo "Unzipping McRegion"
unzip -q mcregion.zip go.class
echo "Unzipping RegionTool's source"
unzip -q mcregion-src.zip {RegionFile,RegionFileCache}.java
echo "Applying McRegion to vanilla Minecraft server"
zip -q minecraft_server.jar go.class
echo "Applying CraftBukkit's renaming rules to Minecraft server"
jarjar process rules minecraft_server.jar minecraft_server-renamed.jar
echo "Extracting renamed McRegion core(go.class -> ChunkLoader.class)"
unzip -q minecraft_server-renamed.jar ChunkLoader.class
echo "Decompiling the resulting McRegion core."
jad -safe -ff -nonlb -dead -o -s .java ChunkLoader.class
echo "Using package net.minecraft.server for McRegion, allowing direct linking to CraftBukkit."
echo "package net.minecraft.server;"|cat - ChunkLoader.java > /tmp/out && mv /tmp/out ChunkLoader.java
echo "package net.minecraft.server;"|cat - RegionFile.java > /tmp/out && mv /tmp/out RegionFile.java
echo "package net.minecraft.server;"|cat - RegionFileCache.java > /tmp/out && mv /tmp/out RegionFileCache.java
echo "Compiling McRegion, with CraftBukkit as classpath for linking."
javac -cp craftbukkit-o.jar {ChunkLoader,RegionFile,RegionFileCache}.java
echo "Packaging the new McRegion"
mkdir -p net/minecraft/server
mv {ChunkLoader.class,RegionFileCache.class,'RegionFile$ChunkBuffer.class',RegionFile.class} net/minecraft/server
echo "Zipping the new McRegion as 'mcregion_srv.zip', ready for distributing as McRegion for Bukkit."
zip -9qr mcregion_srv.zip net
echo "Applying McRegion to CraftBukkit, resulting in 'craftbukkit.jar', this step can be used at anytime as long as the new McRegion is available."
zip -qr craftbukkit-o.jar net
zip -qF craftbukkit-o.jar --out craftbukkit.jar
echo "Cleaning..., but keeping 'net/' so it can be used to update CraftBukkit independently."
rm -r {ChunkLoader,RegionFile,RegionFileCache}.java craftbukkit-o.jar go.class rules mcregion{,-src}.zip minecraft_server{,-renamed}.jar[/quote]
I have not tried this, but hopefully it'll help others.[/quote]
The only thing stopping me from actually getting this to work is not being able to find jarjar, because libjarjar-java doesn't seem to be it.
Edit: Nevermind, got it working!
McRegion for Bukkit generator...
Downloading CraftBukkit
Downloading CraftBukkit's rules for renaming
Downloading vanilla Minecraft Server
Downloading McRegion for Server
Downloading RegionTool's source
Unzipping McRegion
Unzipping RegionTool's source
Applying McRegion to vanilla Minecraft server
Applying CraftBukkit's renaming rules to Minecraft server
Extracting renamed McRegion core(go.class -> ChunkLoader.class)
Decompiling the resulting McRegion core.
Parsing ChunkLoader.class...The class file version is 49.0 (only 45.3, 46.0 and 47.0 are supported)
Generating ChunkLoader.java
Using package net.minecraft.server for McRegion, allowing direct linking to CraftBukkit.
Compiling McRegion, with CraftBukkit as classpath for linking.
Packaging the new McRegion
Zipping the new McRegion as 'mcregion_srv.zip', ready for distributing as McRegion for Bukkit.
Applying McRegion to CraftBukkit, resulting in 'craftbukkit.jar', this step can be used at anytime as long as the new McRegion is available.
Cleaning..., but keeping 'net/' so it can be used to update CraftBukkit independently.
though this worries me...
Parsing ChunkLoader.class...The class file version is 49.0 (only 45.3, 46.0 and 47.0 are supported)
---
Err, tried to pack my world...
packed 2672 chunks, skipped 48 older onesjava.io.FileNotFoundException: /tmp/ramdisk/world/z/12/c.-gt.- pm.dat (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at RegionTool.packChunk(RegionTool.java:159)
at RegionTool.pack(RegionTool.java:119)
at RegionTool.main(RegionTool.java:61)
packed 2672 chunks, skipped 49 older onesjava.io.FileNotFoundException: /tmp/ramdisk/world/z/12/c.-bh.- ka.dat (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at RegionTool.packChunk(RegionTool.java:159)
at RegionTool.pack(RegionTool.java:119)
at RegionTool.main(RegionTool.java:61)
packed 2672 chunks, skipped 50 older onesjava.io.FileNotFoundException: /tmp/ramdisk/world/z/12/c.-9p.- ii.dat (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at RegionTool.packChunk(RegionTool.java:159)
at RegionTool.pack(RegionTool.java:119)
at RegionTool.main(RegionTool.java:61)
packed 2672 chunks, skipped 51 older onesjava.io.FileNotFoundException: /tmp/ramdisk/world/z/12/c.-7x.- gq.dat (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at RegionTool.packChunk(RegionTool.java:159)
at RegionTool.pack(RegionTool.java:119)
at RegionTool.main(RegionTool.java:61)
packed 2672 chunks, skipped 52 older onesjava.io.FileNotFoundException: /tmp/ramdisk/world/z/12/c.-65.- ey.dat (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at RegionTool.packChunk(RegionTool.java:159)
at RegionTool.pack(RegionTool.java:119)
at RegionTool.main(RegionTool.java:61)
packed 2672 chunks, skipped 53 older onesjava.io.FileNotFoundException: /tmp/ramdisk/world/z/12/c.-4d.- 9m.dat (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at RegionTool.packChunk(RegionTool.java:159)
at RegionTool.pack(RegionTool.java:119)
at RegionTool.main(RegionTool.java:61)
packed 2672 chunks, skipped 54 older onesException in thread "main" java.lang.NullPointerException
at RegionTool.pack(RegionTool.java:115)
at RegionTool.main(RegionTool.java:61)
What's with this? Is heyo sick or something? Usually he's on the ball with mod updates when a server update comes out. This is the only thing I'm waiting for to update to .2.8. Saw a bunch of posts about lag and broken boats or something from b131
So has anyone made a block logger yet? I'm getting sick of some random pub joining and wrecking stuff. I don't want to punish the REST of the pubs (we've only had a few greifers) by setting it where they can't build (which would prevent destroying I think).
I really need a logging plugin to log block placement and destruction. I don't care how much spam it will create in the log. That's what logs are for.
0
The only thing stopping me from actually getting this to work is not being able to find jarjar, because libjarjar-java doesn't seem to be it.
Edit: Nevermind, got it working!
though this worries me...
---
Err, tried to pack my world...
That can't be good... O_o
0
0
Set your -Z to something. (10 or 11)
--
Anyone happen to know how to make this show last player location? Or a way to have dynamic player locations even if the map itself isn't dynamic?
0
0
0
0
0
0
2010-10-31 19:31:58 [INFO] Starting minecraft server version 0.2.2_01
2010-10-31 19:31:58 [INFO] Loading properties
2010-10-31 19:31:58 [INFO] Starting Minecraft server on *:25565
2010-10-31 19:31:58 [INFO] Hey0 Server Mod Build 124
2010-10-31 19:31:58 [INFO] Preparing level "world"
2010-10-31 19:31:58 [INFO] Preparing start region
Preparing spawn area: 0%
2010-10-31 19:31:58 [INFO] Stopping server
2010-10-31 19:31:58 [INFO] Saving chunks
Edit: Had to replace the server bin again for some reason O_o
0
Of course, All I did was replace the old mod jar with the new one, changed none of my configs, etc.
0
Just extract the mod jar with winrar/7zip, open the server jar with wr/7z, and just add them to it.
0
0
0
I really need a logging plugin to log block placement and destruction. I don't care how much spam it will create in the log. That's what logs are for.
0
Maybe I should look before asking questions lol.