Java 类org.bukkit.util.noise.SimplexNoiseGenerator 实例源码

项目:TalentZzzz    文件:BasicTerrainGenerator.java   
public BasicTerrainGenerator(long mountainSeed, long terrainSeed1, long terrainSeed2, long humiditySeed, long seaSeed, long temperatureSeed) {
    mountainGenerator = new SimplexNoiseGenerator(mountainSeed);
    terrainGenerator1 = new SimplexNoiseGenerator(terrainSeed1);
    terrainGenerator2 = new SimplexNoiseGenerator(terrainSeed2);
    humidityGenerator = new SimplexNoiseGenerator(humiditySeed);
    seaGenerator = new SimplexNoiseGenerator(seaSeed);
    temperatureGenerator = new SimplexNoiseGenerator(temperatureSeed);
}
项目:Caveworm    文件:SimplexNoiseWorm.java   
public SimplexNoiseWorm(Location startingLocation, int xMovementOctaves,
        int yMovementOctaves, int zMovementOctaves,
        double xSpreadFrequency, double ySpreadFrequency,
        double zSpreadFrequency, double xSpreadThreshHold,
        double ySpreadThreshHold, double zSpreadThreshHold,
        double xSpreadAmplitude, double ySpreadAmplitude,
        double zSpreadAmplitude, int maximumLength, long seedX, long seedY,
        long seedZ) {
    super(startingLocation, maximumLength);
    this.xNoiseGenerator = new SimplexNoiseGenerator(seedX);
    this.yNoiseGenerator = new SimplexNoiseGenerator(seedY);
    this.zNoiseGenerator = new SimplexNoiseGenerator(seedZ);
    this.xMovementOctaves = xMovementOctaves;
    this.yMovementOctaves = yMovementOctaves;
    this.zMovementOctaves = zMovementOctaves;
    this.xSpreadFrequency = xSpreadFrequency;
    this.ySpreadFrequency = ySpreadFrequency;
    this.zSpreadFrequency = zSpreadFrequency;
    this.xSpreadThreshHold = xSpreadThreshHold;
    this.ySpreadThreshHold = ySpreadThreshHold;
    this.zSpreadThreshHold = zSpreadThreshHold;
    this.xSpreadAmplitude = xSpreadAmplitude;
    this.ySpreadAmplitude = ySpreadAmplitude;
    this.zSpreadAmplitude = zSpreadAmplitude;
    this.currentX = startingLocation.getBlockX();
    this.currentY = startingLocation.getBlockY();
    this.currentZ = startingLocation.getBlockZ();
    currentPath = new HashSet<Location>();
    this.currentLength = 0;
    finished = false;
}
项目:GiantTrees    文件:Draw3d.java   
public Draw3d(final Location refPoint, final double noiseIntensity,
              final TreeType treeType,
              final WorldChangeTracker changeTracker,
              final RenderOrientation renderOrientation) {
  this.refPoint = refPoint;
  this.noise = new SimplexNoiseGenerator(refPoint.hashCode());
  this.noiseIntensity = noiseIntensity;
  this.changeTracker = changeTracker;
  this.treeType = treeType;
  this.renderOrientation = renderOrientation;
}
项目:Caveworm    文件:SimplexSphereFormer.java   
public SimplexSphereFormer(int id, Material replacementMaterial,
    boolean useHiddenOre, byte replacementData, int xOctaves,
    int yOctaves, int zOctaves, double xSpreadFrequency,
    double ySpreadFrequency, double zSpreadFrequency,
    double xUpperRadiusBound, double yUpperRadiusBound,
    double zUpperRadiusBound, double xLowerRadiusBound,
    double yLowerRadiusBound, double zLowerRadiusBound, int xzSlices,
    int xySlices, int yzSlices, Collection<Material> materialsToIgnore,
    int fallingBlockBehavior, Material fallingBlockReplacement,
    long xSeed, long ySeed, long zSeed) {
this.replacementMaterial = replacementMaterial;
this.amplitude = 2.0; // hardcoded to ensure it properly scales with the
              // bounds
this.id = id;
this.xGenerator = new SimplexNoiseGenerator(xSeed);
this.yGenerator = new SimplexNoiseGenerator(ySeed);
this.zGenerator = new SimplexNoiseGenerator(zSeed);
this.xOctaves = xOctaves;
this.yOctaves = yOctaves;
this.zOctaves = zOctaves;
this.xSpreadFrequency = xSpreadFrequency;
this.ySpreadFrequency = ySpreadFrequency;
this.zSpreadFrequency = zSpreadFrequency;
this.xUpperRadiusBound = xUpperRadiusBound;
this.yUpperRadiusBound = yUpperRadiusBound;
this.zUpperRadiusBound = zUpperRadiusBound;
this.xLowerRadiusBound = xLowerRadiusBound;
this.yLowerRadiusBound = yLowerRadiusBound;
this.zLowerRadiusBound = zLowerRadiusBound;
this.xySlices = xySlices;
this.xzSlices = xzSlices;
this.yzSlices = yzSlices;
this.doLater = new LinkedList<Location>();
this.ignoreMaterials = materialsToIgnore;
this.replacementData = replacementData;
if (useHiddenOre) {
    if (Bukkit.getPluginManager().isPluginEnabled("HiddenOre")) {
    hiddenOreManager = new HiddenOreManager();
    } else {
    Caveworm.getInstance()
        .warning(
            "Attempted to send block break events to HiddenOre according to config, but it seems like HiddenOre isn't loaded on this server");
    hiddenOreManager = null;
    }
}
switch (fallingBlockBehavior) {
case 0:
    // ignore the fact that there's a falling block and clear the block
    // below anyway
    fallingBlockHandler = (b) -> {
    executeBlockModification(b);
    };
    break;
case 1:
    // dont clear the block
    fallingBlockHandler = (b) -> {
    };
    break;
case 2:
    // move the block one upwards instead of clearing it and if the
    // block moved is gravity affected as well, instead another block is
    // put in place
    fallingBlockHandler = (b) -> {
    Block above = b.getRelative(BlockFace.UP);
    if (b.getType().hasGravity()) {
        above.setType(fallingBlockReplacement);
        executeBlockModification(b);
    } else {
        above.setTypeIdAndData(b.getType().getId(), b.getData(),
            false);
        executeBlockModification(b);
    }
    };
    break;
default:
    throw new IllegalArgumentException();
}
   }
