Jump to content

Recommended Posts

Posted (edited)

Getting back into modding after a few years and I'm having the weirdest issue.

- Fresh Eclipse install (2021-03 (4.19.0))
- Fresh MDK install (forge-1.12.2-14.23.5.2855-mdk)
- Boilerplate "hello world" code from MDK with a single block registered.

When I start the client with the gradle task "runClient", the mod seems to load fine, the block appears in the creative tab but is missing textures and it's name is unlocalized.

However, if I package the mod with "publish", drag that jar into the mods folder, and then "runClient", the textures and localizations appear.

To try to debug, I looped over the resource manager's domains:

    @EventHandler
    public void onComplete(FMLLoadCompleteEvent event)
    {
    	SimpleReloadableResourceManager rm = (SimpleReloadableResourceManager) Minecraft.getMinecraft().getResourceManager();
    	for (String domain : rm.getResourceDomains()) {
    		logger.info("ResourceDomain: {}", domain);
        }
    }

Without the packaged mod (my expected launch method), I get:

[01:01:26] [Client thread/INFO] [hopperchests]: ResourceDomain: minecraft
[01:01:26] [Client thread/INFO] [hopperchests]: ResourceDomain: realms
[01:01:26] [Client thread/INFO] [hopperchests]: ResourceDomain: fml
[01:01:26] [Client thread/INFO] [hopperchests]: ResourceDomain: forge

When the mod is packaged and placed into ./run/mods/, I get:

[00:48:33] [Client thread/INFO] [hopperchests]: ResourceDomain: minecraft
[00:48:33] [Client thread/INFO] [hopperchests]: ResourceDomain: realms
[00:48:33] [Client thread/INFO] [hopperchests]: ResourceDomain: fml
[00:48:33] [Client thread/INFO] [hopperchests]: ResourceDomain: forge
[00:48:33] [Client thread/INFO] [hopperchests]: ResourceDomain: hopperchests    # <--

I didn't touch anything with the gradle settings (outside of specifying which jdk to use), and have entirely re-created the project from scratch twice now, both times experiencing the same issue.

The fact that the resources "work" (at least as far as is expected given the limited implementation I've done) when the mod is packaged makes me think it's an IDE / project config issue not a code issue.

But fwiw, here's the project structure:

Spoiler

$ tree -n
.
├── main
│   ├── java
│   │   └── hopperchests
│   │       ├── HopperChests.java
│   │       └── blocks
│   │           ├── BlockBase.java
│   │           └── BlockHopperChest.java
│   └── resources
│       ├── assets
│       │   └── hopperchests
│       │       ├── blockstates
│       │       │   └── hopperchest.json
│       │       ├── lang
│       │       │   └── en_us.lang
│       │       ├── models
│       │       │   ├── block
│       │       │   │   └── hopperchest_model.json
│       │       │   └── item
│       │       │       └── hopperchest.json
│       │       └── textures
│       │           └── blocks
│       │               ├── dev0.png
│       │               ├── dev1.png
│       │               ├── dev2.png
│       │               ├── dev3.png
│       │               ├── dev4.png
│       │               └── dev5.png
│       ├── mcmod.info
│       └── pack.mcmeta
└── test
    ├── java
    └── resources

17 directories, 15 files

 

Any suggestions?  Thanks in advance.

Edited by wrought
rm extraneous files
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.