Skip to content

Commit

Permalink
move textures again, bump surveyor
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Apr 1, 2024
1 parent fa8a248 commit c42c31a
Show file tree
Hide file tree
Showing 478 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ To improve this, add `namespace/atlas/biome/path.json` with `{ "parent": "minecr

Structures can be similarly [tiled](https://github.com/sisby-folk/antique-atlas/blob/1.20/src/main/resources/assets/minecraft/atlas/structure/piece/jigsaw/single/pillager_outpost/watchtower.json) or [marked](https://github.com/sisby-folk/antique-atlas/blob/1.20/src/main/resources/assets/minecraft/atlas/structure/type/ocean_monument.json) - provided you're familiar with each type of structure identifier.

Tile textures are loaded from `textures/atlas/tiles` and use an _autotile_-like format.<br/>
You can also add an [mcmeta file](https://github.com/sisby-folk/antique-atlas/blob/1.20/src/main/resources/assets/antique_atlas/textures/atlas/tiles/structure/fortress/nether/nether_fortress_bridge_crossing.png.mcmeta) to adjust which other textures should "connect" and vice-versa.
Tile textures are loaded from `textures/atlas/tile` and use an _autotile_-like format.<br/>
You can also add an [mcmeta file](https://github.com/sisby-folk/antique-atlas/blob/1.20/src/main/resources/assets/antique_atlas/textures/atlas/tile/structure/fortress/nether/nether_fortress_bridge_crossing.png.mcmeta) to adjust which other textures should "connect" and vice-versa.

#### Markers

Marker textures are loaded from `textures/atlas/markers` and are 32x32 by default.<br/>
You can similarly add an [mcmceta file](https://github.com/sisby-folk/antique-atlas/blob/1.20/src/main/resources/assets/antique_atlas/textures/atlas/markers/structure/end_city.png.mcmeta) to adjust size, offsets, and any custom mip levels.<br/>
Marker textures are loaded from `textures/atlas/marker` and are 32x32 by default.<br/>
You can similarly add an [mcmceta file](https://github.com/sisby-folk/antique-atlas/blob/1.20/src/main/resources/assets/antique_atlas/textures/atlas/marker/structure/end_city.png.mcmeta) to adjust size, offsets, and any custom mip levels.<br/>
To add a player-placeable marker, put the texture in the `custom/` subfolder.

To automatically mark a new non-structure point of interest, use Surveyor's [Landmark API](https://modrinth.com/mod/surveyor).

Textures for landmark types will be used automatically when named `namespace/textures/atlas/markers/landmark/type/path.png`.
Textures for landmark types will be used automatically when named `namespace/textures/atlas/marker/landmark/type/path.png`.

---

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ org.gradle.configureondemand=true
# Enable advanced multi-module optimizations (share tiny-remaper instance between projects)
fabric.loom.multiProjectOptimisation=true
# Mod Properties
baseVersion = 2.0.0-beta.8
baseVersion = 2.0.0-beta.9
defaultBranch = 1.20
branch = 1.20
2 changes: 1 addition & 1 deletion libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fl = "0.15.0"
yarn = "1.20.1+build.10"
fapi = "0.83.0+1.20.1"
kaleidoConfig = "0.1.1+1.1.0-beta.3"
surveyor = "0.1.0-beta.30+1.20"
surveyor = "0.1.0-beta.32+1.20"

[plugins]
loom = { id = "fabric-loom", version.ref = "loom" }
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/folk/sisby/antique_atlas/MarkerTexture.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public record MarkerTexture(Identifier id, int offsetX, int offsetY, int textureWidth, int textureHeight, int mipLevels) {
public static MarkerTexture ofId(Identifier id, int offsetX, int offsetY, int width, int height, int mipLevels) {
return new MarkerTexture(new Identifier(id.getNamespace(), "textures/atlas/markers/%s.png".formatted(id.getPath())), offsetX, offsetY, width, height, mipLevels);
return new MarkerTexture(new Identifier(id.getNamespace(), "textures/atlas/marker/%s.png".formatted(id.getPath())), offsetX, offsetY, width, height, mipLevels);
}

public static MarkerTexture centered(Identifier id, int width, int height, int mipLevels) {
Expand All @@ -15,7 +15,7 @@ public static MarkerTexture centered(Identifier id, int width, int height, int m
public static final MarkerTexture DEFAULT = centered(AntiqueAtlas.id("unknown"), 32, 32, 0);

public Identifier keyId() {
return new Identifier(id.getNamespace(), id.getPath().substring("textures/atlas/markers/".length(), id.getPath().length() - 4));
return new Identifier(id.getNamespace(), id.getPath().substring("textures/atlas/marker/".length(), id.getPath().length() - 4));
}

public String displayId() {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/folk/sisby/antique_atlas/TileTexture.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public final class TileTexture {
public static TileTexture empty(Identifier id, boolean innerBorder) {
return new TileTexture(new Identifier(id.getNamespace(), "textures/atlas/tiles/%s.png".formatted(id.getPath())), innerBorder, new ReferenceOpenHashSet<>(), new ReferenceOpenHashSet<>(), new ReferenceOpenHashSet<>());
return new TileTexture(new Identifier(id.getNamespace(), "textures/atlas/tile/%s.png".formatted(id.getPath())), innerBorder, new ReferenceOpenHashSet<>(), new ReferenceOpenHashSet<>(), new ReferenceOpenHashSet<>());
}

public static final TileTexture DEFAULT = empty(AntiqueAtlas.id("test"), false);
Expand All @@ -28,7 +28,7 @@ public TileTexture(Identifier id, boolean innerBorder, Set<TileTexture> tilesTo,
}

public String displayId() {
String trimmedPath = id.getPath().substring("textures/atlas/tiles/".length(), id.getPath().length() - 4);
String trimmedPath = id.getPath().substring("textures/atlas/tile/".length(), id.getPath().length() - 4);
return id.getNamespace().equals(AntiqueAtlas.ID) ? trimmedPath : new Identifier(id.getNamespace(), trimmedPath).toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public Map<Identifier, MarkerTexture> asMap() {
@Override
protected Map<Identifier, MarkerTextureMeta> prepare(ResourceManager manager, Profiler profiler) {
Map<Identifier, MarkerTextures.MarkerTextureMeta> textureMeta = new HashMap<>();
for (Map.Entry<Identifier, Resource> e : manager.findResources("textures/atlas/markers", id -> id.getPath().endsWith(".png")).entrySet()) {
Identifier id = new Identifier(e.getKey().getNamespace(), e.getKey().getPath().substring("textures/atlas/markers/".length(), e.getKey().getPath().length() - ".png".length()));
for (Map.Entry<Identifier, Resource> e : manager.findResources("textures/atlas/marker", id -> id.getPath().endsWith(".png")).entrySet()) {
Identifier id = new Identifier(e.getKey().getNamespace(), e.getKey().getPath().substring("textures/atlas/marker/".length(), e.getKey().getPath().length() - ".png".length()));
try {
ResourceMetadata metadata = e.getValue().getMetadata();
textureMeta.put(id, metadata.decode(MarkerTextures.MarkerTextureMeta.METADATA).orElse(MarkerTextureMeta.DEFAULT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public Map<Identifier, TileTexture> getTextures() {
@Override
protected Map<Identifier, TileTextures.TileTextureMeta> prepare(ResourceManager manager, Profiler profiler) {
Map<Identifier, TileTextureMeta> textureMeta = new HashMap<>();
for (Map.Entry<Identifier, Resource> e : manager.findResources("textures/atlas/tiles", id -> id.getPath().endsWith(".png")).entrySet()) {
Identifier id = new Identifier(e.getKey().getNamespace(), e.getKey().getPath().substring("textures/atlas/tiles/".length(), e.getKey().getPath().length() - ".png".length()));
for (Map.Entry<Identifier, Resource> e : manager.findResources("textures/atlas/tile", id -> id.getPath().endsWith(".png")).entrySet()) {
Identifier id = new Identifier(e.getKey().getNamespace(), e.getKey().getPath().substring("textures/atlas/tile/".length(), e.getKey().getPath().length() - ".png".length()));
try {
ResourceMetadata metadata = e.getValue().getMetadata();
metadata.decode(TileTextureMeta.METADATA).ifPresentOrElse(meta -> {
Expand Down
Loading

0 comments on commit c42c31a

Please sign in to comment.