• 0

    posted a message on Cascading worldgen error

    It probably doesn't matter too much. I personally have mine registered in init.

    Posted in: Modification Development
  • 0

    posted a message on Cascading worldgen error
    Quote from TheMasterCaver»

    This is done in the method that is called when a chunk is populated, which is (in 1.6.4) "generateStructuresInChunk", which checks to see if the bounding boxes of each structure stored within the structure map intersects the current chunk (or rather, offset chunk area), with a further check done for each individual structure piece in StructureStart (which has its own list of individual components), and yet another on each get/setblock call, which are placed inside of wrapper methods in StructureComponent which compare the coordinates of each block to the bounding box of the area being populated.

    Also, the fact that the game iterates over the entire structure map in MapGenStructure explains MC-33134, as it has to iterate through more and more structures as time goes on (not just when generating them, but when determining if structure-specific mobs should spawn and anything else that needs to check for a structure), which is particularly significant for mineshafts because they are so common and rather complex; structure saving amplifies this since all structures ever created, not just in chunks loaded in the current session, are stored.

    Ok, that makes sense. If I'm understanding this correctly, what I need to do is generate the structure through a WorldGenerator like normal (with an offset), but first just generate the positions of each individual structure (through the algorithm I've created). In order to prevent runaway chunk generation, I need to check to make sure each individual structure (which has a StructureBoundingBox) is intersecting with the current chunk (which is offset). If yes, generate the actual structure, else don't. In terms of generating the pieces that don't pass the initial check, would I just have a loop or something in the WorldGenerator which loops through all the pending structures checking to see if they intersect with a newly loaded chunk? (I'm assuming WorldGenerator#generate is called once per chunk IIRC).

    I just want to make sure I'm not misunderstanding anything before I implement it.
    Posted in: Modification Development
  • 0

    posted a message on Cascading worldgen error
    Quote from mariot»

    I've tried this after I read the Reddit post but I still get the same error.


    int randX = blockX + rand.nextInt(16 + 8);
    int randZ = blockZ + rand.nextInt(16 + 8);


    You need to add the 8 to your block position first.
    Quote from TheMasterCaver»

    -snip-

    So in the case of a Stronghold, the game looks like it generates the positions for the Stronghold first and stores them somewhere. At first, I thought it stored them in a map in MapGenStructure but that actually looks like it stores ALL structures ever generated. It looks like the actual pieces that are built are in a list in the StructureStart. I can't see where this gets built out though. Though I think fundamentally, vanilla Strongholds are using generatePositions to generate the structure without placing any of the blocks. Then StructureStart is called and it generates the actual pieces and builds them. One thing I don't understand though is where and how does vanilla generate and build a portion of a structure, and not the parts that are in unloaded chunks (or non-generated chunks).
    Posted in: Modification Development
  • 0

    posted a message on Cascading worldgen error

    I do have a question regarding this topic and larger structures. If I were to generate large, randomized structures (think an underground, procedurally generated dungeon), how would you go about fixing that because it isn't as simple as adding an offset?

    Posted in: Modification Development
  • 0

    posted a message on Cascading worldgen error

    Read this Reddit post - it goes into very good detail about explaining the issue and fixing it as well.

    Posted in: Modification Development
  • 0

    posted a message on Crash Upon Using Custom Entity

    Take some time to learn some Java. The method tells you what you need to return (ActionResult<ItemStack>).

    Posted in: Modification Development
  • 0

    posted a message on Crash Upon Using Custom Entity

    You're returning null to a method...that is almost never good.

    Posted in: Modification Development
  • 0

    posted a message on Converting buildings from viewable into code?

    Create a class which implements ITemplateProcessor and modify the processBlock method to check what biome you are in and change the block accordingly. When you go to spawn the structure in, call the addBlocksToWorld method which allows you to specify the processor you want to use and use yours instead of the default one.

    Posted in: Modification Development
  • 0

    posted a message on Crash Upon Using Custom Entity

    Of course it won't work - directly copying what I have will not work. Instead, modify it to what you need. Like I said, I'm doing a lot of extra stuff you won't need, some of that flows down. Just remove the extra stuff I've added, and do what you normally do. I was just showing that all you need to do is create an instance of your projectile (using your parameters, not mine), and spawn it in.

    Posted in: Modification Development
  • 0

    posted a message on Crash Upon Using Custom Entity

    Thanks!


    Why are you specifying the onImpact method again? In your sword class, you should create an instance of your entity (SwordBeam entity = new SwordBeam(setup stuff here);) and then spawn it in. The class itself should handle the logic so you don't have to specify it every time you create an instance of your projectile. For example, this is how I handle spawning projectiles (do note I have a lot of extra stuff going on, but the three highlighted lines are all you need - call that whenever you want to spawn a projectile). I believe the way you are doing it could be causing the NPE (you can verify it by looking through that error log some more and finding where it calls your code).

    Posted in: Modification Development
  • 0

    posted a message on Crash Upon Using Custom Entity

    Your entity class is abstract, meaning you can't instantiate an instance of it. That really shouldn't even compile properly - regardless, don't make it abstract and it should work.

    Posted in: Modification Development
  • 0

    posted a message on Is Minecraft Forge safe?

    There is an installer which you can download and run that to install Forge easily. Is that what you downloaded?

    Posted in: Mods Discussion
  • 0

    posted a message on Is Minecraft Forge safe?

    Mac has the same kinda thing warning about launching apps/software from unknown developers. If you downloaded it from Forge provided download links (and didn't click on any ads, but the download button in the top right), it's perfectly fine.

    Posted in: Mods Discussion
  • 0

    posted a message on Adding entity spawns in custom structures

    Using Stucture Blocks, you can spawn structures with entities saved to them.

    Posted in: Modification Development
  • 0

    posted a message on Creating A custom health bar, need help.

    Cancel the vanilla health bar and render your own.


    You should also try and update to newer versions...you're 5 versions behind now.

    Posted in: Modification Development
  • To post a comment, please .