Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

Resources not found *Fixed* [MC 1.10.2] [Dynmap 3] #75

Open
ChubbyPitbull opened this issue Feb 19, 2018 · 0 comments
Open

Resources not found *Fixed* [MC 1.10.2] [Dynmap 3] #75

ChubbyPitbull opened this issue Feb 19, 2018 · 0 comments

Comments

@ChubbyPitbull
Copy link

ChubbyPitbull commented Feb 19, 2018

While using the latest version of Dynmap that included the fix from #74, I was trying to build a new building out of Advanced Rocketry's concrete when I observed the blocks were not being rendered in Dynmap. I noticed that while most mods and blocks were working, I was still getting numerous "Resources for mod not found" errors. These typically also seemed to come from only a few mods such as Advanced Rocketery, libVulpes, Botania, Blood Magic, etc.

Based on @mikeprimm's comments here webbukkit/DynmapBlockScan#4 (comment), it sounded like it was another artifact of the backport to 1.10.2 due to the case sensitivity differences, and that does appear to be the case.

Fixing the issue required adding case-insensitive fallbacks in two parts, one in DynmapCore and one in DynmapForge. First, in DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackLoader.java::openModTPResource -

ZipEntry ze = zf.getEntry(rname);
                if(ze == null)
                {
                    //Fallback to Case Insensitive Search
                    Enumeration entries = zf.entries();
                    while(entries.hasMoreElements())
                    {
                        ZipEntry entry = (ZipEntry)entries.nextElement();
                        if(rname.equalsIgnoreCase(entry.getName()))
                        {
                            Log.warning("Matched "+rname+" to "+entry.getName()+".");
                            rname = entry.getName();
                            ze = zf.getEntry(rname);
                            break;
                        }
                    }
                }

This change was also needed a second time in the same function for the "Load Resource from Mod/JAR" fall-through section.

The second change was in DynmapForge, at DynmapForge/src/main/java/org/dynmap/forge/DynmapPlugin.java::getModContainerFile , and that fix was as simple as copying in @mikeprimm 's changes for #74 to this new function:

Map<String, ModContainer> list = Loader.instance().getIndexedModList();
            ModContainer mod = list.get(name);    // Try case sensitive lookup
            if (mod == null) {
                for (Entry<String, ModContainer> ent : list.entrySet()) {
                    if (ent.getKey().equalsIgnoreCase(name)) {
                        Log.warning("Matched "+name+" to "+ent.getKey()+".");
                        mod = ent.getValue();
                        break;
                    }
                }
            }
            if (mod == null) return null;
            return mod.getSource();

I built a dev version of the mod with hose changes, and it now appears that all missing textures errors I was getting (except for BloodMagic's empty.png) have no been fixed.

@mikeprimm, is it ok that I post these as issues here? If I ever have anymore of these would you prefer having them reported by another method?

FML Server Log Excerpt with errors:
fml-server-latest_ERRORS-excerpt.txt

FML Server Log Excerpt after changes ("2" logs are coming from the "Load Resource from Mod/JAR" fall-through section of DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackLoader.java::openModTPResource:
fml-server-latest_FIXED-excerpt.txt

Screenshot of AdvancedRocketry Concrete blocks before/after fix:
noarconcreteconcrete

Roots altar being rendered after changing DynmapCore/src/main/java/org/dynmap/hdmap/TexturePackLoader.java::openModTPResource:
roots-altar

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant