Compare commits
5 Commits
361a21a2c9
...
99b52010aa
Author | SHA1 | Date |
---|---|---|
Treer | 99b52010aa | |
Treer | 176609cace | |
Treer | 47c7f06f4f | |
Treer | dfc0f72407 | |
Treer | aa188604c0 |
|
@ -1,6 +1,6 @@
|
|||
language: java
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
- openjdk8
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
|
@ -16,7 +16,7 @@ before_deploy:
|
|||
deploy:
|
||||
provider: releases
|
||||
api_key: # this encrypted token is only readable by travis ci to access the github accout to attach the files to the created tag/release
|
||||
secure: F1bVvI4MuNosAozor3CFkeeq8ncE6FaF/lSub+HpmnFvrZprXEfzVvzZj9eh98PPOg5U6/+fsN3vR3hvStZ9u1BXBTFfiKxZZb1xFlnzkX1JpUJJYhARUYNHOMwXxU32syHs40j/ABGU27teLnuwSHcVQGGtxqX2ka5guCxzJnw68B8EgB0gGv7hN0iRocpbpA5uyAtoGyLBIebYQ5r6Bda/8HW1OshW+xNfPc1lcaC2kd0v5OgxjlyCodi4JsJQvdCZOvoMwORjpUamBgVhPS82vqVVONCfkT+j+sCgT5JZsjHjGS7MnSXK4y2Zyt1ghf2MY6gwx5QGmjZnQnTU6agQQ9zLNSW780ugbQxylWLrPQsTTWGqzS4G/rYh7iRJXHw6jJA9FgRGkE14/leox8a3s2QvYTbMgdeMekqw0YCgs4KnxrZYb1edGTOzs3f8jgMofr8EjOWjzDayB4kc+Yp5++BjtTUV6X+jMNKI1tmgOBUrSFQFqt0uvsDkHhcIuCDEHo04ubNPwJhnKl7zkdoVrALrPuTAQI68tfhWuqgP+8FvSAB9Tpw4k3rHdae+LFnG+7q2ktxRlrlV6WevaEFUz1QsokyRAB1VrcEjWEfn87zuBpSDU5NPgs5l0d32QAeP9XbXn+Pp7XGErhDcbHH+C0C9EvTy57sAAf/7ujM=
|
||||
secure: ZqjcGz5yL41o70rjKMLQJNDQgR6dDbQh53BC5AWmokAYFcxjtshZBFVIifrvO4SfBnBfvaYsGRl2xy2qNqXoUNbNFw151GaZPbvdYyeG6W0WIWyrlWG5U4NS3fjXXq6Gh/+8hTWRiRDHGiIRNx9QdhqyjazkjepjpZa37WcYu5o/DUrqSTnqv2c/9RuDYRvmVxDktnwfUKbh+uJMW03oPDhvyqm2cWQ2L8BSlCPdsdC5Pl5qEuDwTb+9S6r5oiF2usnwzfgIb4YGGWtCbOgWmsr3NJ65v9bY2iEiZp/V+b6PfCN44jyydkBvnuuLMSvQmSYpgxxqC2yEADSgVBwikwbdikEmU+t5eGGUITZNpwPvqUPYfZbmH+KSSKIV+HRDidaEF43YJcMNuJowu37XgdQKke75gi5EzwvujZhIpUBbLZSV318spwYWbtrj9xPqrEIhmV+MQqO9gjxMDhGH+psQt01D5V2vqagMCRtc2h5SykRyeZekdqHW7SHm32H5CJ4267AjAPkiENTCrCaQJmemclLIgAk8AKCDG/mn68Uv2EOg0ZHU1sPaLcDFbhOiBzwB1feo+1xXRPzceqnoBDVi6+o+qyVWuBsxTsxLkvvRCBy0166sBpsUzFBUePYlhR5ETc+h65Q554xu/jQtxno/bJ1EDtSYWIrYloFSisE=
|
||||
file:
|
||||
- "target/${filename}.jar"
|
||||
- "target/${filename}.zip"
|
||||
|
|
|
@ -356,7 +356,7 @@ public class Actions {
|
|||
"Amidst - Advanced Minecraft Interfacing and Data/Structure Tracking\n"
|
||||
+ (FeatureToggles.MINETEST_SUPPORT ? "Amidst for Minetest - The Amidst project adapted to support Minetest\n\n" : "\n")
|
||||
+ amidstVersion.createVersionString() + "\n"
|
||||
+ "Project page: https://github.com/Treer/amidstest\n"
|
||||
+ "Project page: https://github.com/Treer/Amidst-for-Minetest\n"
|
||||
+ "Forum thread: https://forum.minetest.net/viewtopic.php?t=19869");
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ public class BiomeDataOracleCarpathian extends MinetestBiomeDataOracle {
|
|||
}
|
||||
|
||||
@Override
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
public short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
|
||||
// The Carpathian mapgen terrain is not yet stable.
|
||||
// See https://forum.minetest.net/viewtopic.php?f=18&t=19132
|
||||
|
|
|
@ -29,7 +29,7 @@ public class BiomeDataOracleFlat extends MinetestBiomeDataOracle {
|
|||
}
|
||||
|
||||
@Override
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
public short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
|
||||
// FYI: at the time of writing this, the mapgen for Flat is not yet officially stable
|
||||
// See https://forum.minetest.net/viewtopic.php?f=18&t=19132
|
||||
|
|
|
@ -175,7 +175,7 @@ public class BiomeDataOracleHallelujah extends MinetestBiomeDataOracle {
|
|||
}
|
||||
|
||||
@Override
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
public short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
|
||||
int width = result.length;
|
||||
if (width > 0) {
|
||||
|
|
|
@ -43,7 +43,7 @@ public class BiomeDataOracleV5 extends MinetestBiomeDataOracle {
|
|||
}
|
||||
|
||||
@Override
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
public short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
|
||||
// The v5 mapgen terrain became officially stable in Minetest v5, Dec 2018
|
||||
// See https://github.com/minetest/minetest/commit/40007351569413fd9dcff861ee00562d0c405722
|
||||
|
|
|
@ -180,7 +180,7 @@ public class BiomeDataOracleV6 extends MinetestBiomeDataOracle {
|
|||
}
|
||||
|
||||
@Override
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
public short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
|
||||
// The v6 mapgen has been officially stable since 2012
|
||||
// See https://forum.minetest.net/viewtopic.php?f=18&t=19132
|
||||
|
|
|
@ -190,7 +190,7 @@ public class BiomeDataOracleV7 extends MinetestBiomeDataOracle {
|
|||
}
|
||||
|
||||
@Override
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
public short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
return isFloatlands ?
|
||||
populateArray_floatlands(corner, result, useQuarterResolution) :
|
||||
populateArray_groundlevel(corner, result, useQuarterResolution);
|
||||
|
|
|
@ -374,7 +374,7 @@ public class BiomeDataOracleValleys extends MinetestBiomeDataOracle implements I
|
|||
|
||||
|
||||
@Override
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
public short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
|
||||
// The Valleys mapgen terrain is not yet stable.
|
||||
// See https://forum.minetest.net/viewtopic.php?f=18&t=19132
|
||||
|
|
|
@ -13,6 +13,8 @@ import amidst.minetest.world.mapgen.MapgenParams;
|
|||
import amidst.minetest.world.mapgen.MinetestBiome;
|
||||
import amidst.minetest.world.mapgen.MinetestBiomeProfileImpl;
|
||||
import amidst.minetest.world.mapgen.Noise;
|
||||
import amidst.mojangapi.world.coordinates.CoordinatesInWorld;
|
||||
import amidst.mojangapi.world.coordinates.Resolution;
|
||||
import amidst.settings.biomeprofile.BiomeProfile;
|
||||
import amidst.settings.biomeprofile.BiomeProfileSelection;
|
||||
import amidst.settings.biomeprofile.BiomeProfileUpdateListener;
|
||||
|
@ -30,8 +32,8 @@ public abstract class MinetestBiomeDataOracle implements IBiomeDataOracle, Biome
|
|||
public static final int BITPLANE_OCEAN = 0x2000;
|
||||
public static final int BITPLANE_MOUNTAIN = 0x1000;
|
||||
public static final int MASK_BITPLANES = ~(BITPLANE_RIVER | BITPLANE_OCEAN | BITPLANE_MOUNTAIN);
|
||||
|
||||
|
||||
|
||||
|
||||
public MinetestBiomeDataOracle(MapgenParams params, BiomeProfileSelection biomeProfileSelection, long seed) {
|
||||
//this.seed = (int)(seed & 0xFFFFFFFFL);
|
||||
this.seed = (int)seed;
|
||||
|
@ -47,11 +49,68 @@ public abstract class MinetestBiomeDataOracle implements IBiomeDataOracle, Biome
|
|||
biomeProfileSelection.addUpdateListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The same as populateArray(), but if a subclass implements this instead of overriding
|
||||
* populateArray() then clipping to Minetest world boundaries will get handled by the superclass.
|
||||
*/
|
||||
protected abstract short populateArray_unbounded(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution);
|
||||
|
||||
|
||||
public short populateArray(CoordinatesInWorld corner, short[][] result, boolean useQuarterResolution) {
|
||||
|
||||
// invoke populateArray_unbounded() then clip the results to world boundaries
|
||||
short ret = MASK_BITPLANES;
|
||||
|
||||
int width = result.length;
|
||||
if (width > 0) {
|
||||
// Minetest world boundaries are X=30927, X=−30912, Z=30927 and Z=−30912
|
||||
Resolution resolution = Resolution.from(useQuarterResolution);
|
||||
int height = result[0].length;
|
||||
int left = (int) corner.getX();
|
||||
int top = (int) corner.getY();
|
||||
int step = resolution.getStep();
|
||||
int right = left + (width - 1) * step;
|
||||
int bottom = top + (height - 1) * step;
|
||||
|
||||
// Use -top and -bottom because Minetest uses left-handed coordinates, while Amidst uses
|
||||
// right-handed coordinates, and we want to compare against Minetest boundaries
|
||||
top = -top;
|
||||
bottom = -bottom;
|
||||
|
||||
if (right >= -30912 && left <= 30927 && top >= -30912 && bottom <= 30927) {
|
||||
ret = populateArray_unbounded(corner, result, useQuarterResolution);
|
||||
|
||||
if (left < -30912 || right > 30927 || bottom < -30912 || top > 30927) {
|
||||
// part of this fragment is outside the world-bounds, erase that part
|
||||
short blank_index = (short) MinetestBiome.VOID.getIndex();
|
||||
int world_z = top;
|
||||
for (int z = 0; z < height; z++, world_z -= step) {
|
||||
int world_x = left;
|
||||
for (int x = 0; x < width; x++, world_x += step) {
|
||||
if (world_x < -30912 || world_x > 30927 || world_z < -30912 || world_z > 30927) {
|
||||
result[x][z] = blank_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// the entire fragment is outside the world-bounds
|
||||
short blank_index = (short) MinetestBiome.VOID.getIndex();
|
||||
for (int y = 0; y < height; y++) {
|
||||
for (int x = 0; x < width; x++) {
|
||||
result[x][y] = blank_index;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public MapgenParams getMapgenParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
protected MinetestBiome[] getBiomeArray() {
|
||||
|
||||
MinetestBiome[] result;
|
||||
|
|
|
@ -18,7 +18,7 @@ public enum WorldType {
|
|||
V5 ("v5", "v5", null),
|
||||
V6 ("v6", "v6", null),
|
||||
V7 ("v7", "v7", null),
|
||||
V7_FLOATLANDS ("v7 Floatlands", "v7floatlands", null),
|
||||
V7_FLOATLANDS ("early v7 Floatlands (MT5.1.0 or earlier)", "v7floatlands", null),
|
||||
// FLAT - can reuse the minecraft FLAT
|
||||
FRACTAL ("Fractal", "fractal", null),
|
||||
CARPATHIAN ("Carpathian", "carpathian", null),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
project.build.sourceEncoding=UTF-8
|
||||
amidst.build.jdk.version=1.8
|
||||
amidst.build.filename=amidst-minetest-v1-4
|
||||
amidst.build.filename=amidst-minetest-v1-4-1
|
||||
|
||||
amidst.version.major=1
|
||||
amidst.version.minor=4
|
||||
amidst.version.preReleaseSuffix=
|
||||
amidst.version.preReleaseSuffix=1
|
||||
|
|
Loading…
Reference in New Issue