Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.14.4] Worldgen issues


Crack3dC0d3
 Share

Recommended Posts

4 minutes ago, Crack3dC0d3 said:

But it didnt spawn. Not at all. Any help?

Huh? Help with what I don't see what I could help with. You've provided no way for me to provide actual assistance.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Alright, I''m trying to spawn trees in my normal world. I already got the nbt files but i cant seem to fix how the "Feature" class works. (If i'm actually supposed to use that one) heres my code now

 

public class SilverwoodFeature extends Feature<NoFeatureConfig> {
    public SilverwoodFeature(Function<Dynamic<?>, ? extends NoFeatureConfig> configFactoryIn) {
        super(configFactoryIn);
    }

    @Override
    public boolean place(IWorld world, ChunkGenerator<? extends GenerationSettings> generator, Random random, BlockPos spawnPos, NoFeatureConfig config) {
        ServerWorld worldserver = (ServerWorld) world;
        TemplateManager templatemanager = worldserver.getStructureTemplateManager();
        Template template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/greatwoodtree"));
        int h = ThreadLocalRandom.current().nextInt(0, 7);
        switch(h) {
            case 1: template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/silverwood/silverwood1")); break;
            case 2: template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/silverwood/silverwood2")); break;
            case 3: template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/silverwood/silverwood3")); break;
            case 4: template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/silverwood/silverwood4")); break;
            case 5: template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/silverwood/silverwood5")); break;
            case 6: template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/silverwood/silverwood6")); break;
            case 7: template = templatemanager.getTemplate(new ResourceLocation("arcana", "trees/silverwood/silverwood7")); break;
        }

        if(random.nextInt(1) != 0 || world.getBiome(spawnPos) != Biomes.PLAINS) {
            return false;
        }

        if(template == null) {
            Constants.LOGGER.error("Could not find structure at " + new ResourceLocation("arcana:structures/trees/greatwood"));
            return false;
        }
        PlacementSettings placementsettings = (new PlacementSettings()).setMirror(Mirror.NONE)
                .setRotation(Rotation.NONE).setIgnoreEntities(false).setChunk(null);

        template.addBlocksToWorld(world, spawnPos.add(-4, 0, -4), placementsettings);
        return true;
    }
Link to comment
Share on other sites

11 hours ago, Crack3dC0d3 said:

.setChunk(null);

You may want to set the chunk to the chunk you are in.You can get it from the IWorld parameter using the BlockPos parameter you were given.

 

11 hours ago, Crack3dC0d3 said:

I already got the nbt files

Where are they located?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

11 hours ago, Animefan8888 said:

Where are they located?


Thats not the problem since saplings work with the same files. But they are located in resources/data/arcana/structures.. Oh wait thats not right


EDIT: It is right, Nevermind. But still, they dont spawn in the world. The saplings do work though

 

 

11 hours ago, Animefan8888 said:

You may want to set the chunk to the chunk you are in.You can get it from the IWorld parameter using the BlockPos parameter you were given.

Tried that, Doesnt change anything.

I got no errors in the console

Edited by Crack3dC0d3
Link to comment
Share on other sites

10 hours ago, Crack3dC0d3 said:

But still, they dont spawn in the world. The saplings do work though

So then are the features getting called? Is the template returning null? Are you adding the feature to a biomes list of features?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

28 minutes ago, Crack3dC0d3 said:

See, I forgot something. How can i do that? 

Biome#addFeature

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

21 minutes ago, Crack3dC0d3 said:

Alright thanks, which parameters do i use? i got the first 2 but i dont understand the last 2

Biome#addFeature only has two parameters.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

24 minutes ago, Crack3dC0d3 said:

Sorry, wrong method. I meant Biome#createDecoratedFeature

I'm not sure to be honest look for where the trees are added in vanilla.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

  • 9 months later...
3 minutes ago, hohserg said:

Did anyone found how to port IWorldGenerator to Feature? I still wander in the dark. Help plz

Please start a new thread for your issue instead of posting in a nearly year old one, you'll get a better response :)

 

Also, include a description of what you are trying to do (from the gameplay standpoint; not HOW you want to do it), what you have tried (code is good, a github repo link is best), and logs (debug.log posted as a github gist is best)

Doing these things will ensure you get the best possible response. An incomplete post is an invitation to just have it skipped over!! ?

Edited by Ugdhar
  • Like 1
Link to comment
Share on other sites

2 hours ago, hohserg said:

Did anyone found how to port IWorldGenerator to Feature? I still wander in the dark. Help plz

TLDR: you don't. You rewrite it from scratch.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • This is what I have for two ModelFiles, the first only applying one overlay and the second apply the first overlay + another. public ModelFile scuffedWarenaiBlockModel(Block block) { return models().getBuilder("scuffed_" + name(block)) .parent(existingMcModel("block")) .texture("particle", warenaiBlockTexture(block)) .texture("underlay", warenaiBlockTexture(block)) .texture("overlay", scuffedTexture()) .element().from(0, 0, 0).to(16, 16, 16).allFaces((direction, faceBuilder) -> faceBuilder.uvs(0, 0, 16, 16).texture("#underlay").cullface(direction)).end() .element().from(0, 0, 0).to(16, 16, 16).allFaces((direction, faceBuilder) -> faceBuilder.uvs(0, 0, 16, 16).texture("#overlay").cullface(direction)).end(); } public ModelFile crackedWarenaiBlockModel(Block block, int crackedLevel) { return models().getBuilder("cracked" + crackedLevel + "_" + name(block)) .parent(existingMcModel("block")) .texture("particle", warenaiBlockTexture(block)) .texture("underlay", warenaiBlockTexture(block)) .texture("overlay1", scuffedTexture()) .texture("overlay2", crackedTexture(crackedLevel)) .element().from(0, 0, 0).to(16, 16, 16).allFaces((direction, faceBuilder) -> faceBuilder.uvs(0, 0, 16, 16).texture("#underlay").cullface(direction)).end() .element().from(0, 0, 0).to(16, 16, 16).allFaces((direction, faceBuilder) -> faceBuilder.uvs(0, 0, 16, 16).texture("#overlay1").cullface(direction)).end() .element().from(0, 0, 0).to(16, 16, 16).allFaces((direction, faceBuilder) -> faceBuilder.uvs(0, 0, 16, 16).texture("#overlay2").cullface(direction)).end(); }   This works, but it doesn't seem so simple for a stair block.  I copied the stair stuff from the forge BlockStateProvider class to get started with a normal stair model that works:  public void warenaiStairBlock(StairsBlock block, ResourceLocation texture) { warenaiStairBlockInternal1(block, texture, texture, texture); } public void warenaiStairBlockInternal1(StairsBlock block, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) { warenaiStairBlockInternal2(block, block.getRegistryName().toString(), side, bottom, top); } public void warenaiStairBlockInternal2(StairsBlock block, String baseName, ResourceLocation side, ResourceLocation bottom, ResourceLocation top) { ModelFile normal_stairs = models().stairs(baseName, side, bottom, top); ModelFile normal_stairsInner = models().stairsInner(baseName + "_inner", side, bottom, top); ModelFile normal_stairsOuter = models().stairsOuter(baseName + "_outer", side, bottom, top); warenaiStairsBlock(block, normal_stairs, normal_stairsInner, normal_stairsOuter); } public void warenaiStairsBlock(StairsBlock block, ModelFile stairs, ModelFile stairsInner, ModelFile stairsOuter) { getVariantBuilder(block) .forAllStatesExcept(state -> { Direction facing = state.getValue(StairsBlock.FACING); Half half = state.getValue(StairsBlock.HALF); StairsShape shape = state.getValue(StairsBlock.SHAPE); int yRot = (int) facing.getClockWise().toYRot(); // Stairs model is rotated 90 degrees clockwise for some reason yRot %= 360; boolean uvlock = yRot != 0 || half == Half.TOP; // Don't set uvlock for states that have no rotation ModelFile shapeDependentModel = shape == StairsShape.STRAIGHT ? stairs : shape == StairsShape.INNER_LEFT || shape == StairsShape.INNER_RIGHT ? stairsInner : stairsOuter; if (shape == StairsShape.INNER_LEFT || shape == StairsShape.OUTER_LEFT) { yRot += 270; // Left facing stairs are rotated 90 degrees clockwise } if (shape != StairsShape.STRAIGHT && half == Half.TOP) { yRot += 90; // Top stairs are rotated 90 degrees clockwise } return ConfiguredModel.builder() .modelFile(shapeDependentModel) .rotationX(half == Half.BOTTOM ? 0 : 180) .rotationY(yRot) .uvLock(uvlock) .build(); }, StairsBlock.WATERLOGGED); }   Now I have no idea where to go. I could take the time and figure it out all on my own, but since I really should be working on a college essay I thought I would see if anyone else knew what to do first. If not, then I will just do it myself when I get the time.
    • O well i tried to fix a bug in the stone age mod and my plan failed after trying to insert the json directly into the jar.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.