Skip to content

Commit 2954319

Browse files
committed
Elytra Icon For End City Ships
1 parent 61460e2 commit 2954319

File tree

6 files changed

+127
-107
lines changed

6 files changed

+127
-107
lines changed

README.md

Lines changed: 65 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,95 @@
1-
**Always** use the latest (stable) version of SeedMapper! If you want to play on an older version of Minecraft, use [ViaFabricPlus](https://modrinth.com/mod/viafabricplus). This mod allows you to use the latest features of SeedMapper, while still being able to play on older Minecraft versions.
1+
# Seedmapper 2.18.x (MC1.21.11) - Modified by CevAPI
22

3-
# SeedMapper
4-
In-game Minecraft Fabric mod that allows you to do various things with the world seed. For reference, have a look at the [features](#features) this mod has. Keep in mind though, this mod requires you to have access to the seed. If the seed is not known, you could crack it using [SeedCrackerX](https://github.com/19MisterX98/SeedcrackerX/) by 19MisterX98. For questions and support please head to my [Discord](https://discord.xpple.dev/).
3+
Original Repo: https://github.com/xpple/SeedMapper/
54

6-
## Installation
7-
1. Install the [Fabric Loader](https://fabricmc.net/use/).
8-
2. Download the [Fabric API](https://minecraft.curseforge.com/projects/fabric/) and move it to your mods folder:
9-
- Linux/Windows: `.minecraft/mods`.
10-
- Mac: `minecraft/mods`.
11-
3. Download SeedMapper from the [releases page](https://modrinth.com/mod/seedmapper/versions/) and move it to your mods folder.
5+
## Relationship to upstream
126

13-
## IMPORTANT
14-
You need to have at least Java 23 installed to use this mod. I recommend to get Java 23 (or higher) from [adoptium.net](https://adoptium.net/temurin/releases/?version=23). Next, configure your Minecraft launcher to use this release of Java.
7+
This project is a friendly, independent fork of Seedmapper. I have not proposed any improvements or features to the upstream but I am welcome to them incorporating my changes. I will sporatically maintain this project and re-base/sync with the upstream project.
158

16-
- Vanilla launcher: Go to `Installations` -> `Edit` -> `More options` -> `Java executable`.
17-
- MultiMC: Go to `Edit Instance` -> `Settings` -> `Java` -> `Java Installation`.
18-
- PrismLauncher: Go to `Settings` -> `Java` -> `Java Runtime` -> `Auto-Detect...`.
19-
- Modrinth App: Go to `Instance settings` -> `Java and memory` -> `Custom Java installation` -> `Browse`
9+
## Compiling & Running
2010

21-
Sometimes it may be necessary to click the option for skipping the Java compatibility check.
11+
Original instructions apply.
2212

23-
If you are on Windows, make sure to select `javaw.exe`, not `java.exe`.
13+
## Improvements
2414

25-
If you run into issues, contact your launcher's support.
15+
### Zoom
16+
Zoom further out on the SeedMap. Limited to approx 100,000 which is insane already.
2617

27-
## Features
28-
Before using any of these commands, make sure the seed has been configured using `/sm:config Seed set <seed>`.
18+
You can adjust your own maximum zoom (I recommend 6000) using the command ```/sm:config Zoom set 6000```.
2919

30-
### Seed map
31-
Usage: `/sm:seedmap`
20+
![Zoomies](https://i.imgur.com/utIgDkp.png)
3221

33-
Opens an explorable seed map based on the configured seed. You can move the map by dragging the mouse, and zoom in or out by using the scroll wheel. You can toggle what features are visible by clicking the feature toggles at the top of the screen. This command is especially useful in combination with the `/sm:source` command!
22+
### Directional Arrow
23+
This change was accepted upstream, however in my fork I have adjusted the size of it as well as the icon itself giving it a white fill.
3424

35-
### Biome locating
36-
Usage: `/sm:locate biome <biome>`.
25+
![Arrow](https://i.imgur.com/pkodE8d.png)
3726

38-
Locates a given biome closest to the player. All biomes in all dimensions are supported.
27+
### World Presets
3928

40-
### Structure locating
41-
Usage: `/sm:locate feature <structure>[<pieces>]{<variants>}`.
29+
If the server you're on uses anything other than the default world preset (Large Biomes, Single Biome, ~~Amplified~~, ~~Superflat~~) this will greatly change the world generation. Change the preset to match the server in order to produce an accurate seedmap. Note that Amplified and Superflat biomes are not implemented yet and are placeholders.
4230

43-
Locates a given structure closest to the player. All structures in all dimensions are supported. However, due to limitations in the underlying library, some structures (in particular desert pyramids, jungle temples and woodland mansions) may result in occasional false positives. For more advanced querying you can also use piece and variant data to further restrict the search. For example, the following command will search for end cities with ships: `/sm:locate feature structure end_city[end_ship]`.
31+
- ```/sm:preset list``` — show available presets
32+
- ```/sm:preset set <id>``` — set SeedMapper’s preset
4433

45-
### Ore vein locating
46-
Usage: `/sm:locate orevein (copper|iron)`.
34+
### Seed Map Minimap
4735

48-
Locates an [ore vein](https://minecraft.wiki/w/Ore_vein) closest to the player. The coordinates of the first ore vein block found will be returned. After this, you can use [`/sm:highlight orevein [chunks]`](#ore-vein-highlighting) to highlight the other ores.
36+
This is soon to be accepted by upstream!
4937

50-
### Loot locating
51-
Usage: `/sm:locate loot <amount> <item> [<enchantment conditions>]`.
38+
- Run ``` /sm:minimap ``` to open a live SeedMap minimap in the top-left corner of the HUD.
39+
- Use ``` /sm:minimap on/off ``` or to explicitly control whether it is shown.
5240

53-
Locates chest loot closest to the player. All versions from 1.13 onwards are supported. SeedMapper will search through the chest loot of structures to find loot that matches the item and enchantment conditions. Note that queries for unobtainable loot and illegal enchantment combinations are not prevented by the command. If a search is taking too long, you should probably cancel it using `/sm:stoptask`.
41+
- The minimap:
42+
- Renders the same features you selected on the main map.
43+
- Tracks your current position in real time.
44+
- Ideal for overlaying over Xaeros Minimap (Default settings suits size 152).
5445

55-
### Ore highlighting
56-
Usage: `/sm:highlight block <block> [chunks]`.
46+
- Position & size:
47+
- Move it horizontally with ``` /sm:config SeedMapMinimapOffsetX ```
48+
- Move it vertically with ``` /sm:config SeedMapMinimapOffsetY ```
49+
- Change width with ``` /sm:config SeedMapMinimapWidth ```
50+
- Change height with ``` /sm:config SeedMapMinimapHeight ```
5751

58-
Highlights the specified block in the world. All versions from 1.13 onwards are supported. Due to high dependence on the [`OCEAN_FLOOR_WG`](https://minecraft.wiki/w/Heightmap#OCEAN_FLOOR_WG) heightmap, coal, copper and emerald ore locations may be off.
52+
- Display options:
53+
- Rotate the map with the player’s facing using ``` /sm:config SeedMapMinimapRotateWithPlayer ```
54+
- Adjust zoom independently from the main map via ``` /sm:config SeedMapMinimapPixelsPerBiome ```
55+
- Scale feature icons with ``` /sm:config SeedMapMinimapIconScale ```
56+
- Fine tune the background opacity with ``` /sm:config SeedMapMinimapOpacity ``` without affecting icon readability.
5957

60-
### Ore vein highlighting
61-
Usage: `/sm:highlight orevein [chunks]`.
58+
![Map1](https://i.imgur.com/w5U6Aux.png) ![Map2](https://i.imgur.com/MXqXY5n.png)
6259

63-
Highlights ore veins in the world. Raw ore blocks that generate as part of the ore vein are highlighted distinctly. Filler blocks are ignored.
60+
### Icon Text
61+
When hovering over location icons in the SeedMap it will display text telling you what the locations are.
6462

65-
### Slime chunk locating
66-
Usage: `/sm:locate slimechunk`.
63+
![Text](https://i.imgur.com/A5gCXgP.png)
6764

68-
Locates a slime chunk closest to the player. This will always be accurate.
65+
### Added Elytra/End Ship Locations
66+
This has now been implemented by upstream. They have unified both End City Ships and End Cities together. I have accepted this change but altered it to retain my Elytra icon, this allows you to explicitly look only for Elytras. The command ```/sm:locate feature end_city_ship``` also still applies.
6967

70-
### Source mutation
71-
Usage: `/sm:source (run)|(as <entity>)|(positioned <position>)|(rotated <rotation>)|(in <dimension>)|(versioned <version>)|(seeded <seed>)`.
68+
![Elytra](https://i.imgur.com/fFxoFX4.png)
7269

73-
Executes a given command from a modified source. For example, modifying the source's position will execute the command as if you were in that position. This command is really powerful, use it!
70+
### Export SeedMap
71+
- Added **Export JSON** button on the top right of the SeedMap screen which will export all selected locations to a JSON in the folder ```SeedMapper/exports/<Server IP>_<Seed>-<Date/Time>.json```.
72+
- Added **Export Xaero** button on the top right of the SeedMap screen which will export all selected locations into Xaero World Map waypoints for the server you're in. Disconnect from the server you're in and reconnect and the waypoints will appear in Xaero.
7473

75-
## Building from source
76-
This mod internally uses (a fork of) the C library [cubiomes](https://github.com/Cubitect/cubiomes) by Cubitect. Java bindings for this library were created with (also a fork of) [jextract](https://github.com/openjdk/jextract). The bindings use the [Foreign Function & Memory API](https://openjdk.org/jeps/454) from [Project Panama](https://openjdk.org/projects/panama/). See [CreateJavaBindingsTask.java](https://github.com/xpple/SeedMapper/blob/master/buildSrc/src/main/java/dev/xpple/seedmapper/buildscript/CreateJavaBindingsTask.java) for the Gradle task that automates this.
74+
### Improved ESP
75+
Configurable ESP settings allowing for custom colors, fill and transparency.
7776

78-
To build the mod locally, follow these steps:
77+
Example: ```/sm:config blockhighlightesp set outlineColor #ff0000 outlineAlpha 0.5 fillEnabled true fillColor #00ff00 fillAlpha 0.35```
7978

80-
1. Clone the repository:
81-
```shell
82-
git clone --recurse-submodules https://github.com/xpple/SeedMapper
83-
cd SeedMapper
84-
```
85-
2. Compile cubiomes to a shared library. MSVC cannot be used to build the project! The following is for Windows:
86-
```shell
87-
cd src/main/c/cubiomes
88-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
89-
cmake --build build --config Release
90-
cp build/cubiomes.dll ../../resources/cubiomes.dll
91-
cd ../../../../
92-
```
93-
3. Install LLVM (version 13.0.0 is recommended) and set the environment variable `LLVM_HOME` to the directory where LLVM was installed.
94-
4. Compile jextract. Again, the following is for Windows:
95-
```shell
96-
cd jextract
97-
./gradlew --stacktrace -Pjdk_home="$env:JAVA_HOME" -Pllvm_home="$env:LLVM_HOME" clean verify
98-
cd ../
99-
```
100-
5. Build the mod:
101-
```shell
102-
./gradlew build
103-
```
104-
You should find the Java bindings in `src/main/java/com/github/cubiomes`.
79+
![ESP](https://i.imgur.com/S9KeYpR.png)
80+
81+
### Improved Waypoints
82+
Supports [Wurst7-CevAPI](https://github.com/cev-api/Wurst7-CevAPI) waypoints, Xaero Waypoints and its own waypoint system via right click context menu.
83+
84+
Can now finally remove SeedMapper waypoints with via a right click context menu.
85+
86+
![Map](https://i.imgur.com/1qDgQw7.png)
87+
88+
### Highlight Timeout Setting
89+
Can now change the default 5 minute render timeout with ```/sm:config esptimeoutminutes```
90+
91+
### Export Loot Table
92+
Can now export the entire loot table for the map you're viewing by clicking ```Export Loot``` or via commands such as ```/sm:exportLoot <radius> [dimension] [structures/all]```.
93+
94+
Exported data will be located in ```SeedMapper/loot/<Server IP>_<Seed>-<Date/Time>.json```
10595

106-
Lastly, you can also consult the [GitHub Actions workflow file](https://github.com/xpple/SeedMapper/blob/master/.github/workflows/build.yml), which contains complete build instructions for each major OS.

src/main/java/dev/xpple/seedmapper/command/arguments/StructurePredicateArgument.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
public class StructurePredicateArgument implements ArgumentType<StructurePredicateArgument.StructureAndPredicate> {
3131

32-
private static final Collection<String> EXAMPLES = Arrays.asList("village", "end_city[end_ship]", "ruined_portal{giant=true, underground=true}", "fortress[bridge_spawner, corridor_nether_wart]");
32+
private static final Collection<String> EXAMPLES = Arrays.asList("village", "end_city_ship", "ruined_portal{giant=true, underground=true}", "fortress[bridge_spawner, corridor_nether_wart]");
3333

3434
//<editor-fold defaultstate="collapsed" desc="private static final Map<String, Integer> STRUCTURES;">
3535
private static final Map<String, Integer> STRUCTURES = ImmutableMap.<String, Integer>builder()
@@ -54,6 +54,7 @@ public class StructurePredicateArgument implements ArgumentType<StructurePredica
5454
.put("fortress", Cubiomes.Fortress())
5555
.put("bastion_remnant", Cubiomes.Bastion())
5656
.put("end_city", Cubiomes.End_City())
57+
.put("end_city_ship", Cubiomes.End_City())
5758
.put("end_gateway", Cubiomes.End_Gateway())
5859
.put("end_island", Cubiomes.End_Island())
5960
.put("trail_ruins", Cubiomes.Trail_Ruins())
@@ -105,6 +106,11 @@ public class StructurePredicateArgument implements ArgumentType<StructurePredica
105106
.build();
106107
//</editor-fold>
107108

109+
private static final int END_CITY_SHIP_PIECE = STRUCTURE_PIECES.get(Cubiomes.End_City()).get("end_ship");
110+
private static final PiecesPredicate HAS_END_SHIP = (numPieces, pieces) -> IntStream.range(0, numPieces)
111+
.mapToObj(i -> Piece.asSlice(pieces, i))
112+
.anyMatch(piece -> Piece.type(piece) == END_CITY_SHIP_PIECE);
113+
108114
//<editor-fold defaultstate="collapsed" desc="private static final Map<String, Pair<Map<String, Integer>, Function<MemorySegment, Integer>>> GENERAL_VARIANTS;">
109115
private static final Map<String, Pair<Map<String, Integer>, Function<MemorySegment, Integer>>> GENERAL_VARIANTS = ImmutableMap.<String, Pair<Map<String, Integer>, Function<MemorySegment, Integer>>>builder()
110116
.put("biome", Pair.of(BiomeArgument.BIOMES, m -> (int) StructureVariant.biome(m)))
@@ -257,6 +263,7 @@ private static final class Parser {
257263

258264
private final StringReader reader;
259265
private Consumer<SuggestionsBuilder> suggestor;
266+
private PiecesPredicate defaultPiecesPredicate = (numPieces, pieces) -> true;
260267

261268
private Parser(StringReader reader) {
262269
this.reader = reader;
@@ -265,7 +272,7 @@ private Parser(StringReader reader) {
265272
private StructureAndPredicate parse() throws CommandSyntaxException {
266273
int structure = parseStructure();
267274

268-
PiecesPredicate piecesPredicate = parsePieces(structure);
275+
PiecesPredicate piecesPredicate = this.defaultPiecesPredicate.and(parsePieces(structure));
269276

270277
VariantPredicate variantPredicate = parseVariant(structure);
271278

@@ -285,6 +292,11 @@ private int parseStructure() throws CommandSyntaxException {
285292
reader.setCursor(cursor);
286293
throw CommandExceptions.UNKNOWN_STRUCTURE_EXCEPTION.create(structureString);
287294
}
295+
if ("end_city_ship".equals(structureString)) {
296+
this.defaultPiecesPredicate = HAS_END_SHIP;
297+
} else {
298+
this.defaultPiecesPredicate = (numPieces, pieces) -> true;
299+
}
288300
return structure;
289301
}
290302

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package dev.xpple.seedmapper.seedmap;
22

3-
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
3+
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
4+
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
45
import net.minecraft.world.level.ChunkPos;
56

6-
public record ChunkStructureData(ChunkPos pos, Int2ObjectMap<StructureData> structures) {
7+
public record ChunkStructureData(ChunkPos pos, Object2ObjectMap<String, StructureData> structures) {
8+
public static ChunkStructureData create(ChunkPos pos) {
9+
return new ChunkStructureData(pos, new Object2ObjectOpenHashMap<>());
10+
}
711
}

src/main/java/dev/xpple/seedmapper/seedmap/MapFeature.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package dev.xpple.seedmapper.seedmap;
22

33
import com.github.cubiomes.Cubiomes;
4-
import com.github.cubiomes.Piece;
54
import com.github.cubiomes.StructureVariant;
65
import dev.xpple.seedmapper.SeedMapper;
7-
import dev.xpple.seedmapper.feature.StructureChecks;
86
import dev.xpple.seedmapper.util.WorldIdentifier;
97
import net.minecraft.resources.Identifier;
108

@@ -13,7 +11,6 @@
1311
import java.util.Arrays;
1412
import java.util.Map;
1513
import java.util.stream.Collectors;
16-
import java.util.stream.IntStream;
1714

1815
public enum MapFeature {
1916
DESERT_PYRAMID("desert_pyramid", Cubiomes.Desert_Pyramid(), Cubiomes.DIM_OVERWORLD(), Cubiomes.MC_1_3(), "cubiomes_viewer_icons", 19, 20),
@@ -83,21 +80,13 @@ public Texture getVariantTexture(WorldIdentifier identifier, int posX, int posZ,
8380
CANYON("canyon", -1, Cubiomes.DIM_OVERWORLD(), Cubiomes.MC_1_13(), "feature_icons", 20, 20),
8481
FORTRESS("fortress", Cubiomes.Fortress(), Cubiomes.DIM_NETHER(), Cubiomes.MC_1_0(), "cubiomes_viewer_icons", 20, 20),
8582
BASTION("bastion_remnant", Cubiomes.Bastion(), Cubiomes.DIM_NETHER(), Cubiomes.MC_1_16_1(), "cubiomes_viewer_icons", 20, 20),
86-
END_CITY("end_city", Cubiomes.End_City(), Cubiomes.DIM_END(), Cubiomes.MC_1_9(), "cubiomes_viewer_icons", 20, 20) {
87-
private static final Texture END_CITY_SHIP_TEXTURE = new Texture("end_ship", "cubiomes_viewer_icons", 20, 20);
83+
END_CITY("end_city", Cubiomes.End_City(), Cubiomes.DIM_END(), Cubiomes.MC_1_9(), "cubiomes_viewer_icons", 20, 20),
84+
END_CITY_SHIP("end_city_ship", Cubiomes.End_City(), Cubiomes.DIM_END(), Cubiomes.MC_1_9(), "cubiomes_viewer_icons", 20, 20) {
85+
private static final Texture ELYTRA_TEXTURE = new Texture("elytra", "cubiomes_viewer_icons", 20, 20);
86+
8887
@Override
89-
public Texture getVariantTexture(WorldIdentifier identifier, int posX, int posZ, int biome) {
90-
try (Arena arena = Arena.ofConfined()) {
91-
MemorySegment pieces = Piece.allocateArray(StructureChecks.MAX_END_CITY_AND_FORTRESS_PIECES, arena);
92-
int numPieces = Cubiomes.getEndCityPieces(pieces, identifier.seed(), posX >> 4, posZ >> 4);
93-
boolean hasShip = IntStream.range(0, numPieces)
94-
.mapToObj(i -> Piece.asSlice(pieces, i))
95-
.anyMatch(piece -> Piece.type(piece) == Cubiomes.END_SHIP());
96-
if (hasShip) {
97-
return END_CITY_SHIP_TEXTURE;
98-
}
99-
return super.getDefaultTexture();
100-
}
88+
public Texture getDefaultTexture() {
89+
return ELYTRA_TEXTURE;
10190
}
10291
},
10392
END_GATEWAY("end_gateway", Cubiomes.End_Gateway(), Cubiomes.DIM_END(), Cubiomes.MC_1_13(), "cubiomes_viewer_icons", 20, 20),

0 commit comments

Comments
 (0)