Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 318 319 [320] 321 322 ... 326

Author Topic: Minecraft - Mods Thread  (Read 982625 times)

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4785 on: April 11, 2014, 05:53:22 am »

Does that extend only up to 512 by 512 blocks, or do I have to run the file separately for multiple regions?

Edit: wow, the generated file will be almost 128 megabytes per region :P Now only if there was a way to skip the file stage... maybe this is where I need jython.
« Last Edit: April 11, 2014, 05:55:53 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4786 on: April 11, 2014, 06:49:54 am »

Does that extend only up to 512 by 512 blocks, or do I have to run the file separately for multiple regions?
The program will also generate any regions you touch, and write them to the correct files.

Quote
Edit: wow, the generated file will be almost 128 megabytes per region :P Now only if there was a way to skip the file stage... maybe this is where I need jython.
Shouldn't you be able to run shell commands from within Python? You can make the last line of your program an external call to convert.sh.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4787 on: April 11, 2014, 07:05:50 am »

I would need to write everything in memory to the disk (which will probably take quite a while)... then reload it in Java. >_>
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4788 on: April 11, 2014, 07:19:23 am »

I would need to write everything in memory to the disk (which will probably take quite a while)... then reload it in Java. >_>
I could rewrite the program so it gets the JSON data from standard input. Then you can feed it directly from your Python program instead of having to write to disk first.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4789 on: April 11, 2014, 07:30:22 am »

Would that be

python myScript.py | java yourProgram  ?

Also, that sounds much better than the temporary file method, though I wonder how you can tell that the input stream is finished...

edit: sorry for clogging up the thread with programming stuffs :I

edit2: I know you've already done a lot for me (even the current version of MCJSON is awesome), but I was wondering if you could whip up a similar library for the level.dat, which iirc is where player spawn is defined...? Wouldn't want to spawn the player over open air with no materials to climb to a planet :P I mean, level.dat is probably simpler in format (if I'm lucky, it won't even be a NBT file), but .. yeah :D

edit3: Any idea what "decorate" : false does? Doesn't seem to be in the wiki's documentation.
« Last Edit: April 11, 2014, 09:24:14 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

forsaken1111

  • Bay Watcher
    • View Profile
    • TTB Twitch
Re: Minecraft - Mods Thread
« Reply #4790 on: April 11, 2014, 07:31:43 am »

Its not like anyone else was talking about anything really, and some of us (me at least) find it interesting
Logged

Sergius

  • Bay Watcher
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4791 on: April 11, 2014, 09:44:44 am »

We need a new thread! Mod thread is getting cluttered with posts about a slightly different mod talk than usual.

We shall call it... "Minecraft - Talking About Mods But In A Different Way Than The Other Thread That's also about Mods".
Logged

Elephant Parade

  • Bay Watcher
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4792 on: April 11, 2014, 09:52:46 am »

Its not like anyone else was talking about anything really, and some of us (me at least) find it interesting
I don't really know what you're talking about, but it's kinda neat to read. This thread is half-dead anyway.
Logged

Neyvn

  • Bay Watcher
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4793 on: April 11, 2014, 10:01:15 am »

Anyone got any command or mods which can help me define an area around certain parts of the multiplayer map I want to make? I don't want my players genning chunks which can make the server lag so I was thinking putting a Bedrock wall around the area would help, maybe even a command block every so blocks which search for players in the loaded chunk and teleport them back to spawn if they go out into the wilds...
Logged
Quote from: Ubiq
Broker: Wasn't there an ambush squad here just a second ago?
Merchant: I don't know what you're talking about. Do you want this goblin ankle bone amulet or not?
My LIVESTREAM. I'm Aussie, so not everything is clean. Least it works...

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4794 on: April 11, 2014, 10:06:59 am »

I remember that there was some sort of mod that prevented people from going X distance from spawn, but I sadly don't remember its name..




I made a sphere! It looks weird because I forgot that my FOV was on Quake Pro.
« Last Edit: April 11, 2014, 10:10:43 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4795 on: April 11, 2014, 10:29:21 am »

New version out!

Would that be

python myScript.py | java yourProgram  ?
You can use either of these:
Code: [Select]
python yourScript.py | java mcfry.JsonWorldGenerator
python yourScript.py | convertFromSTDIN.bat
They should be identical in functionality, since convertFromSTDIN.sh contains "java mcfry.JsonWorldGenerator".

Quote
Also, that sounds much better than the temporary file method, though I wonder how you can tell that the input stream is finished...
I can tell that it's finished when a) it closes or b) the main JSON map's closing brace appears.

Quote
edit2: I know you've already done a lot for me (even the current version of MCJSON is awesome), but I was wondering if you could whip up a similar library for the level.dat, which iirc is where player spawn is defined...? Wouldn't want to spawn the player over open air with no materials to climb to a planet :P I mean, level.dat is probably simpler in format (if I'm lucky, it won't even be a NBT file), but .. yeah :D
Actually, level.dat is an NBT file, but that makes it easier for me. I changed the world.txt file format, it can now define multiple dimensions, as well as a level.dat file! Note that all the level.dat parameters are optional, they default to values identical to vanilla survival's values.

