Examples of WorldGenerator


Examples of net.minecraft.world.gen.feature.WorldGenerator

    int x = (int) player.posX;
    int y = (int) (player.posY);
    int z = (int) player.posZ;

    WorldGenerator gen = new WorldGenBalsa((ITreeGenData) PluginArboriculture.treeInterface.getTree(player.worldObj,
        TreeTemplates.templateAsGenome(PluginArboriculture.treeInterface.getTemplate("treeBalsa"))));

    gen.generate(player.worldObj, player.worldObj.rand, x, y, z);

  }
View Full Code Here

Examples of net.minecraft.world.gen.feature.WorldGenerator

    int x = (int) player.posX - 16;
    int y = (int) (player.posY);
    int z = (int) player.posZ - 16;

    WorldGenerator gen = new WorldGenBalsa((ITreeGenData) PluginArboriculture.treeInterface.getTree(player.worldObj,
        TreeTemplates.templateAsGenome(PluginArboriculture.treeInterface.getTemplate("treeBalsa"))));

    for (int i = 0; i < 16; i++)
      gen.generate(player.worldObj, player.worldObj.rand, x + player.worldObj.rand.nextInt(32), y, z + player.worldObj.rand.nextInt(32));
  }
View Full Code Here

Examples of net.minecraft.world.gen.feature.WorldGenerator

    }

    if (timesTicked < maturity)
      return result;

    WorldGenerator generator = this.getTree().getTreeGenerator(worldObj, xCoord, yCoord, zCoord, bonemealed);
    if (generator.generate(worldObj, worldObj.rand, xCoord, yCoord, zCoord)) {
      PluginArboriculture.treeInterface.getBreedingTracker(worldObj, getOwnerProfile()).registerBirth(getTree());
      return 2;
    }

    return 3;
View Full Code Here

Examples of net.minecraft.world.gen.feature.WorldGenerator

    public void growTree (World world, int x, int y, int z, Random random)
    {
        int md = world.getBlockMetadata(x, y, z) % 8;
        world.setBlock(x, y, z, Blocks.air);
        WorldGenerator obj = null;

        obj = new SlimeTreeGen(true, 5, 4, 1, 0);

        if (!(obj.generate(world, random, x, y, z)))
            world.setBlock(x, y, z, this, md + 8, 3);
    }
View Full Code Here

Examples of net.sertik.genesia.world.WorldGenerator

              player.setGold(12000);
          }
          game.getPlayers().add(player);
        }

        WorldGenerator worldGenerator = (WorldGenerator) worldCreation.getSelectedToggle().getUserData();
        game.setWorld(worldGenerator.generate(64, 256));

        genesia.setGame(game);
      }
    });
View Full Code Here

Examples of org.spout.api.generator.WorldGenerator

    for (World world : worlds) {

      // Keep spawn loaded
      WorldConfigurationNode worldConfig = VanillaConfiguration.WORLDS.get(world);
      final WorldGenerator generator = world.getGenerator();
      boolean newWorld = world.getAge() <= 0;

      if (worldConfig.LOADED_SPAWN.getBoolean() || newWorld) {

        final Point spawn;
View Full Code Here

Examples of org.terasology.world.generator.WorldGenerator

    }

    @Override
    public boolean step() {

        WorldGenerator worldGenerator = CoreRegistry.get(WorldGenerator.class);
        worldGenerator.initialize();

        return true;
    }
View Full Code Here

Examples of org.terasology.world.generator.WorldGenerator

        if (info == null) {
            return;
        }

        try {
            WorldGenerator wg = worldGeneratorManager.createGenerator(info.getUri());
            // set the world seed so that partial initialization happens and the facet system has all facet providers
            wg.setWorldSeed("");
            if (wg.getConfigurator().isPresent()) {
                WorldConfigurator worldConfig = wg.getConfigurator().get();

                params = Maps.newHashMap(worldConfig.getProperties());

                for (String key : params.keySet()) {
                    Class<? extends Component> clazz = params.get(key).getClass();
View Full Code Here

Examples of org.terasology.world.generator.WorldGenerator

        CoreRegistry.put(WorldGeneratorPluginLibrary.class, new TempWorldGeneratorPluginLibrary());
        WorldGeneratorInfo info = worldGeneratorManager.getWorldGeneratorInfo(config.getWorldGeneration().getDefaultGenerator());

        try {
            WorldGenerator worldGenerator = worldGeneratorManager.createGenerator(info.getUri());
            seedBinding.setWorldGenerator(worldGenerator);

            if (worldGenerator instanceof WorldGenerator2DPreview) {
                previewGenerator = (WorldGenerator2DPreview) worldGenerator;
            } else {
View Full Code Here

Examples of org.terasology.world.generator.WorldGenerator

            EntityRef worldEntity = worldEntityIterator.next();
            worldRenderer.getChunkProvider().setWorldEntity(worldEntity);

            // get the world generator config from the world entity
            // replace the world generator values from the components in the world entity
            WorldGenerator worldGenerator = CoreRegistry.get(WorldGenerator.class);
            Optional<WorldConfigurator> ocf = worldGenerator.getConfigurator();

            if (ocf.isPresent()) {
                Map<String, Component> params = ocf.get().getProperties();
                for (Map.Entry<String, Component> entry : params.entrySet()) {
                    Class<? extends Component> clazz = entry.getValue().getClass();
                    Component comp = worldEntity.getComponent(clazz);
                    if (comp != null) {
                        entry.setValue(comp);
                    }
                }
                // save the world config back to the world generator
                worldGenerator.setConfigurator(ocf.get());
            }
        } else {
            EntityRef worldEntity = entityManager.create();
            worldEntity.addComponent(new WorldComponent());
            worldRenderer.getChunkProvider().setWorldEntity(worldEntity);

            // transfer all world generation parameters from Config to WorldEntity
            WorldGenerator worldGenerator = CoreRegistry.get(WorldGenerator.class);
            Optional<WorldConfigurator> ocf = worldGenerator.getConfigurator();

            if (ocf.isPresent()) {
                SimpleUri generatorUri = worldGenerator.getUri();
                Config config = CoreRegistry.get(Config.class);

                // get the map of properties from the world generator.  Replace its values with values from the config set by the UI.
                // Also set all the components to the world entity.
                Map<String, Component> params = ocf.get().getProperties();
                for (Map.Entry<String, Component> entry : params.entrySet()) {
                    Class<? extends Component> clazz = entry.getValue().getClass();
                    Component comp = config.getModuleConfig(generatorUri, entry.getKey(), clazz);
                    if (comp != null) {
                        worldEntity.addComponent(comp);
                        entry.setValue(comp);
                    } else {
                        worldEntity.addComponent(entry.getValue());
                    }
                }

                // save the world config back to the world generator
                worldGenerator.setConfigurator(ocf.get());
            }

        }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.