OSDN Git Service

Fixes for some post *.4 issues
[automap/automap.git] / Automap / Helpers.cs
index 2aa7d3b..c217407 100644 (file)
@@ -96,7 +96,8 @@ namespace Automap
 
                public static ushort RainHeight2DMap(this IMapChunk mapChunk, int x, int y, int chunkSize = 32)
                {
-                       int index = y % chunkSize * chunkSize + x % chunkSize;
+                       //int num = posZ % this.chunksize * this.chunksize + posX % this.chunksize;
+                       int index = (y % chunkSize) * chunkSize + (x % chunkSize);
                        return mapChunk.RainHeightMap[index];
                }
 
@@ -115,7 +116,7 @@ namespace Automap
             {
 
 #if DEBUG
-                CoreApi.World.Logger.VerboseDebug(" World Blocks [Count: {0}]", CoreApi.World.Blocks.Count);
+                //CoreApi.World.Logger.VerboseDebug(" World Blocks [Count: {0}]", CoreApi.World.Blocks.Count);
 #endif
                 //If Brute force won't work; use GROOT FORCE!
                 //var theBlock = ClientApi.World.BlockAccessor.GetBlock(0);
@@ -158,7 +159,7 @@ namespace Automap
                 }
 
 #if DEBUG
-                CoreApi.World.Logger.VerboseDebug("Block gaps: {0}", emptyCount);
+                //CoreApi.World.Logger.VerboseDebug("Block gaps: {0}", emptyCount);
 #endif
             }
 
@@ -170,7 +171,12 @@ namespace Automap
                AutomapMod ownMod = ownApi.ModLoader.GetModSystem<AutomapMod>( );
                return ownMod.Mod;
                }
-                      
+
+
+               public static bool EndsWith(this AssetLocation asset, string domain, string endPath)
+               {
+               return asset.Domain.Equals(domain,StringComparison.InvariantCultureIgnoreCase) && asset.Path.EndsWith(endPath, StringComparison.InvariantCultureIgnoreCase);
+               }
     }
 }