/** * Creates a perlin octave generator for the given world * * @param world World to construct this generator for * @param octaves Amount of octaves to create */ public PerlinOctaveGenerator(World world, int octaves) { this(new Random(world.getSeed()), octaves); }
/** * Creates a seeded simplex noise generator for the given world * * @param world World to construct this generator for */ public SimplexNoiseGenerator(World world) { this(new Random(world.getSeed())); }
/** * Creates a seeded perlin noise generator for the given world * * @param world World to construct this generator for */ public PerlinNoiseGenerator(World world) { this(new Random(world.getSeed())); }
/** * Creates a simplex octave generator for the given world * * @param world World to construct this generator for * @param octaves Amount of octaves to create */ public SimplexOctaveGenerator(World world, int octaves) { this(new Random(world.getSeed()), octaves); }
@Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) return true; long seed; if (sender instanceof Player) { seed = ((Player) sender).getWorld().getSeed(); } else { seed = Bukkit.getWorlds().get(0).getSeed(); } sender.sendMessage("Seed: " + seed); return true; }
/** * Copies the options from the specified world * * @param world World to copy options from * @return This object, for chaining */ public WorldCreator copy(World world) { if (world == null) { throw new IllegalArgumentException("World cannot be null"); } seed = world.getSeed(); environment = world.getEnvironment(); generator = world.getGenerator(); return this; }
@Override protected void createWorldOctaves(World world, Map<String, OctaveGenerator> octaves) { Random seed = new Random(world.getSeed()); OctaveGenerator gen = new PerlinOctaveGenerator(seed, 16, 3, 33, 3); gen.setXScale(coordinateScale); gen.setYScale(heightScale); gen.setZScale(coordinateScale); octaves.put("roughness", gen); gen = new PerlinOctaveGenerator(seed, 16, 3, 33, 3); gen.setXScale(coordinateScale); gen.setYScale(heightScale); gen.setZScale(coordinateScale); octaves.put("roughness2", gen); gen = new PerlinOctaveGenerator(seed, 8, 3, 33, 3); gen.setXScale(coordinateScale / detailNoiseScaleX); gen.setYScale(heightScale / detailNoiseScaleY); gen.setZScale(coordinateScale / detailNoiseScaleZ); octaves.put("detail", gen); }
Biome biome, double surfaceNoise) { initialize(world.getSeed());
@Override protected void createWorldOctaves(World world, Map<String, OctaveGenerator> octaves) { Random seed = new Random(world.getSeed()); OctaveGenerator gen = new PerlinOctaveGenerator(seed, 16, 5, 5); gen.setXScale(heightNoiseScaleX); gen.setZScale(heightNoiseScaleZ); octaves.put("height", gen); gen = new PerlinOctaveGenerator(seed, 16, 5, 33, 5); gen.setXScale(coordinateScale); gen.setYScale(heightScale); gen.setZScale(coordinateScale); octaves.put("roughness", gen); gen = new PerlinOctaveGenerator(seed, 16, 5, 33, 5); gen.setXScale(coordinateScale); gen.setYScale(heightScale); gen.setZScale(coordinateScale); octaves.put("roughness2", gen); gen = new PerlinOctaveGenerator(seed, 8, 5, 33, 5); gen.setXScale(coordinateScale / detailNoiseScaleX); gen.setYScale(heightScale / detailNoiseScaleY); gen.setZScale(coordinateScale / detailNoiseScaleZ); octaves.put("detail", gen); gen = new SimplexOctaveGenerator(seed, 4, 16, 16); gen.setScale(surfaceScale); octaves.put("surface", gen); }
@Override protected void createWorldOctaves(World world, Map<String, OctaveGenerator> octaves) { Random seed = new Random(world.getSeed());
@Override public long getSeed() { return w.getSeed(); }
/** * Creates a seeded perlin noise generator for the given world * * @param world World to construct this generator for */ public PerlinNoiseGenerator(World world) { this(new Random(world.getSeed())); }
/** * Creates a seeded simplex noise generator for the given world * * @param world World to construct this generator for */ public SimplexNoiseGenerator(World world) { this(new Random(world.getSeed())); }
/** * Creates a perlin octave generator for the given world * * @param world World to construct this generator for * @param octaves Amount of octaves to create */ public PerlinOctaveGenerator(World world, int octaves) { this(new Random(world.getSeed()), octaves); }
/** * Creates a simplex octave generator for the given world * * @param world World to construct this generator for * @param octaves Amount of octaves to create */ public SimplexOctaveGenerator(World world, int octaves) { this(new Random(world.getSeed()), octaves); }
@Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) return true; long seed; if (sender instanceof Player) { seed = ((Player) sender).getWorld().getSeed(); } else { seed = Bukkit.getWorlds().get(0).getSeed(); } sender.sendMessage("Seed: " + seed); return true; }
/** * Copies the options from the specified world * * @param world World to copy options from * @return This object, for chaining */ public WorldCreator copy(World world) { if (world == null) { throw new IllegalArgumentException("World cannot be null"); } seed = world.getSeed(); environment = world.getEnvironment(); generator = world.getGenerator(); return this; }
/** * {@inheritDoc} */ @Override public void loadDefaultWorlds() { this.ensureConfigIsPrepared(); List<World> myWorlds = this.plugin.getServer().getWorlds(); for (World w : myWorlds) { String name = w.getName(); if (!worldsFromTheConfig.containsKey(name)) { String generator = null; if (this.defaultGens.containsKey(name)) { generator = this.defaultGens.get(name); } this.addWorld(name, w.getEnvironment(), String.valueOf(w.getSeed()), w.getWorldType(), w.canGenerateStructures(), generator); } } }
public MVWorld(MultiverseCore plugin, World world, WorldProperties properties, boolean fixSpawn) { this.plugin = plugin; this.name = world.getName(); this.worldUID = world.getUID(); this.props = properties; setupProperties(); if (!fixSpawn) { props.setAdjustSpawn(false); } // Setup spawn separately so we can use the validator with the world spawn value.. final SpawnLocationPropertyValidator spawnValidator = new SpawnLocationPropertyValidator(); this.props.setValidator("spawn", spawnValidator); this.props.spawnLocation.setWorld(world); if (this.props.spawnLocation instanceof NullLocation) { final SpawnLocation newLoc = new SpawnLocation(readSpawnFromWorld(world)); this.props.spawnLocation = newLoc; world.setSpawnLocation(newLoc.getBlockX(), newLoc.getBlockY(), newLoc.getBlockZ()); } this.props.environment = world.getEnvironment(); this.props.seed = world.getSeed(); this.initPerms(); this.props.flushChanges(); validateProperties(); }