本文整理汇总了Java中org.bukkit.util.noise.SimplexNoiseGenerator类的典型用法代码示例。如果您正苦于以下问题:Java SimplexNoiseGenerator类的具体用法?Java SimplexNoiseGenerator怎么用?Java SimplexNoiseGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SimplexNoiseGenerator类属于org.bukkit.util.noise包,在下文中一共展示了SimplexNoiseGenerator类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BasicTerrainGenerator
import org.bukkit.util.noise.SimplexNoiseGenerator; //导入依赖的package包/类
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);
}
示例2: SimplexNoiseWorm
import org.bukkit.util.noise.SimplexNoiseGenerator; //导入依赖的package包/类
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;
}
示例3: Draw3d
import org.bukkit.util.noise.SimplexNoiseGenerator; //导入依赖的package包/类
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;
}
示例4: SimplexSphereFormer
import org.bukkit.util.noise.SimplexNoiseGenerator; //导入依赖的package包/类
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();
}
}
示例5: execute
import org.bukkit.util.noise.SimplexNoiseGenerator; //导入依赖的package包/类
@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;
}
示例6: SimplexNoiseGenerator
import org.bukkit.util.noise.SimplexNoiseGenerator; //导入依赖的package包/类
protected SimplexNoiseGenerator() {
}
示例7: getInstance
import org.bukkit.util.noise.SimplexNoiseGenerator; //导入依赖的package包/类
public static SimplexNoiseGenerator getInstance() {
return null;
}