Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terra++ v2.0 #29

Draft
wants to merge 96 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
a492be2
begin preparing for a whole new scalar dataset config system
DaMatrix Apr 5, 2021
c5940c0
Merge remote-tracking branch 'origin/master' into dev/2.0
DaMatrix Apr 5, 2021
658bc8e
actual support for multiresolution datasets!
DaMatrix Apr 6, 2021
870bb47
stupidly bad parsing of EPSG projections
DaMatrix Apr 6, 2021
f553a21
make tree cover data use new dataset system too
DaMatrix Apr 6, 2021
6e4c45d
delete a bunch of classes that are no longer needed
DaMatrix Apr 6, 2021
17755dd
remove "zoom" option from web mercator
DaMatrix Apr 6, 2021
d3a91ea
Merge branch 'master' into dev/2.0
DaMatrix Apr 6, 2021
81fc3b9
store custom datasets in the generator settings, and store generator …
DaMatrix Apr 7, 2021
90c82f8
begin migrating osm config parsing to jackson
DaMatrix Apr 7, 2021
3355d2a
osm config has been nearly entirely ported to jackson
DaMatrix Apr 7, 2021
164d873
all references to gson have been removed!
DaMatrix Apr 7, 2021
c4dffe0
fix lombok annotation processing with mixin
DaMatrix Apr 7, 2021
90c5d02
store OpenStreetMap parse config in generator settings
DaMatrix Apr 8, 2021
a6ce544
store biome config and overrides in generator settings
DaMatrix Apr 9, 2021
ecf851e
define terrain surface blocks in generator settings
DaMatrix Apr 9, 2021
8da7f97
configure data bakers+populators with generator settings
DaMatrix Apr 9, 2021
740e4a9
add support for terrarium pngs
DaMatrix Apr 9, 2021
413a0f7
add preset for the moon!
DaMatrix Apr 9, 2021
fd24c90
fix a few minor bugs
DaMatrix Apr 10, 2021
67e7e26
i copied mixin config from fp2 and didn't fix the names
DaMatrix Apr 10, 2021
a38eac5
allow overriding generation in specific dimensions
DaMatrix Apr 10, 2021
a915562
initial support for querying data at different zoom levels
DaMatrix Apr 11, 2021
5e5f15f
make distance polygon rasterizer work at low zoom levels
DaMatrix Apr 11, 2021
231d9e1
fix calculation of dataset degrees/sample
DaMatrix Apr 11, 2021
5ef5fb5
make multires sampling work correctly for all projections
DaMatrix Apr 17, 2021
efb546a
Merge remote-tracking branch 'origin/master' into dev/2.0
DaMatrix Apr 17, 2021
851a0a3
initial FarPlaneTwo integration
DaMatrix Apr 17, 2021
27eca11
update to latest fp2
DaMatrix May 24, 2021
ea675b8
support loading low-res OSM data
DaMatrix Aug 14, 2021
f459b38
fill residential OSM polygons with brick at very simplified detail le…
DaMatrix Feb 12, 2023
7693a5c
add support for restricting draw functions to a random chance of actu…
DaMatrix Feb 12, 2023
8eee55a
begin designing a parser for WKT projections
DaMatrix Feb 12, 2023
5f1507e
WKT: properly support parsing ellipsoids
DaMatrix Mar 12, 2023
d2e6db8
WKT: add a fancy schema system for describing WKT formats for parsing
DaMatrix Mar 19, 2023
b511e8e
WKT: begin support for parsing coordinate systems
DaMatrix Mar 22, 2023
3092ed7
WKT: add test cases based on EPSG projections database
DaMatrix Mar 22, 2023
4776604
WKT: we can successfully parse nearly the entire EPSG projections dat…
DaMatrix Mar 22, 2023
6925164
WKT: undo everything to prepare for implementing wkt2 instead
DaMatrix Mar 23, 2023
4381fb9
WKT: begin parsing PROJJSON
DaMatrix Mar 23, 2023
584e0c6
WKT: support PROJJSON projected CRSs
DaMatrix Mar 25, 2023
06feb2c
WKT: refactor WKTObject into an interface
DaMatrix Mar 26, 2023
5421c27
WKT: initial support for vertical datums
DaMatrix Apr 1, 2023
94e6319
WKT: initial support for dynamic vertical datums
DaMatrix Apr 3, 2023
d45b5e5
WKT: we can parse the full EPSG database now!
DaMatrix Apr 3, 2023
c0506c0
WKT: minor cleanup
DaMatrix Apr 3, 2023
04e38ed
WKT: improve handling of ellipsoids with measurement units
DaMatrix Apr 5, 2023
abae66e
begin laying out a new system for representing map projections, this …
DaMatrix Apr 12, 2023
1e97434
runtime bytecode generation for unit converters
DaMatrix Apr 13, 2023
983861e
optimize converter sequence optimization
DaMatrix Apr 13, 2023
a27bf20
get rid of bytecode generation for unit converters
DaMatrix Apr 13, 2023
4d35951
interning unit converters shouldn't simplify them
DaMatrix Apr 13, 2023
4379b1e
define coordinate system axes and axis units
DaMatrix Apr 13, 2023
e283e51
refactor axis units to be separate from axes
DaMatrix Apr 13, 2023
a078547
implement ellipsoidal coordinate system
DaMatrix Apr 14, 2023
7902ed6
add interfaces for projections
DaMatrix Apr 15, 2023
62a6986
begin implementing WKT -> new system conversions
DaMatrix Apr 15, 2023
f5c581c
entirely delete custom system for parsing PROJJSON coordinates and stuff
DaMatrix Apr 15, 2023
4123956
experiment with using Apache SIS for projections
DaMatrix Apr 16, 2023
6ff9c3a
totally rewrite old LatLng class to make it not be garbage
DaMatrix Apr 17, 2023
d580581
some initial hacks to load legacy t++ projections as SIS CRSs
DaMatrix Apr 17, 2023
a8b826d
add ability to compute the derivative of a GeographicProjection at a …
DaMatrix Apr 17, 2023
f812af3
the main BTE projection can now be written as a WKT2 string!
DaMatrix Apr 17, 2023
2763a36
make OutOfProjectionBoundsException extend SIS' ProjectionException
DaMatrix Apr 18, 2023
813d7b3
delete old GeographicProjection#metersPerUnit() method
DaMatrix Apr 18, 2023
c8845a6
AdvancedEarthGui: allow right-clicking buttons to go back
DaMatrix Apr 20, 2023
19b432a
add accurate WKT representations for all legacy projections
DaMatrix Apr 20, 2023
7ee8be7
clean up some of the WKT representations of standard projections
DaMatrix Apr 20, 2023
209bd7d
AdvancedEarthGui: support projections with parameters again
DaMatrix Apr 20, 2023
2d28973
GeographicProjection: support conversion to a SIS CoordinateReference…
DaMatrix Apr 21, 2023
a6bf013
GeographicProjection: add method for computing the derivative at a point
DaMatrix Apr 27, 2023
7f34575
implement derivative calculations for a few GeographicProjection impls
DaMatrix Apr 27, 2023
cd7ae9b
update to porklib 0.5.8-SNAPSHOT
DaMatrix Apr 29, 2023
fb77174
begin designing a system for representing grids of coordinates which …
DaMatrix Apr 29, 2023
3cc7ddd
i'd rather have it be a "point array" rather than a "point grid"
DaMatrix Apr 30, 2023
7d944af
allow computing the "average point density" in a point array
DaMatrix Apr 30, 2023
8ccc24d
DataBakerHeights now fetches data using a PointArray2D
DaMatrix May 5, 2023
7aa42ab
clean up GeographicProjection->CoordinateReferenceSystem cache
DaMatrix May 5, 2023
f4bf8c8
prepare to implement all old projections as MathTransforms
DaMatrix May 5, 2023
f7c7508
construct CoordinateReferenceSystems manually instead of writing and …
DaMatrix May 5, 2023
b072f02
begin implementing DymaxionProjection as a MathTransform
DaMatrix May 5, 2023
bab1ff5
AdvancedEarthGui: render projection derivative on preview
DaMatrix May 8, 2023
3643c03
we can now accurately compute the derivative of Dymaxion's fromGeo!
DaMatrix May 8, 2023
cdb309a
begin trying to compute the derivative for conformal dymaxion
DaMatrix May 9, 2023
61978ba
heavily optimize base dymaxion projection
DaMatrix May 9, 2023
722c893
we can now compute the derivative of conformal dymaxion's fromGeo!
DaMatrix May 9, 2023
7aed6d1
we can now compute the derivative of BTE conformal dymaxion's fromGeo!
DaMatrix May 9, 2023
3b47c85
DymaxionProjection: eliminate more use of static arrays in place of p…
DaMatrix May 9, 2023
5c9e795
suppress SIS warning messages about unset environment variables
DaMatrix May 10, 2023
50e4f48
support derivative calculation for Dymaxion toGeo
DaMatrix May 10, 2023
de981ff
also suppress SIS warning messages when TerraConstants is loaded befo…
DaMatrix May 10, 2023
eb0008d
properly compute derivatives for conformal dymaxion (+BTE variant) toGeo
DaMatrix May 10, 2023
1ced1ea
eliminate all remaining heap allocations in dymaxion-based projections
DaMatrix May 10, 2023
05fd415
ConformalDynmaxionProjection: make InvertableVectorField use a single…
DaMatrix May 10, 2023
c425fbf
SISHelper.projectedCRS: allow fast implementations to bypass cache
DaMatrix May 10, 2023
51a1fda
make use of TransformException's lastCompletedTransform to significan…
DaMatrix May 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
62 changes: 51 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ buildscript {
name = "Minecraft Forge"
url = "https://files.minecraftforge.net/maven"
}
maven {
name = "SpongePowered"
url = "https://repo.spongepowered.org/maven"
}
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT"
classpath "org.spongepowered:mixingradle:0.6-SNAPSHOT"
classpath "com.github.jengelman.gradle.plugins:shadow:4.0.0"
}
}
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "org.spongepowered.mixin"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "maven-publish"

version = "1.1.0." + ('git rev-list --count HEAD'.execute().text.trim()) + "-1.12.2"
version = "2.0.0." + ('git rev-list --count HEAD'.execute().text.trim()) + "-1.12.2"
group = "net.buildtheearth"
archivesBaseName = "terraplusplus"

Expand All @@ -29,6 +35,8 @@ minecraft {

mappings = "stable_39"
makeObfSourceJar = false

coreMod = "net.buildtheearth.terraplusplus.asm.TerraPlusPlusMixinLoader"
}

configurations {
Expand All @@ -37,40 +45,56 @@ configurations {
}

repositories {
maven { //used for leveldb
maven {
name = "DaPorkchop_"
url = "https://maven.daporkchop.net/"
}
maven { //used for leveldb
name = "OpenCollab Snapshots"
url = "https://repo.opencollab.dev/snapshot/"
}
maven {
name = "JitPack"
url = "https://jitpack.io/"
}
}

dependencies {
deobfProvided ("com.github.OpenCubicChunks.CubicChunks:cubicchunks:f71aafb9854466ac5ffa0ccd2796921684f1d8b1") {
deobfProvided("com.github.OpenCubicChunks.CubicChunks:cubicchunks:9dcb135c2990f1de0d0fd9e418121d3476288c11") {
transitive = false
}
deobfProvided ("com.github.OpenCubicChunks:CubicWorldGen:27de56d2f792513873584b2f8fd9f3082fb259ec") {
deobfProvided("com.github.OpenCubicChunks:CubicWorldGen:27de56d2f792513873584b2f8fd9f3082fb259ec") {
transitive = false
}

shade "org.apache.commons:commons-imaging:1.0-alpha2"
/*compileOnly("net.daporkchop:fp2:0.0.1-1.12.2-SNAPSHOT") {
transitive = false
}*/

shade "com.github.DaMatrix:commons-imaging:4c6c5dfe6401a884cb4cf53fb838c99e1dfb104c"

shade "com.fasterxml.jackson.core:jackson-databind:2.11.2"

shade("net.daporkchop.lib:binary:0.5.5-SNAPSHOT") {
shade("net.daporkchop.lib:binary:0.5.8-SNAPSHOT") {
exclude group: "io.netty"
}
shade "net.daporkchop.lib:math:0.5.8-SNAPSHOT"

testCompile "junit:junit:4.12"
shade ("org.apache.sis.core:sis-referencing:1.3") {
exclude group: "jakarta.xml.bind"
}

if ("true".equalsIgnoreCase(System.getProperty("idea.sync.active"))) {
//intellij is present - we don't want it to register mixin as an annotation processor, so we just add it as a standard dependency.
// if we don't do this, the intellij annotation processors will get totally screwed up
compile "org.spongepowered:mixin:0.8.1"
} else {
//register mixin as a standard annotation processor
annotationProcessor "org.spongepowered:mixin:0.8.1:processor"
}

compileOnly "org.projectlombok:lombok:1.18.16"
annotationProcessor "org.projectlombok:lombok:1.18.16"

testCompile "junit:junit:4.12"
testCompileOnly "org.projectlombok:lombok:1.18.16"
testAnnotationProcessor "org.projectlombok:lombok:1.18.16"
}

processResources {
Expand All @@ -92,11 +116,27 @@ processResources {
}
}

mixin {
defaultObfuscationEnv searge
add sourceSets.main, "terraplusplus.refmap.json"
}

shadowJar {
classifier = null
configurations = [project.configurations.shade]

exclude 'module-info.class'

manifest {
attributes(
"MixinConfigs": "terraplusplus.mixins.json",
"tweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"TweakOrder": 0,
"FMLCorePluginContainsFMLMod": "true",
"FMLCorePlugin": "net.buildtheearth.terraplusplus.asm.TerraPlusPlusMixinLoader",
"ForceLoadAsMod": "true"
)
}
}
build.dependsOn shadowJar

Expand Down
17 changes: 15 additions & 2 deletions src/main/java/net/buildtheearth/terraplusplus/EarthWorldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiCreateWorld;
import net.minecraft.world.World;
import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.WorldProviderSurface;
import net.minecraft.world.WorldServer;
import net.minecraft.world.WorldType;
Expand All @@ -33,7 +35,11 @@ public ICubeGenerator createCubeGenerator(World world) {

@Override
public BiomeProvider getBiomeProvider(World world) {
return EarthGeneratorSettings.parse(world.getWorldInfo().getGeneratorOptions()).biomeProvider();
if (world instanceof WorldServer) {
return EarthGeneratorSettings.forWorld((WorldServer) world).biomeProvider();
} else {
return EarthGeneratorSettings.parse(EarthGeneratorSettings.DEFAULT_SETTINGS).biomeProvider();
}
}

@Override
Expand All @@ -43,7 +49,9 @@ public IntRange calculateGenerationHeightRange(WorldServer world) {

@Override
public boolean hasCubicGeneratorForWorld(World w) {
return w.provider instanceof WorldProviderSurface; // an even more general way to check if it's overworld (need custom providers)
return w.provider instanceof WorldProviderSurface
|| (TerraConfig.dimension.overrideNetherGeneration && w.provider instanceof WorldProviderHell)
|| (TerraConfig.dimension.overrideEndGeneration && w.provider instanceof WorldProviderEnd);
}

@Override
Expand All @@ -61,6 +69,11 @@ public double voidFadeMagnitude() {
return 0;
}

@Override
public double getHorizon(World world) {
return Integer.MIN_VALUE;
}

@Override
@SideOnly(Side.CLIENT)
public void onCustomizeButton(Minecraft mc, GuiCreateWorld guiCreateWorld) {
Expand Down
53 changes: 49 additions & 4 deletions src/main/java/net/buildtheearth/terraplusplus/TerraConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.buildtheearth.terraplusplus;

import net.buildtheearth.terraplusplus.util.TerraConstants;
import net.buildtheearth.terraplusplus.util.http.Http;
import net.minecraftforge.common.config.Config;
import net.minecraftforge.common.config.Config.Comment;
Expand All @@ -12,6 +13,11 @@
@Mod.EventBusSubscriber(modid = TerraConstants.MODID)
@Config(modid = TerraConstants.MODID)
public class TerraConfig {
public static int[] lastVersion = { //this field might be used at some point
1, 12, 2, //mc version
2, 0, 0 //t++ version
};

@Name("reduced_console_messages")
@Comment({ "Removes all of TerraPlusPlus' messages which contain various links in the server console",
"This is just if it seems to spam the console, it is purely for appearance" })
Expand All @@ -25,7 +31,17 @@ public class TerraConfig {
public static boolean threeWater;

@Comment({
"Configure how terraplusplus' will retrieve OpenStreetMap data."
"Configure how terraplusplus will retrieve surface elevation data."
})
public static ElevationOpts elevation = new ElevationOpts();

@Comment({
"Configure how terraplusplus will retrieve tree cover data."
})
public static TreeCoverOpts treeCover = new TreeCoverOpts();

@Comment({
"Configure how terraplusplus will retrieve OpenStreetMap data."
})
public static OSMOpts openstreetmap = new OSMOpts();

Expand All @@ -34,6 +50,8 @@ public class TerraConfig {
})
public static HttpOpts http = new HttpOpts();

public static DimensionOpts dimension = new DimensionOpts();

@SubscribeEvent
public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
if (TerraConstants.MODID.equals(event.getModID())) {
Expand All @@ -42,10 +60,27 @@ public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event
}
}

public static class ElevationOpts {
public String[] servers = {
"https://cloud.daporkchop.net/gis/dem/earth/"
};
}

public static class TreeCoverOpts {
public String[] servers = {
"https://cloud.daporkchop.net/gis/treecover2000/"
};
}

public static class OSMOpts {
@Deprecated
public String[] servers = {
"https://cloud.daporkchop.net/gis/osm/0/"
};

public String[] servers_v2 = { //different field name to avoid breaking old config files
"https://cloud.daporkchop.net/gis/osm/"
};
}

public static class HttpOpts {
Expand All @@ -62,9 +97,7 @@ public static class HttpOpts {
public String[] maxConcurrentRequests = {
"8: https://cloud.daporkchop.net/",
"8: https://s3.amazonaws.com/",
"1: http://gis-treecover.wri.org/",
"1: https://overpass.kumi.systems/",
"1: https://lz4.overpass-api.de/"
"16: http://10.0.0.20/"
};

@Comment({
Expand All @@ -79,4 +112,16 @@ public static class HttpOpts {
})
public int cacheTTL = 1440;
}

public static class DimensionOpts {
@Comment({
"Forces Terra++ generation in The End."
})
public boolean overrideEndGeneration = false;

@Comment({
"Forces Terra++ generation in the Nether."
})
public boolean overrideNetherGeneration = false;
}
}
48 changes: 0 additions & 48 deletions src/main/java/net/buildtheearth/terraplusplus/TerraConstants.java

This file was deleted.

6 changes: 6 additions & 0 deletions src/main/java/net/buildtheearth/terraplusplus/TerraMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import net.buildtheearth.terraplusplus.control.TerraTeleport;
import net.buildtheearth.terraplusplus.provider.GenerationEventDenier;
import net.buildtheearth.terraplusplus.provider.WaterDenier;
import net.buildtheearth.terraplusplus.util.TerraConstants;
import net.buildtheearth.terraplusplus.util.compat.fp2.TerraFP2CompatManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.Mod;
Expand Down Expand Up @@ -40,6 +42,10 @@ public void construction(FMLConstructionEvent event) {
}

TerraConstants.CC_VERSION = Loader.instance().getIndexedModList().get(CubicChunks.MODID).getVersion();

if (Loader.instance().getIndexedModList().containsKey("fp2")) {
MinecraftForge.EVENT_BUS.register(TerraFP2CompatManager.class);
}
}

@EventHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package net.buildtheearth.terraplusplus.asm;

import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import org.spongepowered.asm.launch.MixinBootstrap;
import org.spongepowered.asm.mixin.Mixins;

import javax.annotation.Nullable;
import java.util.Map;

/**
* @author DaPorkchop_
*/
public class TerraPlusPlusMixinLoader implements IFMLLoadingPlugin {
public TerraPlusPlusMixinLoader() {
try {
Class.forName("org.spongepowered.asm.launch.MixinBootstrap");
MixinBootstrap.init();
Mixins.addConfiguration("terraplusplus.mixins.json");
} catch (ClassNotFoundException ignored) {
//this means cubic chunks isn't there, let forge show missing dependency screen
}
}

@Override
public String[] getASMTransformerClass() {
return new String[0];
}

@Override
public String getModContainerClass() {
return null;
}

@Nullable
@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {
}

@Override
public String getAccessTransformerClass() {
return null;
}
}
Loading