Skip to content

Commit

Permalink
apply editorconfig (why didn't we do this?)
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Dec 24, 2024
1 parent d5a6212 commit eb2746e
Show file tree
Hide file tree
Showing 873 changed files with 7,497 additions and 7,493 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@ Drag the map to pan, scroll to zoom, and use the bookmark buttons to create and
**AA4 has _absolutely no items!_** - This means the map works right away, can't be lost, and works on any server!

## Client-Side Features

- Antique Atlas 4 is designed to let you focus on exploring the world, not get stuck staring at the map!
- The map is rendered using hand-drawn "tiles" to represent terrain, biomes, and structures.
- Tiles represent entire chunks at least - no peeking for caves or bases!
- The map is rendered using hand-drawn "tiles" to represent terrain, biomes, and structures.
- Tiles represent entire chunks at least - no peeking for caves or bases!
- Gravestones automatically appear where you die, with customizable flavour text:

> ![grave style euphemisms](https://cdn.modrinth.com/data/Y5Ve4Ui4/images/c6f5e20bcef2c26c40390e888e540dcdd89a1818.png)
- Waypoint markers come in a variety of styles:

> ![marker styles](https://cdn.modrinth.com/data/Y5Ve4Ui4/images/b7064c3287c5535cd9ac6d454c10ead984c7a7b3.png)
If you need an equally distraction-free compass to substitute a minimap, try [PicoHUD](https://modrinth.com/mod/picohud)!
Expand All @@ -32,10 +36,15 @@ If you need an equally distraction-free compass to substitute a minimap, try [Pi
_These work in singleplayer, or on servers with [Surveyor](https://modrinth.com/mod/surveyor) installed._

- Markers are automatically added for notable structures and active nether portals:

> ![structure markers](https://cdn.modrinth.com/data/Y5Ve4Ui4/images/190cc4eaa2e8784dd0f46bee9c225228a05f191a.png)
- Structures only appear on the map after you've looked at them or stood on them in-game:

> ![structure discovery](https://cdn.modrinth.com/data/Y5Ve4Ui4/images/86054c7949fed59341cef60d0d9f27aee86ae6ef.gif)
- Map exploration can be shared with `/surveyor share [player]` which will also reveal those players' position:

> ![map sharing](https://cdn.modrinth.com/data/Y5Ve4Ui4/images/4422049c395a856c35bbc361c52e8bcd30e89523.png)
## Configuration
Expand All @@ -50,6 +59,7 @@ Antique Atlas can be configured from `config/antique-atlas.toml`:<br/>
Surveyor, which handles features including map sharing & visibility, can be configured from `config/surveyor.toml`

## Resource Packs

Tiles, markers, biome detection, and structure detection is fully data-driven via resource packs.<br/>
**Without defined biomes, atlas "guesses" tiles via tags, and shows `???` if that fails.**

Expand Down
128 changes: 64 additions & 64 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
//file:noinspection GroovyAssignabilityCheck
//file:noinspection GroovyAccessibility
plugins {
id "maven-publish"
alias libs.plugins.loom
alias libs.plugins.githubRelease
alias libs.plugins.minotaur
id "maven-publish"
alias libs.plugins.loom
alias libs.plugins.githubRelease
alias libs.plugins.minotaur
}

version = "$baseVersion+$branch"
archivesBaseName = project.slug

repositories {
maven { url "https://repo.sleeping.town/" }
maven { url "https://repo.sleeping.town/" }
}

dependencies {
implementation libs.kaleidoConfig
implementation libs.kaleidoConfig

minecraft libs.mc
mappings variantOf(libs.yarn) { classifier "v2" }
modImplementation libs.fl
minecraft libs.mc
mappings variantOf(libs.yarn) { classifier "v2" }
modImplementation libs.fl

modImplementation libs.fapi
modImplementation libs.fapi

modImplementation libs.surveyor
modImplementation libs.surveyor
}

processResources {
final Map<String, String> meta = [
version : version,
modId : modId,
modName : modName,
modDescription: modDescription,
homepage : "https://modrinth.com/mod/${slug}",
issues : "https://github.com/${user}/${slug}/issues",
sources : "https://github.com/${user}/${slug}",
license : license,
authors : authors.split(", ").join("\",\n \""),
contributors : contributors.split(", ").join("\",\n \""),
members : "${authors}. Contributions by ${contributors}",
mc : compatibleVersions.split(", ")[0],
fl : libs.versions.fl.get(),
fapi : libs.versions.fapi.get(),
surveyor : libs.versions.surveyor.get(),
]
inputs.properties(meta)
filesMatching("*.mod.json") { expand(meta) }
filesMatching("META-INF/*mods.toml") { expand(meta) }
final Map<String, String> meta = [
version : version,
modId : modId,
modName : modName,
modDescription: modDescription,
homepage : "https://modrinth.com/mod/${slug}",
issues : "https://github.com/${user}/${slug}/issues",
sources : "https://github.com/${user}/${slug}",
license : license,
authors : authors.split(", ").join("\",\n \""),
contributors : contributors.split(", ").join("\",\n \""),
members : "${authors}. Contributions by ${contributors}",
mc : compatibleVersions.split(", ")[0],
fl : libs.versions.fl.get(),
fapi : libs.versions.fapi.get(),
surveyor : libs.versions.surveyor.get(),
]
inputs.properties(meta)
filesMatching("*.mod.json") { expand(meta) }
filesMatching("META-INF/*mods.toml") { expand(meta) }
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
it.options.release = 17
it.options.encoding = "UTF-8"
it.options.release = 17
}

java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

jar {
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
from("LICENSE") {
rename { "${it}_${archivesBaseName}" }
}
}

githubRelease {
token = "$System.env.GITHUB_TOKEN"
owner = project.user
repo = slug
tagName = "v${baseVersion}+${tagBranch}"
targetCommitish = tagBranch
releaseAssets = remapJar
releaseName = "v${baseVersion}"
allowUploadToExisting = true
generateReleaseNotes = true
body = !file("CHANGELOG.md").exists() ? "" : rootProject.file("CHANGELOG.md").text
token = "$System.env.GITHUB_TOKEN"
owner = project.user
repo = slug
tagName = "v${baseVersion}+${tagBranch}"
targetCommitish = tagBranch
releaseAssets = remapJar
releaseName = "v${baseVersion}"
allowUploadToExisting = true
generateReleaseNotes = true
body = !file("CHANGELOG.md").exists() ? "" : rootProject.file("CHANGELOG.md").text
}

modrinth {
token = "$System.env.MODRINTH_TOKEN"
projectId = modrinthSlug
versionNumber = project.version
uploadFile = remapJar
gameVersions = compatibleVersions.split(", ").toList()
loaders = compatibleLoaders.split(", ").toList()
changelog = !file("CHANGELOG.md").exists() ? "" : rootProject.file("CHANGELOG.md").text + "\n\nChangelog: https://github.com/${user}/${slug}/releases/tag/v${baseVersion}+${tagBranch}"
syncBodyFrom = rootProject.file("README.md").text
dependencies {
required.version libs.fapi.get().getName(), libs.versions.fapi.get()
required.version libs.surveyor.get().getName(), libs.versions.surveyor.get()
}
token = "$System.env.MODRINTH_TOKEN"
projectId = modrinthSlug
versionNumber = project.version
uploadFile = remapJar
gameVersions = compatibleVersions.split(", ").toList()
loaders = compatibleLoaders.split(", ").toList()
changelog = !file("CHANGELOG.md").exists() ? "" : rootProject.file("CHANGELOG.md").text + "\n\nChangelog: https://github.com/${user}/${slug}/releases/tag/v${baseVersion}+${tagBranch}"
syncBodyFrom = rootProject.file("README.md").text
dependencies {
required.version libs.fapi.get().getName(), libs.versions.fapi.get()
required.version libs.surveyor.get().getName(), libs.versions.surveyor.get()
}
}

tasks.register("fullRelease") {
group "publishing"
dependsOn "githubRelease"
dependsOn "modrinth"
group "publishing"
dependsOn "githubRelease"
dependsOn "modrinth"
}
18 changes: 9 additions & 9 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pluginManagement {
repositories {
maven { url "https://maven.fabricmc.net/" }
gradlePluginPortal()
}
repositories {
maven { url "https://maven.fabricmc.net/" }
gradlePluginPortal()
}
}

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("libs.versions.toml"))
}
}
versionCatalogs {
create("libs") {
from(files("libs.versions.toml"))
}
}
}
68 changes: 34 additions & 34 deletions src/main/java/folk/sisby/antique_atlas/AntiqueAtlas.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,38 @@
import org.apache.logging.log4j.Logger;

public class AntiqueAtlas implements ClientModInitializer {
public static final String ID = "antique_atlas";
public static final String NAME = "Antique Atlas";

public static final Logger LOGGER = LogManager.getLogger(NAME);

public static final AntiqueAtlasConfig CONFIG = AntiqueAtlasConfig.createToml(FabricLoader.getInstance().getConfigDir(), "", "antique-atlas", AntiqueAtlasConfig.class);
public static ScreenState<AtlasScreen> lastState = new ScreenState<>();

public static Identifier id(String path) {
return path.contains(":") ? new Identifier(path) : new Identifier(ID, path);
}

@Override
public void onInitializeClient() {
AntiqueAtlasKeybindings.init();
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(TileTextures.getInstance());
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(StructureTileProviders.getInstance());
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(BiomeTileProviders.getInstance());
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(MarkerTextures.getInstance());

SurveyorClientEvents.Register.worldLoad(id("world_data"), WorldAtlasData::onLoad);
SurveyorClientEvents.Register.terrainUpdated(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onTerrainUpdated(w, s, k));
SurveyorClientEvents.Register.structuresAdded(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onStructuresAdded(w, s, k));
SurveyorClientEvents.Register.landmarksAdded(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onLandmarksAdded(w, s, k));
SurveyorClientEvents.Register.landmarksRemoved(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onLandmarksRemoved(w, s, k));
ClientTickEvents.END_WORLD_TICK.register((w -> WorldAtlasData.getOrCreate(w).tick(w)));
CommonLifecycleEvents.TAGS_LOADED.register(((manager, client) -> BiomeTileProviders.getInstance().registerFallbacks(manager.get(RegistryKeys.BIOME))));
ClientPlayConnectionEvents.DISCONNECT.register(((handler, client) -> BiomeTileProviders.getInstance().clearFallbacks()));
ClientPlayConnectionEvents.DISCONNECT.register(((handler, client) -> WorldAtlasData.WORLDS.clear()));

WorldSummary.enableTerrain();
WorldSummary.enableStructures();
WorldSummary.enableLandmarks();
}
public static final String ID = "antique_atlas";
public static final String NAME = "Antique Atlas";

public static final Logger LOGGER = LogManager.getLogger(NAME);

public static final AntiqueAtlasConfig CONFIG = AntiqueAtlasConfig.createToml(FabricLoader.getInstance().getConfigDir(), "", "antique-atlas", AntiqueAtlasConfig.class);
public static ScreenState<AtlasScreen> lastState = new ScreenState<>();

public static Identifier id(String path) {
return path.contains(":") ? new Identifier(path) : new Identifier(ID, path);
}

@Override
public void onInitializeClient() {
AntiqueAtlasKeybindings.init();
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(TileTextures.getInstance());
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(StructureTileProviders.getInstance());
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(BiomeTileProviders.getInstance());
ResourceManagerHelper.get(ResourceType.CLIENT_RESOURCES).registerReloadListener(MarkerTextures.getInstance());

SurveyorClientEvents.Register.worldLoad(id("world_data"), WorldAtlasData::onLoad);
SurveyorClientEvents.Register.terrainUpdated(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onTerrainUpdated(w, s, k));
SurveyorClientEvents.Register.structuresAdded(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onStructuresAdded(w, s, k));
SurveyorClientEvents.Register.landmarksAdded(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onLandmarksAdded(w, s, k));
SurveyorClientEvents.Register.landmarksRemoved(id("world_data"), (w, s, k) -> WorldAtlasData.getOrCreate(w).onLandmarksRemoved(w, s, k));
ClientTickEvents.END_WORLD_TICK.register((w -> WorldAtlasData.getOrCreate(w).tick(w)));
CommonLifecycleEvents.TAGS_LOADED.register(((manager, client) -> BiomeTileProviders.getInstance().registerFallbacks(manager.get(RegistryKeys.BIOME))));
ClientPlayConnectionEvents.DISCONNECT.register(((handler, client) -> BiomeTileProviders.getInstance().clearFallbacks()));
ClientPlayConnectionEvents.DISCONNECT.register(((handler, client) -> WorldAtlasData.WORLDS.clear()));

WorldSummary.enableTerrain();
WorldSummary.enableStructures();
WorldSummary.enableLandmarks();
}
}
Loading

0 comments on commit eb2746e

Please sign in to comment.