Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
2cf96e1
Merge pull request #9 from SinTh0r4s/master
Dream-Master Jan 3, 2022
c2fda57
Merge branch 'SinTh0r4s:master' into master
Dream-Master Jan 3, 2022
663acf8
Merge branch 'SinTh0r4s:master' into master
Dream-Master Jan 10, 2022
52b9812
Merge branch 'SinTh0r4s:master' into master
Dream-Master Jan 27, 2022
e81976e
Updatebuild (#10)
bombcar Feb 8, 2022
5dc6709
updated dependencies (#11)
bombcar Feb 9, 2022
c2b1f0d
Update repositories.gradle
Dream-Master Apr 14, 2022
8cf5ac9
Add a dirty chunks overlay for debugging misbehaving mods (#12)
eigenraven Apr 24, 2022
ce214b4
Update zh_CN.lang (#14)
Kiwi233 Jun 4, 2022
65b9b81
Add a command to redo GT vein cache (#13)
MuXiu1997 Jun 6, 2022
c4d3e6f
Use Regex in vein search (#15)
slprime Jun 25, 2022
47eeb44
[ci skip] Migrate github actions to GTNH-Actions-Workflows
mitchej123 Jul 16, 2022
8e990d8
Fix fullscreen map not opening (#18)
chochem Aug 8, 2022
7d58b05
Add back dimension info on book (#16)
miozune Aug 9, 2022
d7d444a
Fix prospection triggered on wrong dimension (#19)
miozune Aug 12, 2022
193cd35
Performance improvements and lower memory usage (#20)
eigenraven Sep 11, 2022
17911b1
Save fluids by name instead of ID (#21)
eigenraven Oct 3, 2022
2c42c1b
Remove IFU mixin, now uses a native integration (#22)
mitchej123 Oct 12, 2022
07de40d
Update BuildScript (#23)
dipo33 Nov 20, 2022
29f5d04
Fix Xaero's map issues: (#25)
kumquat-ir Jan 4, 2023
b1bb9c6
[ci skip] Update buildscript to RetroFuturaGradle
mitchej123 Jan 29, 2023
9d48150
[ci skip] spotlessApply with the new settings
mitchej123 Jan 29, 2023
7ca8324
[ci skip] Add git-blame-ignore-revs for spotlessApply
mitchej123 Jan 29, 2023
36ed2f6
[ci skip] upgraded build system
eigenraven Jan 31, 2023
7f0352e
[After Stable] Mixin rework (#27)
Alexdoru Mar 19, 2023
d3b7e19
Better english translation for depleted veins (#28)
chochem Apr 23, 2023
68bb4aa
Update dependencies.gradle
Dream-Master May 12, 2023
062d413
Bs+sa (#29)
Dream-Master May 13, 2023
3ae7b85
Check for null NBT tag in Written Book mixin (#31)
wlhlm May 17, 2023
a318c50
new ore mixes (#32)
chochem May 20, 2023
34dbe2f
Added hotkeys to toggle map overlays (#33)
PolkageistHS Jun 2, 2023
bbd1678
Adjust vp to fixed gt oregen (#35)
chochem Jul 4, 2023
00efcc4
Fix !visualprospectingnearspawn (#30)
ah-OOG-ah Jul 10, 2023
d22b807
dont nuke the cache if it already has data when initialized
kumquat-ir Jul 23, 2023
966d4ff
Update buildscript
glowredman Jul 27, 2023
afd991b
Small cleanup
glowredman Jul 27, 2023
388ed14
Use PlayerLoggedInEvent instead of EntityJoinWorldEvent
glowredman Jul 27, 2023
3c6bb6a
Minor cleanup (#38)
miozune Sep 23, 2023
a4e4e3d
update bs+deps
Dream-Master Sep 23, 2023
0495d84
Networking Refactor (#40)
Rune580 Dec 3, 2023
10d0735
update gradle+bs+deps
Dream-Master Dec 3, 2023
69a9c85
[ci skip] upgraded build system
eigenraven Jan 8, 2024
660eb11
update bs+deps
Dream-Master Jan 9, 2024
db32318
Reposition VP buttons on Xaero's Worldmap (#41)
Caedis Jan 20, 2024
0ef6b49
update bs+deps
Dream-Master Jan 20, 2024
6aac367
[ci skip] upgraded build system
eigenraven Feb 4, 2024
2c938cd
show empty fluid fields and center label (#42)
Lyfts Feb 10, 2024
b1a0520
update
Dream-Master Feb 10, 2024
30ad316
allow layers to do actions outside rendered drawsteps (#43)
Lyfts Feb 14, 2024
8cfc46e
update
Dream-Master Feb 14, 2024
7e639c6
Fix mytryl and quantium vein names (#45)
chochem Apr 21, 2024
cb91f82
Switch to deobf-modrinth maven for JM dep (#44)
ah-OOG-ah Apr 22, 2024
f975f73
update
Dream-Master Apr 22, 2024
4e0bf91
Post-mergening cleanup + fix oops (#46)
ah-OOG-ah Jun 15, 2024
8053e6c
Fix Scaling of GT Ore Veins and TC Nodes on Journeymap (#47)
Caedis Jun 30, 2024
e885a5b
remove gt recipe from vp (moved to nhcoremod) (#48)
chochem Jul 9, 2024
e482c86
update
Dream-Master Jul 9, 2024
3b503ab
Fix issue with Xaero's minimap and the layers not being scaled correc…
Caedis Jul 12, 2024
863b783
update
Dream-Master Jul 14, 2024
9c920e0
Migrate to Navigator api (#50)
Lyfts Jul 20, 2024
32bc112
update
Dream-Master Jul 20, 2024
be71d9f
Implements shim for the GT5U ore vein database to serve VP's ore info…
querns Jul 30, 2024
a2cd53d
update
Dream-Master Jul 30, 2024
c62fcb9
bump gt, fix rename (#53)
NotAPenguin0 Sep 3, 2024
091dddd
update
Dream-Master Sep 3, 2024
bae9fb8
Convert to universal Navigator layers (#52)
Lyfts Sep 7, 2024
e343eb2
update
Dream-Master Sep 7, 2024
e927d4c
Optimization & cleanup (#54)
Lyfts Sep 15, 2024
7dbc66d
update
Dream-Master Sep 16, 2024
0c3ace2
More optimization & bug fixes (#55)
Lyfts Sep 20, 2024
3a9161e
Fix veins differing between server and clients (#57)
Lyfts Sep 22, 2024
579e905
update
Dream-Master Sep 23, 2024
640dd6d
add NEI hotkeys support when mouse over ore vein (#58)
Dmetriy-MC Sep 25, 2024
4073835
update
Dream-Master Sep 25, 2024
0cab19d
yet another fix for !visualprospectingnearspawn (#59)
Lyfts Sep 27, 2024
3c1ba04
update
Dream-Master Sep 27, 2024
5b56eb3
Use gt5u localized ore mix names (#60)
Lyfts Sep 28, 2024
4af527b
Fix client cache being removed after changing username (#61)
Lyfts Sep 30, 2024
a7f49b2
update
Dream-Master Sep 30, 2024
e494973
Save vein cache using IO thread (#63)
Lyfts Jan 10, 2025
b260e56
Save ore veins with their string id (#62)
Lyfts Jan 11, 2025
065f309
update
Dream-Master Jan 11, 2025
cdcc460
Highlight searched underground fluids (#64)
Lyfts Feb 19, 2025
1e72824
update
serenibyss Feb 19, 2025
cab6153
Remove old GT5 compat (#67)
serenibyss May 15, 2025
417453c
Add search bar for highlighting veins/fluids in map ui (#66)
Lyfts May 15, 2025
2bb4425
update
Dream-Master May 16, 2025
511fe4a
Convert to new IMixins and MixinsBuilder system (#69)
Alexdoru Jul 14, 2025
007cce0
remove hard dep on BWColorUtil (#68)
Alexdoru Jul 16, 2025
c481df7
upd(render): add support for ore icon overlay (#70)
leagris Aug 6, 2025
31b97bf
update
Dream-Master Aug 8, 2025
24155a4
optimize save/load methods in DimensionCache for ores and fluids (#72)
alppp Aug 26, 2025
1d4e784
german translation (#71)
2ndDerivative Aug 28, 2025
e586b3f
update
Dream-Master Aug 28, 2025
c59335b
update
Dream-Master Oct 1, 2025
7736c12
Refactors for GT ore refactor PR (#65)
RecursivePineapple Oct 12, 2025
8509322
update
Dream-Master Oct 15, 2025
d2b834e
Fix CME when filling in Prospector's Log in singleplayer (#74)
wlhlm Oct 15, 2025
2176b5d
Prospect when mined (#75)
RecursivePineapple Oct 17, 2025
4afb81c
update
Dream-Master Oct 17, 2025
04895af
update
Dream-Master Oct 17, 2025
afcd230
Fix GT oreprefix call (#76)
chochem Oct 25, 2025
10955fe
Fix Prospector's Log packet size overflow (#73)
wlhlm Oct 27, 2025
bff58a8
update
Dream-Master Oct 28, 2025
019e86c
Fix ores being unscannable in spawn chunks, and incorrect cache-rebui…
C0bra5 Feb 12, 2026
9db7a63
update gradle+bs+deps
Dream-Master Feb 13, 2026
d5b56e5
Update GT5-Unofficial dependency version
Dream-Master Feb 28, 2026
47bc90a
Replace MTEScanner mixin with handler for scanner refactor PR (#77)
C0bra5 Feb 28, 2026
5179f79
update
Dream-Master Feb 28, 2026
6cc1893
[Sub-PR] Reduce the size of the GregTech.lang, and standardize the Li…
iouter Mar 28, 2026
b69131b
update+gradle+deps+bs
Dream-Master Apr 3, 2026
5febeee
Prevent crash when search input is an invalid regex pattern (#80)
Algent Apr 16, 2026
4d639b7
Optimize Images & Workflow (#81)
UltraProdigy Apr 26, 2026
3dc0de6
Add cleanup of VP files on WorldDeletionEvent (#82)
Algent May 14, 2026
219adc5
Fix registering vein on VeinGenerateEvent (#83)
Algent May 15, 2026
bd76fc5
Add team sharing of players prospection findings using GTNHLib Teams …
Algent May 25, 2026
441d288
Add compatibility with EndlessIds to redo server cache command (#84)
assusdan May 25, 2026
d03db5c
Rework server and client cache into a more optimized system (#87)
Algent May 27, 2026
2bce182
Add admin command to upload client cache into your team (#88)
Algent May 28, 2026
e1a71cc
Attempt at improving performance of vein/fluid layer in map (#89)
Algent May 30, 2026
5a44809
Few more changes to fluid overlay (#90)
Algent Jun 6, 2026
6d5332c
Rewrote most logic behind /vp_recache (reconstruct server cache by sc…
Algent Jun 7, 2026
d37b199
Refactor VPs server side commands to Brigadier (#91)
Algent Jun 12, 2026
4e7f339
update+bs+deps+gradle
Dream-Master Jun 12, 2026
6dd8267
Show ore vein in JM with right colors and a background matching the d…
Algent Jun 15, 2026
031672c
Adapt to GT5u change (#95)
Kogepan229 Jun 28, 2026
34c3d7c
Add NEI style search modes to ore overlay (#94)
Algent Jun 28, 2026
9b99427
Show more clear indicator on overlay for what fluid amount mean (#96)
Algent Jul 4, 2026
61e2463
update deps
Dream-Master Jul 4, 2026
561a33f
Guard against null/fake player (Fix Log spam) (#97)
Algent Jul 9, 2026
74c32ff
Fix incorrect oregen pattern being used in some case. Attempt to auto…
Algent Jul 12, 2026
77f8034
Fix Xaeros culling regression (#101)
Algent Jul 18, 2026
c2779a6
Relax a little bit the cache fallback command (#103)
Algent Jul 26, 2026
8c1b878
JourneyMap 6 support for ore and fluid overlays (#104)
Algent Jul 29, 2026
0221c74
Improve Undergroundfluid icon (#105)
Algent Aug 11, 2026
12482c0
Update Default Minimum Zoom Levels
DylanTaylor1 Sep 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore spotlessApply reformat
9d48150e57e46c8df16822acee58f6f36dcdc91a
44 changes: 44 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
* text eol=lf

*.[jJ][aA][rR] binary

*.[pP][nN][gG] binary
*.[jJ][pP][gG] binary
*.[jJ][pP][eE][gG] binary
*.[gG][iI][fF] binary
*.[tT][iI][fF] binary
*.[tT][iI][fF][fF] binary
*.[iI][cC][oO] binary
*.[sS][vV][gG] text
*.[eE][pP][sS] binary
*.[xX][cC][fF] binary

*.[kK][aA][rR] binary
*.[mM]4[aA] binary
*.[mM][iI][dD] binary
*.[mM][iI][dD][iI] binary
*.[mM][pP]3 binary
*.[oO][gG][gG] binary
*.[rR][aA] binary

*.7[zZ] binary
*.[gG][zZ] binary
*.[tT][aA][rR] binary
*.[tT][gG][zZ] binary
*.[zZ][iI][pP] binary

*.[tT][cC][nN] binary
*.[sS][oO] binary
*.[dD][lL][lL] binary
*.[dD][yY][lL][iI][bB] binary
*.[pP][sS][dD] binary
*.[tT][tT][fF] binary
*.[oO][tT][fF] binary

*.[pP][aA][tT][cC][hH] -text

*.[bB][aA][tT] text eol=crlf
*.[cC][mM][dD] text eol=crlf
*.[pP][sS]1 text eol=crlf

*[aA][uU][tT][oO][gG][eE][nN][eE][rR][aA][tT][eE][dD]* binary
9 changes: 0 additions & 9 deletions .github/scripts/test-no-crash-reports.sh

This file was deleted.

36 changes: 2 additions & 34 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Build and test

Expand All @@ -11,35 +9,5 @@ on:

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Setup the workspace
run: ./gradlew setupCIWorkspace

- name: Build the mod
run: ./gradlew build

- name: Run server for 1 minute
run: |
mkdir run
echo "eula=true" > run/eula.txt
timeout 60 ./gradlew runServer || true

- name: Test no crashes happend
run: |
chmod +x .github/scripts/test-no-crash-reports.sh
.github/scripts/test-no-crash-reports.sh
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/build-and-test.yml@master
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/optimize-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Optimize images

on:
pull_request:
branches: [ master, main, release/** ]
paths:
- "**/*.png"

push:
branches: [ master, main, release/** ]
paths:
- "**/*.png"

jobs:
optimize-images:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/optimize-images.yml@master
secrets: inherit
45 changes: 7 additions & 38 deletions .github/workflows/release-tags.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,14 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Release tagged build

on:
push:
tags:
- '*'
tags: [ '*' ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
permissions:
contents: write

- name: Setup the workspace
run: ./gradlew setupCIWorkspace

- name: Build the mod
run: ./gradlew build

- name: Release under current tag
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "${{ env.RELEASE_VERSION }}"
files: build/libs/*.jar
jobs:
release-tags:
uses: GTNewHorizons/GTNH-Actions-Workflows/.github/workflows/release-tags.yml@master
secrets: inherit
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ whitelist.json
*.ipr
*.iws
src/main/resources/mixins.*.json
dependencies/voxelmap*.jar
/data/
*.bat
*.DS_Store
!gradlew.bat
layout.json
Binary file removed BON2-2.5.0.CUSTOM-all.jar
Binary file not shown.
3 changes: 3 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Any Github changes require admin approval
/.github/** @GTNewHorizons/admin

144 changes: 27 additions & 117 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This mod is intended for player convenience, but may also be used as API, since it provides the location of all GT ore veins in a cache. VisualProspecting tracks all GT Ore Veins a player has found and visualizes them in JourneyMap and/or XaeroWorldMap (optional, if installed). It also visualizes tracked Thaumcraft aura nodes if TCNodeTracker if installed. VoxelMap will add waypoints for prospected ore veins and fluids.

VisualProspecting tracks all ores that a player interacted with, by right or by left click. It also integrates prospecting data from GTs _Advanced Seismic Prospector_, although only books that are created after this mod was added will provide integration.
You may share your findings with other players by crafting a _Prospector's Log_.
You may share your findings with other players by crafting a _Prospector's Log_, or automatically with your GTNHLib team (see [Team Sharing](#team-sharing)).

This mod is tailored to _GregTech: New Horizons 2_, but feel free to use it however you like. Even though this mod is build against the custom GT5U from GT:NH, it should still work fine with other GT5U versions.

Expand Down Expand Up @@ -44,6 +44,17 @@ _Thaumcraft aura nodes in JourneyMap overlay. You may double-click an aura node
_Thaumcraft aura nodes in XaeroWorldMap overlay_
</details>

### Team Sharing

If you belong to a [GTNHLib](https://github.com/GTNewHorizons/GTNHLib) team, all prospection findings (ore veins, underground fluids, vein-depletion toggles) are automatically shared with online team members, and replayed to teammates when they next log in. This replaces the standalone _SharedProspecting_ mod.

Disable via `B:enableTeamSharing=false` in `config/visualprospecting.cfg`.

Admin commands:
- `/vp_team_info [player] [detailed]`: inspect a team's prospection record.
- `/vp_team_clear <player>`: wipe a team's server-side prospection record (op/console).
- `/vp_team_upload <player>`: Push a player's local cache into their team's record (op/console).

### Reset Progress

You may use JourneyMap's Actions Menu to achieve this or type `/visualprospectingresetprogress` in chat. Beware, there are no backups! Please use at your own risk.
Expand All @@ -54,13 +65,27 @@ Does VisualProspecting run with other maps? - I runs just fine, but it has no vi
- [TheLastKumquat](https://github.com/kumquat-ir) integrated XaeroWorldMap and XaeroMiniMap
- [glowredman](https://github.com/glowredman) integrated VoxelMap

### Developer overlays

VisualProspecting comes with developer overlays for debugging chunk saving issues, to activate it change the following config setting in `config/visualprospecting.cfg` to true:

```
B:enableDeveloperOverlays=true
```

The dirty chunk overlay works only in singleplayer mode in JourneyMap, and displays which chunks are marked as "dirty" in the game engine.
This can be used to debug mods that don't set this flag properly and therefore lose data or duplicate items on world load/unload.

![Dirty chunks in JourneyMap developer overlay](https://i.ibb.co/XX1hqS5/2022-03-30-18-06-56.png) \
_Dirty chunks in JourneyMap developer overlay_

### Dependencies

#### Required Mods:
- Minecraft Forge
- Injected class: [_ItemEditableBook_](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/mixins/minecraft/ItemEditableBookMixin.java)
- [GregTech5-Unofficial](https://github.com/GTNewHorizons/GT5-Unofficial)
- Injected classes: [_GT_Block_Ores_Abstract_](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/mixins/gregtech/GT_Block_Ores_AbstractMixin.java), [_GT_MetaTileEntity_AdvSeismicProspector_](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/mixins/gregtech/GT_MetaTileEntity_AdvSeismicProspectorMixin.java), [_GT_MetaTileEntity_Scanner_](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/mixins/gregtech/GT_MetaTileEntity_ScannerMixin.java), [_GT_Worldgenerator.WorldGenContainer_](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/mixins/gregtech/WorldGenContainerMixin.java)
- Injected classes: [_GT_MetaTileEntity_AdvSeismicProspector_](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/mixins/gregtech/MTEAdvSeismicProspectorMixin.java), [_GT_MetaTileEntity_Scanner_](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/mixins/gregtech/MTEScannerMixin.java)
- [SpongeMixins](https://github.com/GTNewHorizons/SpongeMixins)
- [Enklumne](https://github.com/Hugobros3/Enklume) _by Hugobros3_
- Automatically shipped. No manual handling is required.
Expand Down Expand Up @@ -161,120 +186,5 @@ if(world.isRemote == false) {
}
```

#### JourneyMap Custom Layer

VisualProspecting provides a light-weight API for custom and interactive layers. This API will keep all maps as optional mod at runtime and not crash you game if it is missing. You may instantiate [`ButtonManager`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/model/buttons/ButtonManager.java) to create your own logical button. Follow it up with an instance of [`LayerButton`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/journeymap/buttons/LayerButton.java) and register both in the [`VisualProspecting_API`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/VisualProspecting_API.java):

```
ButtonManager buttonManager = new ButtonManager("translation.key", "iconName");
LayerButton layerButton = new LayerButton(buttonManager);

VisualProspecting_API.LogicalClient.registerCustomButtonManager(buttonManager);
VisualProspecting_API.LogicalClient.registerJourneyMapButton(layerButton);
```

If you start the game now, you will see a new button in the menu!

First, you will implement [`ILocationProvider`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/model/locations/ILocationProvider.java). This class is a container and will provide all information required to display your item on screen. It won't do any rendering.

```
class MyLocation implements ILocationProvider {

public int getDimensionId() {
return 0; // overworld
}

public int getBlockX() {
return 0;
}

public int getBlockY() {
return 65;
}

public int getBlockZ() {
return 0;
}

public String getLabel() {
return "Hello Minecraft";
}
}
```

Next up, you'll extend [`LayerManager`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/model/layers/LayerManager.java) and implement the abstract function to generate cached List of your [`ILocationProvider`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/model/locations/ILocationProvider.java) implementation. You should only add whatever items are visible to this list. There are more methods to override, that will assist you with that. Take a look!

```
class MyLayerManager extends LayerManager {

public static final MyLayerManager instance = new MyLayerManager();

public MyLayerManager() {
super(buttonManager);
}

protected List<? extends ILocationProvider> generateVisibleElements(int minBlockX, int minBlockZ, int maxBlockX, int maxBlockZ) {
return Collections.singletonList(new MyLocation);
}
}
```

You have finished the logical implementation of your custom map layer. Congratulations! Now it is time for the visual integration into the map. This example is provided for JourneyMap, but you might as well take a look at the other possibilities. Since you already implemented the button as a first step, you will need to follow it up with an implementation of `DrawStep`, an interface from JourneyMap. This class will receive an instance of `MyLocation` and perform the actual rendering.

```
class MyDrawStep implements DrawStep {

private final MyLocation myLocation;

public MyDrawStep(MyLocation myLocation) {
this.myLocation = myLocation;
}

@Override
public void draw(double draggedPixelX, double draggedPixelY, GridRenderer gridRenderer, float drawScale, double fontScale, double rotation) {
final double blockSize = Math.pow(2, gridRenderer.getZoom());
final Point2D.Double blockAsPixel = gridRenderer.getBlockPixelInGrid(myLocation.getBlockX(), myLocation.getBlockZ());
final Point2D.Double pixel = new Point2D.Double(blockAsPixel.getX() + draggedPixelX, blockAsPixel.getY() + draggedPixelY);

DrawUtil.drawLabel(myLocation.getText(), pixel.getX(), pixel.getY(), DrawUtil.HAlign.Center, DrawUtil.VAlign.Middle, 0, 180, 0x00FFFFFF, 255, fontScale, false, rotation);
}
}
```

Continue with your own implementation of [`LayerRenderer`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/journeymap/render/LayerRenderer.java). This class will cache all `DrawStep`s and provide it to JourneyMap whenever it is time to render.

```
class MyLayerRenderer extends LayerRenderer {

public MyLayerRenderer() {
// You may skip MyLayerManager and use an existing ButtonManager like "OreVeinLayerManager.instance"
// Your custom layer will toggle with whatever button you specify here
super(MyLayerManager.instance);
}

@Override
public List<? extends ClickableDrawStep> mapLocationProviderToDrawStep(List<? extends ILocationProvider> visibleElements) {
final List<MyDrawStep> drawSteps = new ArrayList<>();
visibleElements.stream()
.map(element -> (MyLocation) element)
.forEach(location -> drawSteps.add(new MyDrawStep(location)));
return drawSteps;
}

}
```

That's already it! Now you need to register some of these classes. Forge's postInit is a good place for it:

```
VisualProspecting_API.LogicalClient.registerCustomLayer(MyLayerManager.instance);
VisualProspecting_API.LogicalClient.registerJourneyMapRenderer(new MyLayerRenderer());
```

Now you need to launch Minecraft, teleport to the right sport (`/tp 0 80 0`) and open JourneyMap.

If you want to extend support for your layer in other maps as well you already have half the work done. You just need to add implementations for the layer and element renderer. \
For interactive layers you may take a look at extensions/implementations of [`WaypointProviderManager`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/model/layers/WaypointProviderManager.java) and [`ClickableDrawStep`](https://github.com/SinTh0r4s/VisualProspecting/blob/master/src/main/java/com/sinthoras/visualprospecting/gui/journeymap/drawsteps/ClickableDrawStep.java) to get a head start.

Thank you and happy coding,\
SinTh0r4s
Loading