Quote
edit3: Any idea what "decorate" : false does? Doesn't seem to be in the wiki's documentation.
The world generator works in two steps. First, the terrain is generated, using only dirt and stone and sand and water and bedrock. Second, all the things like trees and flowers and ores and lakes and villages and caves and mineshafts are generated inside that terrain. To ensure smooth chunk-to-chunk transitions, a chunk is only decorated when all its neighboring chunks are already generated and loaded (so trees and stuff can spill over onto neighboring chunks without being cut off), which means that the chunk needs to have a flag saying whether it's already decorated or not. This flag is saved in the region files, so if I set that flag to "not decorated yet" when writing a custom chunk to NBT, Minecraft will go and decorate that chunk itself when it loads the chunk. But if I set the flag to "decorated already", then Minecraft won't do anything with the new chunk, leaving all your blocks intact.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4796 on: April 11, 2014, 10:40:02 am »

Does the "decorator" decide what to place depending on biome and block type? eg it places tall grass on grass blocks, snow on snow biome blocks..?
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4797 on: April 11, 2014, 10:46:26 am »

Exactly.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4798 on: April 12, 2014, 12:08:59 am »

MagmaMcFry: The new version doesn't seem to quite work... I tried finding the replaced chunk, but when I get to (0,0), all there is is endless ocean and land that abruptly ends, with no sign of the deep pit that should be the test chunk.

Spoiler (click to show/hide)

Edit: Hmm, taht can't be right. I reverted to the old version and there still is no missing chunk >_> must be the new level.dat file...

Edit2: Ah, I am stupid. The new level.dat means that the test world is named Demo, which duped me into thinking that that was the minecraft demo level...

Edit3:
Spoiler (click to show/hide)
A sphere with diameter of 100 will probably be the largest planetoid spawned. I think they'll be reserved for glowstone suns...


Edit4: An actual bug!

These are the related files.


mkdir forms
python spheregen.py 9 31
(generates the sphere forms, takes roughly 60 MB of HD space)

python gen.py -n | java mcfry.JsonWorldGenerator
The error that appears is

Quote
java.lang.ArrayIndexOutOfBoundsException: 16
        at mcfry.MCChunk.getSection(MCChunk.java:50)
        at mcfry.MCChunk.setBlock(MCChunk.java:56)
        at mcfry.MCRegion.setBlock(MCRegion.java:97)
        at mcfry.MCDimension.setBlock(MCDimension.java:64)
        at mcfry.MCJsonDimension.create(MCJsonDimension.java:27)
        at mcfry.MCJsonWorld.create(MCJsonWorld.java:17)
        at mcfry.JsonWorldGenerator.main(JsonWorldGenerator.java:23)

Also, when I set mapwidth on line 64 in gen.py to 500, the error changes to

Quote
Traceback (most recent call last):
  File "gen.py", line 125, in <module>
    print json.dumps(output)
  File "C:\python27\lib\json\__init__.py", line 243, in dumps
    return _default_encoder.encode(obj)
  File "C:\python27\lib\json\encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\python27\lib\json\encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
MemoryError
org.json.JSONException: Missing value at 0 [character 1 line 1]
        at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
        at org.json.JSONTokener.nextValue(JSONTokener.java:387)
        at mcfry.JsonWorldGenerator.main(JsonWorldGenerator.java:22)
« Last Edit: April 12, 2014, 02:58:17 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4799 on: April 12, 2014, 05:07:09 am »

Edit4: An actual bug!

These are the related files.


mkdir forms
python spheregen.py 9 31
(generates the sphere forms, takes roughly 60 MB of HD space)

python gen.py -n | java mcfry.JsonWorldGenerator
The error that appears is

Quote
java.lang.ArrayIndexOutOfBoundsException: 16
        at mcfry.MCChunk.getSection(MCChunk.java:50)
        at mcfry.MCChunk.setBlock(MCChunk.java:56)
        at mcfry.MCRegion.setBlock(MCRegion.java:97)
        at mcfry.MCDimension.setBlock(MCDimension.java:64)
        at mcfry.MCJsonDimension.create(MCJsonDimension.java:27)
        at mcfry.MCJsonWorld.create(MCJsonWorld.java:17)
        at mcfry.JsonWorldGenerator.main(JsonWorldGenerator.java:23)
That happened because you tried to set blocks above Y level 255.

Quote
Also, when I set mapwidth on line 64 in gen.py to 500, the error changes to

Quote
Traceback (most recent call last):
  File "gen.py", line 125, in <module>
    print json.dumps(output)
  File "C:\python27\lib\json\__init__.py", line 243, in dumps
    return _default_encoder.encode(obj)
  File "C:\python27\lib\json\encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\python27\lib\json\encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
MemoryError
org.json.JSONException: Missing value at 0 [character 1 line 1]
        at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
        at org.json.JSONTokener.nextValue(JSONTokener.java:387)
        at mcfry.JsonWorldGenerator.main(JsonWorldGenerator.java:22)
That happened because your Python ran out of memory (or had some other kind of error causing it to quit), which means that Java didn't get any JSON, causing it to complain. Maybe I should change the JSON format to let you define blocks starting from multiple offsets or make the definitions run length encoded.
« Last Edit: April 12, 2014, 05:16:38 am by MagmaMcFry »
Logged
Pages: 1 ... 318 319 [320] 321 322 ... 326