diff --git a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java index b0859079..e9839150 100644 --- a/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java +++ b/DynmapCore/src/main/java/org/dynmap/hdmap/HDBlockModels.java @@ -188,7 +188,7 @@ public class HDBlockModels { /* Check mods to see if model files defined there: do these first, as they trump other sources */ for (String modid : core.getServer().getModList()) { File f = core.getServer().getModContainerFile(modid); // Get mod file - if (f.isFile()) { + if ((f != null) && f.isFile()) { zf = null; in = null; try { diff --git a/forge-1.10.2/build.gradle b/forge-1.10.2/build.gradle index cee9c0cd..c7e3e6a4 100644 --- a/forge-1.10.2/build.gradle +++ b/forge-1.10.2/build.gradle @@ -17,6 +17,8 @@ apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile project(path: ":DynmapCore", configuration: "shadow") + compile 'com.googlecode.json-simple:json-simple:1.1.1' + compile 'org.yaml:snakeyaml:1.23' } sourceCompatibility = 1.8 diff --git a/forge-1.11.2/build.gradle b/forge-1.11.2/build.gradle index d06f2882..e05a9f96 100644 --- a/forge-1.11.2/build.gradle +++ b/forge-1.11.2/build.gradle @@ -17,6 +17,8 @@ apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile project(path: ":DynmapCore", configuration: "shadow") + compile 'com.googlecode.json-simple:json-simple:1.1.1' + compile 'org.yaml:snakeyaml:1.23' } sourceCompatibility = 1.8 diff --git a/forge-1.12.2/build.gradle b/forge-1.12.2/build.gradle index cfc57615..18ee1d45 100644 --- a/forge-1.12.2/build.gradle +++ b/forge-1.12.2/build.gradle @@ -1,10 +1,8 @@ buildscript { repositories { + maven { url = 'https://files.minecraftforge.net/maven' } jcenter() - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } + mavenCentral() maven {url = "https://oss.sonatype.org/content/repositories/snapshots/"} } dependencies { @@ -17,6 +15,8 @@ apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile project(path: ":DynmapCore", configuration: "shadow") + compile 'com.googlecode.json-simple:json-simple:1.1.1' + compile 'org.yaml:snakeyaml:1.23' } sourceCompatibility = 1.8 diff --git a/forge-1.13.2/build.gradle b/forge-1.13.2/build.gradle index 97421585..892d5273 100644 --- a/forge-1.13.2/build.gradle +++ b/forge-1.13.2/build.gradle @@ -1,10 +1,8 @@ buildscript { repositories { + maven { url = 'https://files.minecraftforge.net/maven' } jcenter() - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } + mavenCentral() maven {url = "https://oss.sonatype.org/content/repositories/snapshots/"} } dependencies { diff --git a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapMod.java b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapMod.java index c749db92..0e20cf76 100644 --- a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapMod.java +++ b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapMod.java @@ -2,7 +2,7 @@ package org.dynmap.forge_1_13_2; import java.io.File; -import org.dynmap.DynmapCommonAPI; +import org.dynmap.DynmapCommonAPI; import org.dynmap.DynmapCommonAPIListener; import org.dynmap.Log; import org.dynmap.forge_1_13_2.DynmapPlugin.OurLog; @@ -12,6 +12,7 @@ import net.minecraftforge.fml.common.Mod; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.DistExecutor; +import net.minecraftforge.fml.ModList; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent; import net.minecraftforge.fml.event.server.FMLServerStartingEvent; @@ -71,7 +72,7 @@ public class DynmapMod public void setup(final FMLCommonSetupEvent event) { //TOOO - //jarfile = event.getSourceFile(); + jarfile = ModList.get().getModFileById("dynmap").getFile().getFilePath().toFile(); //// Load configuration file - use suggested (config/WesterosBlocks.cfg) //Configuration cfg = new Configuration(event.getSuggestedConfigurationFile()); //try { diff --git a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java index 9abce155..7760415c 100644 --- a/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java +++ b/forge-1.13.2/src/main/java/org/dynmap/forge_1_13_2/DynmapPlugin.java @@ -177,7 +177,7 @@ public class DynmapPlugin * Initialize block states (org.dynmap.blockstate.DynmapBlockState) */ public void initializeBlockStates() { - stateByID = new DynmapBlockState[512*16]; // Simple map - scale as needed + stateByID = new DynmapBlockState[512*32]; // Simple map - scale as needed Arrays.fill(stateByID, DynmapBlockState.AIR); // Default to air ObjectIntIdentityMap bsids = Block.BLOCK_STATE_IDS; @@ -198,15 +198,16 @@ public class DynmapPlugin Block b = bs.getBlock(); // If this is new block vs last, it's the base block state if (b != baseb) { - basebs = b; - baseidx = idx; + basebs = null; + baseidx = idx; + baseb = b; } ResourceLocation ui = b.getRegistryName(); if (ui == null) { continue; } - String bn = ui.getNamespace() + ":" + ui.getPath(); + String bn = ui.getNamespace() + ":" + ui.getPath(); // Only do defined names, and not "air" if (!bn.equals(DynmapBlockState.AIR_BLOCK)) { Material mat = bs.getMaterial(); @@ -217,8 +218,10 @@ public class DynmapPlugin } statename += p.getName() + "=" + bs.get(p).toString(); } + //Log.info("bn=" + bn + ", statenme=" + statename + ",idx=" + idx + ",baseidx=" + baseidx); DynmapBlockState dbs = new DynmapBlockState(basebs, idx - baseidx, bn, statename, mat.toString(), idx); stateByID[idx] = dbs; + if (basebs == null) { basebs = dbs; } if (mat.isSolid()) { dbs.setSolid(); } @@ -235,7 +238,7 @@ public class DynmapPlugin } for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) { DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx); - Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex); + //Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex); } } @@ -1008,8 +1011,11 @@ public class DynmapPlugin public File getModContainerFile(String name) { ModFileInfo mfi = ModList.get().getModFileById(name); // Try case sensitive lookup if (mfi != null) { - return mfi.getFile().getFilePath().toFile(); + File f = mfi.getFile().getFilePath().toFile(); + Log.info("getModContainferFile(" + name + ")=" + f.getAbsolutePath()); + return f; } + Log.info("getModContainferFile(" + name + ")=null"); return null; } @Override diff --git a/forge-1.8.9/build.gradle b/forge-1.8.9/build.gradle index 05080090..d7994f80 100644 --- a/forge-1.8.9/build.gradle +++ b/forge-1.8.9/build.gradle @@ -17,6 +17,8 @@ apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile project(path: ":DynmapCore", configuration: "shadow") + compile 'com.googlecode.json-simple:json-simple:1.1.1' + compile 'org.yaml:snakeyaml:1.23' } sourceCompatibility = 1.8 diff --git a/forge-1.9.4/build.gradle b/forge-1.9.4/build.gradle index b57e0f5d..c18fdd94 100644 --- a/forge-1.9.4/build.gradle +++ b/forge-1.9.4/build.gradle @@ -17,6 +17,8 @@ apply plugin: 'com.github.johnrengelman.shadow' dependencies { compile project(path: ":DynmapCore", configuration: "shadow") + compile 'com.googlecode.json-simple:json-simple:1.1.1' + compile 'org.yaml:snakeyaml:1.23' } sourceCompatibility = 1.8