I'm trying to create a batch file that automates the regiontool.jar. I'm running into problems just getting the menu up.
First off, the file won't stay open. I'm not sure how to get it to not auto-quit without running it from the command prompt. Secondly, when running it from the command prompt, I get the following:
---------------------------------------------------------
Enter U to unpack a world, P to pack, or E to exit
---------------------------------------------------------
The syntax of the command is incorrect.
goto was unexpected at this time.
And then it returns to the command prompt.
@echo off
cls
:menu
echo ----------------------------------------…
echo Enter U to unpack a world, P to pack, or E to exit
echo ----------------------------------------…
echo.
echo.
set menu=
set w=
set /p menu=="Enter your choice: "
if %menu%==U goto unpack
if %menu%==p goto pack
if %menu%==e goto eof
cls
:unpack
echo -----------------------
echo Choose your world (1-5)
echo -----------------------
echo.
echo.
set /p w=="Enter world number: "
cd C:/Users/Sean/Appdata/Roaming/.minecraft
java -jar RegionTool.jar unpack saves/world%w%
goto menu
:pack
echo -----------------------
echo Choose your world (1-5)
echo -----------------------
echo.
echo.
set /p w=="Enter world number: "
cd C:/Users/Sean/Appdata/Roaming/.minecraft
java -jar RegionTool.jar pack saves/world%w%
goto menu
I'm trying to create a batch file that automates the regiontool.jar. I'm running into problems just getting the menu up.
First off, the file won't stay open. I'm not sure how to get it to not auto-quit without running it from the command prompt. Secondly, when running it from the command prompt, I get the following:
---------------------------------------------------------
Enter U to unpack a world, P to pack, or E to exit
---------------------------------------------------------
The syntax of the command is incorrect.
goto was unexpected at this time.
And then it returns to the command prompt.
@echo off
cls
:menu
echo ----------------------------------------…
echo Enter U to unpack a world, P to pack, or E to exit
echo ----------------------------------------…
echo.
echo.
set menu=
set w=
set /p menu=="Enter your choice: "
if %menu%==U goto unpack
if %menu%==p goto pack
if %menu%==e goto eof
cls
:unpack
echo -----------------------
echo Choose your world (1-5)
echo -----------------------
echo.
echo.
set /p w=="Enter world number: "
cd C:/Users/Sean/Appdata/Roaming/.minecraft
java -jar RegionTool.jar unpack saves/world%w%
goto menu
:pack
echo -----------------------
echo Choose your world (1-5)
echo -----------------------
echo.
echo.
set /p w=="Enter world number: "
cd C:/Users/Sean/Appdata/Roaming/.minecraft
java -jar RegionTool.jar pack saves/world%w%
goto menu
Btw. anyone know why this mod doesn't work for me anymore? It loads world up to 99% of "Building terrain", but then it crashes, and i have this:
--- BEGIN ERROR REPORT a1dce528 --------
Generated 16.01.11 18:36
Minecraft: Minecraft Beta 1.2_01
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_23, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce GTS 250/PCI/SSE2 version 3.3.0, NVIDIA Corporation
java.lang.NoSuchMethodError: dn.a(ZZ)V
at net.minecraft.client.Minecraft.i(SourceFile:1214)
at net.minecraft.client.Minecraft.run(SourceFile:679)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 9b9721e4 ----------
Could somebody post a detailed tutorial on how to install the server version, please? I don't appear to have a .jar file anywhere for mine.
EDIT:
Also, it doesn't seem to be compatible with ejhopkins' Wild Grass Mod. Would there be any way to fix this? Awesome mod, anyway. When I don't have Wild Grass installed it works beautifully.
You have a .exe, though, right? You'll have to go download the .jar version of the Minecraft server and modify + run it.
It would be nice if there was a build for bukkit, it has the server class files included in the jar, but this mod would need to be compiled for the directory structure bukkit uses.
TehKittyCat got McRegion working with Bukkit, here are the steps:
Quote from 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.
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-Minecr ... /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- ... APSHOT.jar -O craftbukkit-o.jar
#Build #48:Newer builds are borked(unrelated to mcregion)wget -q http://artifacts.lukegb.com/artifactory ... APSHOT.jar -O craftbukkit-o.jar
wget -q --no-check-certificate https://github.com/Bukkit/Bukkit-Minecr ... /1.2.rules
wget -q http://minecraft.net/download/minecraft ... 5064970752 -O minecraft_server.jar
wget -q http://mod.ifies.com/f/110114/mcregion_ ... 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 from TehKittyCat »
I've made it into a full script, just note jarjar and jad are scripted into my path.
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
I have not tried this, but hopefully it'll help others.
Where does the RegionTool save its' files? I just packed a world and I can't seem to find the region files anywhere...
Uh. What. Right after posting it the region folder just..appeared in my world's folder.
[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)
The compiled chunk loader and region class files in this do work on the most recent build 77 of bukkit, without them needing to be recompiled, and it should work if they don't edit there chunk loader class from what it is now, or isn't modified in an official MC update.
To the guy above me, it's not a problem with region and bukkit that is causing the error but one with the region tool. Make sure you have the most current region tool from this thread. You can also try packing it on a different computer, if possible, to see if you get the same error.
So I installed the mod like the guide said, and played a few days building my castle. But it didnt fix my lagg ( freezes for about 2 sec randomly ), so I tried to uninstall it. But now the world is back in its old state, same as before I installed the mod. Ive tried converting my world with "unpack" command, but didnt help. Ive also tried installing the patch again but the changes is gone... WHAT TO DO!
Can anyone help me! My unpack isn't working right it'll unpack the files but alas I tried to use mcedit to verify the revert back yet it doesn't seem to have taken effect. It shows everything I've done before the mcregion tool. I feel like pulling my hair out. Its a great mod though. My friends who could barely stay connected me while hosting have a solid connection now.
Please help save the whales! :tongue.gif:
Problem solved. My fix was to move my region folder out. Pack the data. Move all old unpack data out of the folder. Move region folder back in and overwrite the newly packed data and unpack.
I'm trying to unpack a world into a different directory, and keep getting an error.
The problem goes away if I copy the region folder into "/map_dir" and unpack from there.
So after i have unpacked with the regiontool, I went to mcedit and did stuff and saved. Do i still need the region folder in the world or is it ok to delete now that i saved with mcedit?
I usually delete the source files, in which I mean, if I unpack the world I delete the region directory when I'm done, and when I pack it, I delete all of the directories in the world directory(With the exception of the players directory if your running a server.) but the region directory after I'm done packing it. I hit the fewest amounts of problems this way, however I have to do a full unpack and pack every time this way which can be time consuming on slower computers.
exactly what i wanted to know
First off, the file won't stay open. I'm not sure how to get it to not auto-quit without running it from the command prompt. Secondly, when running it from the command prompt, I get the following:
And then it returns to the command prompt.
Anyone have any ideas?
I already made one a while ago:
http://dl.dropbox.com/u/16045448/McRegion.bat
Btw. anyone know why this mod doesn't work for me anymore? It loads world up to 99% of "Building terrain", but then it crashes, and i have this:
My minecraft is CLEAR, i just redownloaded it.
You have a .exe, though, right? You'll have to go download the .jar version of the Minecraft server and modify + run it.
I'd like to know this too.
Managed Xen VPS starting at only $5/month | cPanel Shared/Reseller Hosting starting at only $3/month
www.EtheliteHosting.com
It would be nice if there was a build for bukkit, it has the server class files included in the jar, but this mod would need to be compiled for the directory structure bukkit uses.
I have not tried this, but hopefully it'll help others.
Uh. What. Right after posting it the region folder just..appeared in my world's folder.
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
The compiled chunk loader and region class files in this do work on the most recent build 77 of bukkit, without them needing to be recompiled, and it should work if they don't edit there chunk loader class from what it is now, or isn't modified in an official MC update.
You should be able to get it working by adding these class files to the /net/minecraft/server/ path inside there snapshot builds.
http://sc.cartman-2000.net/files/MC_stu ... t_b48+.zip
To the guy above me, it's not a problem with region and bukkit that is causing the error but one with the region tool. Make sure you have the most current region tool from this thread. You can also try packing it on a different computer, if possible, to see if you get the same error.
Please help save the whales! :tongue.gif:
Problem solved. My fix was to move my region folder out. Pack the data. Move all old unpack data out of the folder. Move region folder back in and overwrite the newly packed data and unpack.
The problem goes away if I copy the region folder into "/map_dir" and unpack from there.
Went back in and deleted it and all my changes are back.
No more chunk update lag for my bukkit server!
Report obvious spam threads, don't bump them- thats exactly what a spam bot is for.