That's one heck of a commit you've got there...

I may have got a bit behind with version control. A lot behind, in fact. Maybe I'll go back and split this sometime - then again, I probably won't. But hey, at least it's here!
This commit is contained in:
Electroblob77
2019-08-18 00:04:18 +01:00
parent 2680d02304
commit f37812be3e
1564 changed files with 47652 additions and 12984 deletions
@@ -0,0 +1,71 @@
package electroblob.wizardry.integration.antiqueatlas;
import electroblob.wizardry.Wizardry;
import hunternif.mc.atlas.api.AtlasAPI;
import hunternif.mc.atlas.registry.MarkerType;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.Loader;
/**
* This class handles all of wizardry's integration with the <i>Antique Atlas</i> mod. This class contains only the code
* that requires Antique Atlas to be loaded in order to run. Conversely, all code that requires Antique Atlas to be
* loaded is located within this class or another class in the package {@code electroblob.wizardry.integration.antiqueatlas}.
*
* @since Wizardry 4.2
* @author Electroblob
*/
public class WizardryAntiqueAtlasIntegration {
public static final String ANTIQUE_ATLAS_MOD_ID = "antiqueatlas";
private static final ResourceLocation TOWER_MARKER = new ResourceLocation(Wizardry.MODID, "wizard_tower");
private static final ResourceLocation SHRINE_MARKER = new ResourceLocation(Wizardry.MODID, "shrine");
private static final ResourceLocation OBELISK_MARKER = new ResourceLocation(Wizardry.MODID, "obelisk");
private static boolean antiqueAtlasLoaded;
public static void init(){
antiqueAtlasLoaded = Loader.isModLoaded(ANTIQUE_ATLAS_MOD_ID);
Wizardry.proxy.registerAtlasMarkers(); // Needs routing through the proxies to make sure it's only client-side
}
public static boolean enabled(){
return Wizardry.settings.antiqueAtlasIntegration && antiqueAtlasLoaded;
}
/** Places a global wizard tower marker in all antique atlases at the given coordinates in the given world if
* {@link electroblob.wizardry.Settings#autoTowerMarkers} is enabled. Server side only! */
public static void markTower(World world, int x, int z){
if(enabled() && Wizardry.settings.autoTowerMarkers){
AtlasAPI.getMarkerAPI().putGlobalMarker(world, false, TOWER_MARKER.toString(), "integration.antiqueatlas.marker." + TOWER_MARKER.toString(), x, z);
}
}
/** Places a global obelisk marker in all antique atlases at the given coordinates in the given world if
* {@link electroblob.wizardry.Settings#autoObeliskMarkers} is enabled. Server side only! */
public static void markObelisk(World world, int x, int z){
if(enabled() && Wizardry.settings.autoObeliskMarkers){
AtlasAPI.getMarkerAPI().putGlobalMarker(world, false, OBELISK_MARKER.toString(), "integration.antiqueatlas.marker." + OBELISK_MARKER.toString(), x, z);
}
}
/** Places a global shrine marker in all antique atlases at the given coordinates in the given world if
* {@link electroblob.wizardry.Settings#autoShrineMarkers} is enabled. Server side only! */
public static void markShrine(World world, int x, int z){
if(enabled() && Wizardry.settings.autoShrineMarkers){
AtlasAPI.getMarkerAPI().putGlobalMarker(world, false, SHRINE_MARKER.toString(), "integration.antiqueatlas.marker." + SHRINE_MARKER.toString(), x, z);
}
}
/** Registers the marker icons with Antique Atlas. Client side only! */
public static void registerMarkers(){
if(!enabled()) return;
AtlasAPI.getMarkerAPI().registerMarker(new MarkerType(TOWER_MARKER, new ResourceLocation(Wizardry.MODID, "textures/integration/antiqueatlas/wizard_tower.png")));
AtlasAPI.getMarkerAPI().registerMarker(new MarkerType(SHRINE_MARKER, new ResourceLocation(Wizardry.MODID, "textures/integration/antiqueatlas/shrine.png")));
AtlasAPI.getMarkerAPI().registerMarker(new MarkerType(OBELISK_MARKER, new ResourceLocation(Wizardry.MODID, "textures/integration/antiqueatlas/obelisk.png")));
}
}