Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.8] How can I get my custom MapGen structure to generate?
The update for 1.13 is being worked on - please be patient. (Updated 02/19/19)
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
TheEnderKiller

[1.8] How can I get my custom MapGen structure to generate?

Started by TheEnderKiller, July 20, 2015

8 posts in this topic

TheEnderKiller    0

TheEnderKiller

TheEnderKiller    0

  • Tree Puncher
  • TheEnderKiller
  • Members
  • 0
  • 22 posts
  • Report post
Posted July 20, 2015

I have created a custom village, and have just copied minecraft's code for now to get things to work. But I'm unsure on how to get the structure to actually generate. I have done the

MapGenStructureIO.registerStructure...

and the

StructureVillagePieces.registerVillagePieces();

in my main mod class. But what more do I have to do? The vanilla structures are generated in ChunkProviderGenerate.class from what I understand, how do I get my structure to spawn? Would InitMapGenEvent help with this? If so, how do I use it properly?

 

EDIT: I created a custom world type, so things work now. I have a new question though, about these two fields in MapGenVillage:

this.field_82665_g = 32;
this.field_82666_h = 8;

Anyone knows what these do? I think the first one has something to do with distance to other villages, but I'm not sure about the other one.

Share this post


Link to post
Share on other sites

TheEnderKiller    0

TheEnderKiller

TheEnderKiller    0

  • Tree Puncher
  • TheEnderKiller
  • Members
  • 0
  • 22 posts
  • Report post
Posted July 21, 2015

Anyone?

Share this post


Link to post
Share on other sites

TheEnderKiller    0

TheEnderKiller

TheEnderKiller    0

  • Tree Puncher
  • TheEnderKiller
  • Members
  • 0
  • 22 posts
  • Report post
Posted July 22, 2015

Does no one know anything about this?

Share this post


Link to post
Share on other sites

Choonster    1594

Choonster

Choonster    1594

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1594
  • 4981 posts
  • Report post
Posted July 23, 2015

Do you want to add buildings to existing villages or create your own villages from scratch?

 

If it's the former, I explain how to do that briefly here.

 

If it's the latter, you may be able to use FML's IWorldGenerator as a wrapper for your MapGenStructure class (since MapGenStructure sets blocks in the World directly rather than using the Block array like other MapGen classes).

Share this post


Link to post
Share on other sites

TheEnderKiller    0

TheEnderKiller

TheEnderKiller    0

  • Tree Puncher
  • TheEnderKiller
  • Members
  • 0
  • 22 posts
  • Report post
Posted July 24, 2015

Do you want to add buildings to existing villages or create your own villages from scratch?

 

If it's the former, I explain how to do that briefly here.

 

If it's the latter, you may be able to use FML's IWorldGenerator as a wrapper for your MapGenStructure class (since MapGenStructure sets blocks in the World directly rather than using the Block array like other MapGen classes).

 

I'm creating my own custom village separate from the vanilla one.

 

Would this be the only way or is there any other way you can think of which doesn't have anything to do with IWorldGenerator (like the vanilla structures as far as I know)?

Share this post


Link to post
Share on other sites

Choonster    1594

Choonster

Choonster    1594

  • Reality Controller
  • Choonster
  • Forge Modder
  • 1594
  • 4981 posts
  • Report post
Posted July 24, 2015

ChunkProviderGenerate has a fixed number of fields containing the vanilla structures to generate, but you can replace them with your own using InitMapGenEvent. You may be able to extend MapGenVillage to generate both vanilla villages and your own villages, but it would probably be a fairly hackish solution.

Share this post


Link to post
Share on other sites

TheEnderKiller    0

TheEnderKiller

TheEnderKiller    0

  • Tree Puncher
  • TheEnderKiller
  • Members
  • 0
  • 22 posts
  • Report post
Posted July 24, 2015

ChunkProviderGenerate has a fixed number of fields containing the vanilla structures to generate, but you can replace them with your own using InitMapGenEvent. You may be able to extend MapGenVillage to generate both vanilla villages and your own villages, but it would probably be a fairly hackish solution.

Thanks for your help, I ended up creating a new WorldType with a custom ChunkProviderGenerate instead.

 

I have one more thing to ask, maybe you (or someone else who reads this) know the answer. In MapGenVillage, there are two fields:

this.field_82665_g = 32;
this.field_82666_h = 8;

I think the first one has something to to with distance to other villages, correct me if I'm wrong. But I have no idea what the second one does, can anyone help me here?

Share this post


Link to post
Share on other sites

coolAlias    745

coolAlias

coolAlias    745

  • Reality Controller
  • coolAlias
  • Members
  • 745
  • 2805 posts
  • Report post
Posted July 24, 2015

If you use your IDE to open the Call Hierarchy on those fields, you can find out where they are used. ;)

 

field_82665_g and field_82666_h are both used to determine if a village can generate in a chunk (x, z) - see MapGenVillage#canSpawnStructureAtCoords for the nitty-gritty.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 1
Go To Topic Listing Modder Support

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • diesieben07
      Server is not working, HELP!!!!

      By diesieben07 · Posted 3 minutes ago

      From the instructions page for MovePlus:  
    • WaningMatrix
      [1.12] Some GUI buttons not showing up.

      By WaningMatrix · Posted 3 minutes ago

      Yeah it happens only for GUI. I open GuiSettings1 by using a command which does this else if (args[0].equalsIgnoreCase("gui")) { Runnable rn = () -> Minecraft.getMinecraft().displayGuiScreen(new GuiSettings1()); service.schedule(rn, 50, TimeUnit.MILLISECONDS); } had to open it after 1 tick otherwise it won't open and yes it happens only with Guis. When I move the cursor out of the window and move it back it it starts to appear. However I don't really think mouse rendering thing is related to it whatsoever but I might be wrong. @diesieben07
    • diesieben07
      Getting error trying to use Oceano Shaders

      By diesieben07 · Posted 7 minutes ago

      Only download mods from their original sources. Several of the links you posted are from copyright infringing sites, which provide mislabelled, outdated mods or even malware. Check out StopModReposts for more information. I highly recommend you delete whatever you downloaded from those sites and obtain it properly. The mod you linked explicitly states that it is incompatible with both Optifine and Forge, like I already mentioned above.
    • Kost
      Server is not working, HELP!!!!

      By Kost · Posted 9 minutes ago

      I changed all mods to latest; but i'm still getting crash report.
      I can't get it, what is problem
      Here's report ---- Minecraft Crash Report ---- WARNING: coremods are present:
        CTMCorePlugin (CTM-MC1.12.2-0.3.3.22(1).jar)
      Contact their authors BEFORE contacting forge // Hey, that tickles! Hehehe! Time: 22.02.19 16:18
      Description: Exception in server tick loop java.lang.NoClassDefFoundError: modconfig/IConfigCategory
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Unknown Source)
          at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:526)
          at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
          at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
          at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
          at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
          at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
          at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
          at com.google.common.eventbus.EventBus.post(EventBus.java:217)
          at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)
          at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
          at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
          at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
          at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
          at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
          at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
          at com.google.common.eventbus.EventBus.post(EventBus.java:217)
          at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)
          at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:593)
          at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:98)
          at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333)
          at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:125)
          at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:486)
          at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.ClassNotFoundException: modconfig.IConfigCategory
          at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          at java.lang.ClassLoader.loadClass(Unknown Source)
          ... 33 more
      Caused by: java.lang.NullPointerException
      A detailed walkthrough of the error, its code path and all known details is as follows:
      --------------------------------------------------------------------------------------- -- System Details --
      Details:
          Minecraft Version: 1.12.2
          Operating System: Windows 10 (amd64) version 10.0
          Java Version: 1.8.0_202, Oracle Corporation
          Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
          Memory: 886637696 bytes (845 MB) / 1334312960 bytes (1272 MB) up to 1908932608 bytes (1820 MB)
          JVM Flags: 2 total; -Xms1024M -Xmx2048M
          IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
          FML: MCP 9.42 Powered by Forge 14.23.5.2814 40 mods loaded, 40 mods active
          States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID                             | Version                 | Source                                        | Signature                                |
          |:----- |:------------------------------ |:----------------------- |:--------------------------------------------- |:---------------------------------------- |
          | LC    | minecraft                      | 1.12.2                  | minecraft.jar                                 | None                                     |
          | LC    | mcp                            | 9.42                    | minecraft.jar                                 | None                                     |
          | LC    | FML                            | 8.0.99.99               | forge.jar                                     | e3c3d50c7c986df74c645c0ac54639741c90a557 |
          | LC    | forge                          | 14.23.5.2814            | forge.jar                                     | e3c3d50c7c986df74c645c0ac54639741c90a557 |
          | LC    | simplecore                     | 1.7.3.4                 | simplecore-1.12.2-1.7.3.4.jar                 | None                                     |
          | LC    | aesthetics                     | 1.6.0.23                | aesthetics-1.12.2-1.6.0.23.jar                | None                                     |
          | LC    | baubles                        | 1.5.2                   | Baubles-1.12-1.5.2.jar                        | None                                     |
          | LC    | bibliocraft                    | 2.4.5                   | BiblioCraft[v2.4.5][MC1.12.2].jar             | None                                     |
          | LC    | buildcraftlib                  | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | buildcraftcore                 | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | buildcraftbuilders             | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | buildcrafttransport            | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | buildcraftsilicon              | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | buildcraftenergy               | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | ic2                            | 2.8.109-ex112           | industrialcraft-2-2.8.109-ex112.jar           | de041f9f6187debbc77034a344134053277aa3b0 |
          | LC    | jei                            | 4.14.4.264              | jei_1.12.2-4.14.4.264.jar                     | None                                     |
          | LC    | forestry                       | 5.8.2.374               | forestry_1.12.2-5.8.2.374.jar                 | None                                     |
          | LC    | buildcraftcompat               | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | buildcraftfactory              | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | buildcraftrobotics             | 7.99.22                 | buildcraft-all-7.99.22.jar                    | None                                     |
          | LC    | chisel                         | MC1.12.2-0.2.1.35       | Chisel-MC1.12.2-0.2.1.35.jar                  | None                                     |
          | LC    | chiselsandbits                 | 14.30                   | chiselsandbits-14.30.jar                      | None                                     |
          | LC    | codechickenlib                 | 3.2.2.353               | CodeChickenLib-1.12.2-3.2.2.353-universal.jar | f1850c39b2516232a2108a7bd84d1cb5df93b261 |
          | LC    | corail_pillar_extension_chisel | 4.0.0                   | corail_pillar_extension_chisel-4.0.0-1.12.jar | None                                     |
          | LC    | dtm                            | B1.05.5                 | DeiTerra_B1.05.5_MV_1.12.2.jar                | None                                     |
          | LC    | elementalpets                  | 1.0.2                   | ep-1.0.2.jar                                  | None                                     |
          | LC    | umm3185118519                  | release 1.2 - MC 1.12.2 | Extended+ItemsOres+[1.12.2]+(release+1.2).jar | None                                     |
          | LC    | faunaandecology                | 0.1.2.7                 | FE-1.12.2-0.1.2.7.jar                         | None                                     |
          | LC    | frt                            | 7.3.4                   | FiresRandomThings-1.12.2-7.3.4.jar            | None                                     |
          | LC    | cursedlib                      | 1.0.0                   | FlameLib-1.12.2.jar                           | None                                     |
          | LC    | thaumcraft                     | 6.1.BETA26              | Thaumcraft-1.12.2-6.1.BETA26.jar              | None                                     |
          | LC    | hammerx                        | ${version}              | hammerx-1.12-1.1.4.jar                        | None                                     |
          | LC    | ironchest                      | 1.12.2-7.0.59.842       | ironchest-1.12.2-7.0.59.842.jar               | None                                     |
          | L     | moveplus                       | 1.12.1-2.4.5            | moveplus-1.12.1-2.4.5.jar                     | None                                     |
          | L     | nei                            | 2.4.2                   | NotEnoughItems-1.12.2-2.4.2.240-universal.jar | None                                     |
          | L     | quantimate                     | 1.6.9                   | Quantimate1.12.2-1.6.9.jar                    | None                                     |
          | L     | snowvariants                   | 1.0.0                   | Snow+Variants-1.12.2-1.0.0.jar                | None                                     |
          | L     | uteamcore                      | 2.2.4.94                | u_team_core-1.12.2-2.2.4.94.jar               | None                                     |
          | L     | usefulbackpacks                | 1.3.1.13                | useful_backpacks-1.12.2-1.3.1.13.jar          | None                                     |
          | L     | corail_pillar                  | 4.2.1                   | corail_pillar-4.2.1-1.12.jar                  | None                                     |     Loaded coremods (and transformers):
      CTMCorePlugin (CTM-MC1.12.2-0.3.3.22(1).jar)
        team.chisel.ctm.client.asm.CTMTransformer
          Profiler Position: N/A (disabled)
          Is Modded: Definitely; Server brand changed to 'fml,forge'
          Type: Dedicated Server (map_server.txt)


      crash-2019-02-22_16.18.03-server.txt
    • Xenomatrix
      Worlds don't save. Forge version 1.12.2

      By Xenomatrix · Posted 12 minutes ago

      Currently, when I play on the forge profile, it doesn't save the world which I am playing on. I tried reinstalling Minecraft entirely, however that didn't work. I tried again on a superflat world (flew to a village and exited there) and it didn't save my position or my inventory. It worked perfectly on the unmodded profiles (or worlds).   What is happening?
  • Topics

    • Kost
      1
      Server is not working, HELP!!!!

      By Kost
      Started 9 minutes ago

    • WaningMatrix
      8
      [1.12] Some GUI buttons not showing up.

      By WaningMatrix
      Started 2 hours ago

    • cinimodaz
      6
      Getting error trying to use Oceano Shaders

      By cinimodaz
      Started 1 hour ago

    • Xenomatrix
      0
      Worlds don't save. Forge version 1.12.2

      By Xenomatrix
      Started 11 minutes ago

    • BatHeart
      5
      [1.13.2] Mod configuration using ForgeConfigSpec

      By BatHeart
      Started 21 hours ago

  • Who's Online (See full list)

    • Xenomatrix
    • loordgek
    • cinimodaz
    • Pkbldr
    • gengsa
    • Kost
    • Terrails
    • tuhsury
    • diesieben07
    • SaltyBrownie18
    • BatHeart
    • JupiterKJ
    • WaningMatrix
    • LTNightshade
    • ثاسشى
    • DavidM
    • Splint
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.8] How can I get my custom MapGen structure to generate?
  • Theme
  • Contact Us

Copyright © 2017 ForgeDevelopment LLC Powered by Invision Community