项目:BuildTools    文件:TerrainType.java   
@Override
public List<Location> execute(BTPlayer player, BuildMode mode, List<BlockPoint> points, BuildPattern pattern, String[] tSettings, String[] pSettings) {
    List<Location> locs = new ArrayList<Location>();
    int sm = new Random().nextInt(25 - 15) + 15;
    long seed = System.currentTimeMillis();
    boolean soft = false;
    if(tSettings.length != 0){
        if(tSettings.length >= 3 && tSettings[2].matches("-?[0-9]+")){
            seed = Long.valueOf(tSettings[2]);
        }
        if(tSettings.length >= 2 && tSettings[1].matches("true|false")){
            soft = Boolean.parseBoolean(tSettings[1]);
        }
        if(tSettings.length >= 1 && tSettings[0].matches("[1-9]([0-9]+)?")){
            sm = Integer.valueOf(tSettings[0]);
        }
    }
    SimplexNoiseGenerator gen = new SimplexNoiseGenerator(seed);
    Location[] mmt = BTUtils.createMinMaxTable(points.get(0), points.get(1));
    Location tmp = mmt[0].clone();
    double h = mmt[1].getBlockY() - mmt[0].getBlockY();
    double hh = h/2;
    double l = getDistance(mmt[0].getBlockX(), mmt[1].getBlockX());
    double w = getDistance(mmt[0].getBlockZ(), mmt[1].getBlockZ());
    for(double x = mmt[0].getX(); x <= mmt[1].getX(); x++){
        tmp.setX(x);
        for(double z = mmt[0].getZ(); z <= mmt[1].getZ(); z++){
            tmp.setZ(z);
            double n = gen.noise(x/sm, z/sm);
            if(soft){
                int xmd = getDistance(new Double(x).intValue(), mmt[1].getBlockX());
                int xd = getDistance(new Double(x).intValue(), mmt[0].getBlockX());
                int zmd = getDistance(new Double(z).intValue(), mmt[1].getBlockZ());
                int zd = getDistance(new Double(z).intValue(), mmt[0].getBlockZ());
                if(xmd < l/6d){
                    n = n - (1d / (l/6d)) * (l/6d - xmd);
                }
                if(xd < l/6d){
                    n = n - (1d / (l/6d)) * (l/6d - xd);
                }
                if(zmd < w/6d){
                    n = n - (1d / (w/6d)) * (w/6d - zmd);
                }
                if(zd < w/6d){
                    n = n - (1d / (w/6d)) * (w/6d - zd);
                }
            }
            tmp.setY(mmt[0].getY() + hh + (hh * n));
            if(tmp.getY() > mmt[1].getY())
                tmp.setY(mmt[1].getY());
            if(tmp.getY() < mmt[0].getY())
                tmp.setY(mmt[0].getY());
            if(tmp.getY() > mmt[0].getY()){
                locs.add(tmp.clone());
                while(tmp.getBlockY() > mmt[0].getBlockY()){
                    tmp.setY(tmp.getY() - 1);
                    locs.add(tmp.clone());
                }
            }
        }
    }
    if(player != null){
        player.sendMessage(ChatColor.GRAY + "Generator Seed: " + seed);
        player.sendMessage(ChatColor.GRAY + "Smoothness: " + sm);
    }
    else if(BTPlugin.plugin.isDebugging()){
        BTPlugin.plugin.getLogger().info("Generator Seed: " + seed);
        BTPlugin.plugin.getLogger().info("Smoothness: " + sm);
    }

    return locs;
}
项目:BedrockAPI    文件:SimplexNoiseGenerator.java   
protected SimplexNoiseGenerator() {
}
项目:BedrockAPI    文件:SimplexNoiseGenerator.java   
public SimplexNoiseGenerator(World world) {
}
项目:BedrockAPI    文件:SimplexNoiseGenerator.java   
public SimplexNoiseGenerator(long seed) {
}
项目:BedrockAPI    文件:SimplexNoiseGenerator.java   
public SimplexNoiseGenerator(Random rand) {
}
项目:BedrockAPI    文件:SimplexNoiseGenerator.java   
public static SimplexNoiseGenerator getInstance() {
    return null;
}