forked from GTNewHorizons/GT5-Unofficial
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds vein type readout to multiblock miners (GTNewHorizons#2732)
* Adds vein type readout to multiblock miners (+metrics) * Spotless, fix weird import * Downgrades VP dep to latest non-pre version * Update dependencies.gradle * Refactor to eliminate dep on VisualProspecting --------- Co-authored-by: Martin Robertz <dream-master@gmx.net>
- Loading branch information
1 parent
a9cea49
commit 278a156
Showing
6 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/gregtech/crossmod/visualprospecting/GT_VisualProspecting_Database.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package gregtech.crossmod.visualprospecting; | ||
|
||
import java.util.Optional; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
import net.minecraft.world.ChunkCoordIntPair; | ||
|
||
public class GT_VisualProspecting_Database { | ||
|
||
private static IDatabase database; | ||
|
||
@SuppressWarnings("unused") | ||
public static void registerDatabase(IDatabase aDatabase) { | ||
database = aDatabase; | ||
} | ||
|
||
public static Optional<String> getVeinName(int dimensionId, @Nullable ChunkCoordIntPair coordinates) { | ||
if (database == null || coordinates == null) { | ||
return Optional.empty(); | ||
} | ||
|
||
return database.getVeinName(dimensionId, coordinates); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/gregtech/crossmod/visualprospecting/IDatabase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package gregtech.crossmod.visualprospecting; | ||
|
||
import java.util.Optional; | ||
|
||
import net.minecraft.world.ChunkCoordIntPair; | ||
|
||
public interface IDatabase { | ||
|
||
Optional<String> getVeinName(int dimensionId, ChunkCoordIntPair coordinates); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters