Jump to content

Recommended Posts

Posted (edited)

For the past couple days, I have been trying to figure out why my language file, for internalisation, hasn't been loading; I think I have found the reason why, in the debug files for Minecraft I see that pack.mcmeta cannot be loaded, therefore, I assume the language file will not be found correctly causing it to not load.

Github Repo: 

https://github.com/nibble90/MineSuperior

Here is a tree of the files:

  Reveal hidden contents

And here is the code:

Main.java:

package com.stamp.minesuperior;

import org.jline.utils.Log;

import com.stamp.minesuperior.util.Reference;
import com.stamp.minesuperior.KeyInputHandler;
import com.stamp.minesuperior.proxy.IProxy;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION)
public class Main {
	@Instance
	public static Main instance;
	@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
	public static IProxy proxy;
	@EventHandler
	public static void PreInit(FMLPreInitializationEvent event) {
		proxy.registerKeys();
//		MinecraftForge.EVENT_BUS.register(new KeyInputHandler());
//		KeyBindings.register();
		Log.info("[MS Utilities] PreInit completed");
	}
	@EventHandler
	public void init(FMLInitializationEvent event) {
//		proxy.registerKeys();
//		FMLCommonHandler.instance().bus().register(new KeyInputHandler());
		MinecraftForge.EVENT_BUS.register(new KeyInputHandler());
		Log.info("[MS Utilities] Init Completed");
	}
	@EventHandler
	public static void PostInit(FMLPostInitializationEvent event) {
		Log.info("[MS Utilities] PostInit Completed");
	}
}

KeyBindings.java

package com.stamp.minesuperior;

import org.lwjgl.input.Keyboard;

import net.minecraft.client.settings.KeyBinding;

public class KeyBindings {
	private static final String acl = "key.autoClickLeft";
	private static final String acr = "key.autoClickRight";
	private static final String am = "key.autoMine";
	private static final String cat = "key.categories.utilities";
	public static KeyBinding autoClickLeft = new KeyBinding(acl, Keyboard.KEY_DIVIDE, cat);
	public static KeyBinding autoClickRight = new KeyBinding(acr, Keyboard.KEY_SUBTRACT, cat);
	public static KeyBinding autoMine = new KeyBinding(am, Keyboard.KEY_MULTIPLY, cat);
//	public static void register() {
//		ClientRegistry.registerKeyBinding(autoClickLeft);
//		ClientRegistry.registerKeyBinding(autoClickRight);
//		ClientRegistry.registerKeyBinding(autoMine);
//	}
//	
}

KeyInputHandler.java:

package com.stamp.minesuperior;

import net.minecraft.client.Minecraft;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;

public class KeyInputHandler {
	@SubscribeEvent
    public void onKeyInput(ClientTickEvent event)
    {
        if(KeyBindings.autoClickLeft.isPressed()){
            Minecraft.getMinecraft().player.sendMessage(new TextComponentString(TextFormatting.DARK_RED + "[MS Utilities] " + TextFormatting.RED + "Left AutoClicker Button Pressed"));
        } else if(KeyBindings.autoClickRight.isPressed()){
        	Minecraft.getMinecraft().player.sendMessage(new TextComponentString(TextFormatting.DARK_RED + "[MS Utilities] " + TextFormatting.RED + "Right AutoClicker Button Pressed"));
        } else if(KeyBindings.autoMine.isPressed()) {
        	Minecraft.getMinecraft().player.sendMessage(new TextComponentString(TextFormatting.DARK_RED + "[MS Utilities] " + TextFormatting.RED + "AutoMiner Button Pressed"));
        }
    }
}

ClientProxy.java:

package com.stamp.minesuperior.proxy;

import com.stamp.minesuperior.KeyBindings;
import net.minecraftforge.fml.client.registry.ClientRegistry;

public class ClientProxy implements IProxy{
//	@Override
//	public void init() {
//		this.registerKeys();
//	}
	@Override
	public void registerKeys() {
//		MinecraftForge.EVENT_BUS.register(new KeyInputHandler());
		ClientRegistry.registerKeyBinding(KeyBindings.autoClickLeft);
		ClientRegistry.registerKeyBinding(KeyBindings.autoClickRight);
		ClientRegistry.registerKeyBinding(KeyBindings.autoMine);
	}
	
}

IProxy.java:

package com.stamp.minesuperior.proxy;

public interface IProxy {
	
	public abstract void registerKeys();
	
}

ServerProxy.java:

package com.stamp.minesuperior.proxy;

public class ServerProxy implements IProxy{

	@Override
	public void registerKeys() {
		// TODO Auto-generated method stub
		
	}

}

Reference.java:

package com.stamp.minesuperior.util;

public class Reference {
	public static final String MOD_ID = "minesuperior";
	public static final String NAME = "MineSuperior";
	public static final String VERSION = "1.5";
	public static final String ACCEPTED_VERSIONS = "[1.12.2]";
	public static final String CLIENT_PROXY_CLASS = "com.stamp.minesuperior.proxy.ClientProxy";
	public static final String SERVER_PROXY_CLASS = "com.stamp.minesuperior.proxy.ServerProxy";

}

en_gb.lang:

key.categories.utilities=MineSuperior Utilities
key.autoClickLeft=Left AutoClick
key.autoClickRight=Right AutoClick
key.autoMine=AutoMine

mcmod.info:

[
{
  "modid": "minesuperior",
  "name": "MineSuperior Utilities",
  "description": "A utility mod built for use with MineSuperior.",
  "version": "1.5",
  "mcversion": "1.12.2",
  "url": "",
  "updateUrl": "",
  "authorList": ["_Stamp_"],
  "credits": "_Stamp_ for making this mod",
  "logoFile": "",
  "screenshots": [],
  "dependencies": []
}
]

pack.mcmeta:

{
    "pack": {
        "description": "MineSuperior Utilities",
        "pack_format": 3,
        "_comment": "A pack_format of 3 should be used starting with Minecraft 1.11. All resources, including language files, should be lowercase (eg: en_us.lang). A pack_format of 2 will load your mod resources with LegacyV2Adapter, which requires language files to have uppercase letters (eg: en_US.lang)."
    }
}

Most recent log:

  Reveal hidden contents

 

Thanks in advance!

Edited by _Stamp_
Added GitHub Repository
Posted

Could you please post your code as a GitHub repository?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

This is not directly related to your issue, of course, but your repo is set up incorrectly.

Your repo's root should be in the same directory as the build.gradle and the .gitignore that the MDK provides.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted
  On 7/8/2019 at 7:11 PM, DaemonUmbra said:

This is not directly related to your issue, of course, but your repo is set up incorrectly.

Your repo's root should be in the same directory as the build.gradle and the .gitignore that the MDK provides.

Expand  

I have defaulted the .gitignore so those items are uploaded.

Posted

On my end it finds the pack.mcmeta just fine.

What IDE are you using?

Have you tried running the clean task and then the build task again?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted
  On 7/8/2019 at 7:29 PM, DaemonUmbra said:

On my end it finds the pack.mcmeta just fine.

What IDE are you using?

Have you tried running the clean task and then the build task again?

Expand  

I use eclipse, I have done ./gradlew clean then ./gradlew build and ran the mod it output in normal Minecraft (instead of in eclipse's version of Minecraft), however, I still got this (see attached picture).

I am not sure if it found pack.mcmeta or not although, as the names aren't loaded I'm guessing not.

 

Capture.PNG

Posted

Is the pack.mcmeta file showing in eclipse's file manager?

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

Have you made sure your language is set to English (GB)? Because the default and fallback are English (US), which you don't appear to have a lang for.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

We're both idiots...

It took me WAY too long to notice:

assests != assets

https://github.com/nibble90/MineSuperior/tree/master/src/main/resources/assests

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Make a test with another Launcher like the Curseforge Launcher, MultiMC or AT Launcher
    • can anyone help me i am opening forge and add modpacks and then it says unable to update native luancher and i redownlaod java and the luancher it self?
    • The problem occurs also in 1.20.1 Forge, but with an "Error executing task on client" instead. I have "Sinytra Connector" installed. On 1.21.5 Fabric, there is no problem. When this happens, the chat message before the death screen appears gets sent, with an extra dash added.
    • Well, as usual, it was user error. Naming mismatch in sounds.json.  Please delete this post if you find it necessary. 
    • Hello Forge community.  I'm running into an issue with a mod I'm working on.  To preface, I can call /playsound modId:name music @a and I can hear the sound I registered being played in game. Great!  However, I cannot get it to trigger via my mod code.    Registration: public static final RegistryObject<SoundEvent> A_WORLD_OF_MADNESS = SOUND_EVENTS.register("a_world_of_madness", () -> new SoundEvent(new ResourceLocation("tetheredsouls", "a_world_of_madness")));   Playback: Minecraft mc = Minecraft.getInstance(); if (!(mc.player instanceof LocalPlayer) || mc.level == null) return; LocalPlayer player = (LocalPlayer) mc.player; BlockPos pos = player.blockPosition(); SoundEvent track = ModSounds.A_WORLD_OF_MADNESS.get(); System.out.println(track); System.out.println(pos); System.out.println(player); // play exactly like the tutorial: client-only, at the player's position try { mc.level.playLocalSound( player.getX(), player.getY(), player.getZ(), track, SoundSource.MUSIC, // Or MASTER if needed 1f, 1f, false ); System.out.println("[DEBUG] playSound success: " + track.getLocation()); } catch (Exception e) { System.err.println("[ERROR] Failed to play sound: " + track.getLocation()); e.printStackTrace(); } Sounds.json:   { "theme_of_laura": { "category": "music", "sounds": [ { "name": "tetheredsouls:a_world_of_madness", "stream": true } ] } } Things I have tried: - multiple .ogg files. Short .ogg files (5 seconds, <100KB).  - default minecraft sounds imported from import net.minecraft.sounds.SoundEvents; These work given my code. No idea why these are different.  - playSound() method, as well as several others in past iterations that did not work   I would be forever grateful if somebody could point me in the right direction. I've looked at several mod github repositories and found extremely similar code to what I'm doing. I've also found several threads in this forum that did not solve my issue. I just cannot figure out what I'm doing differently, and why I'm able to queue sounds manually with playsound but the code won't play it (despite confirming the code is being run with the debug statements.)
  • Topics

×
×
  • Create New...

Important Information

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