Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I need to use this method to have custom music for my dimension.

@Nullable
@SideOnly(Side.CLIENT)
public MusicTicker.MusicType getMusicType()
{
    return MusicTicker.MusicType.<?>;
}

The <?> is not in the actual code, I'm just using 

CREATIVE

as a placeholder.

Formerly I used the PlaySoundEvent and it (kind of) worked, but the music was overlapping, and I spotted this method. But now, I need to add a custom MusicType enum constant, but I don't know how to do this (:().

  • Author

Tried that and got this problem:

Spoiler

[16:12:24] [main/ERROR] [FML]: Error adding enum with EnumHelper.
java.lang.NoSuchMethodException: net.minecraft.client.audio.MusicTicker$MusicType.<init>(java.lang.String, int, net.minecraft.util.SoundEvent, java.lang.Integer, java.lang.Integer)
	at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getDeclaredConstructor(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.common.util.EnumHelper.getConstructorAccessor(EnumHelper.java:198) ~[EnumHelper.class:?]
	at net.minecraftforge.common.util.EnumHelper.makeEnum(EnumHelper.java:211) ~[EnumHelper.class:?]
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:397) [EnumHelper.class:?]
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:277) [EnumHelper.class:?]
	at creepersgalore.greenvoidislands.GreenVoidIslands.init(GreenVoidIslands.java:58) [GreenVoidIslands.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:608) [FMLModContainer.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:278) [LoadController.class:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:256) [LoadController.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) [LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:720) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:352) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:581) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
[16:12:24] [main/FATAL] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue
[16:12:24] [main/FATAL] [FML]: 
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State | ID               | Version      | Source                           | Signature |
	|:----- |:---------------- |:------------ |:-------------------------------- |:--------- |
	| UCHI  | minecraft        | 1.12.2       | minecraft.jar                    | None      |
	| UCHI  | mcp              | 9.42         | minecraft.jar                    | None      |
	| UCHI  | FML              | 8.0.99.99    | forgeSrc-1.12.2-14.23.2.2611.jar | None      |
	| UCHI  | forge            | 14.23.2.2611 | forgeSrc-1.12.2-14.23.2.2611.jar | None      |
	| UCHE  | greenvoidislands | 1.0.0        | bin                              | None      |

[16:12:24] [main/FATAL] [FML]: The following problems were captured during this phase
[16:12:24] [main/ERROR] [FML]: Caught exception from greenvoidislands (Green Void Islands)
java.lang.RuntimeException: java.lang.NoSuchMethodException: net.minecraft.client.audio.MusicTicker$MusicType.<init>(java.lang.String, int, net.minecraft.util.SoundEvent, java.lang.Integer, java.lang.Integer)
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:406) ~[forgeSrc-1.12.2-14.23.2.2611.jar:?]
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:277) ~[forgeSrc-1.12.2-14.23.2.2611.jar:?]
	at creepersgalore.greenvoidislands.GreenVoidIslands.init(GreenVoidIslands.java:58) ~[bin/:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:608) ~[forgeSrc-1.12.2-14.23.2.2611.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:278) ~[LoadController.class:?]
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:256) [LoadController.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
	at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) [LoadController.class:?]
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:720) [Loader.class:?]
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:352) [FMLClientHandler.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:581) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.NoSuchMethodException: net.minecraft.client.audio.MusicTicker$MusicType.<init>(java.lang.String, int, net.minecraft.util.SoundEvent, java.lang.Integer, java.lang.Integer)
	at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.8.0_161]
	at java.lang.Class.getDeclaredConstructor(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.common.util.EnumHelper.getConstructorAccessor(EnumHelper.java:198) ~[EnumHelper.class:?]
	at net.minecraftforge.common.util.EnumHelper.makeEnum(EnumHelper.java:211) ~[EnumHelper.class:?]
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:397) ~[EnumHelper.class:?]
	... 49 more
[16:12:24] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// I bet Cylons wouldn't have this problem.

Time: 2/28/18 4:12 PM
Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Green Void Islands (greenvoidislands)
Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: net.minecraft.client.audio.MusicTicker$MusicType.<init>(java.lang.String, int, net.minecraft.util.SoundEvent, java.lang.Integer, java.lang.Integer)
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:406)
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:277)
	at creepersgalore.greenvoidislands.GreenVoidIslands.init(GreenVoidIslands.java:58)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:608)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:278)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:256)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148)
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:720)
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:352)
	at net.minecraft.client.Minecraft.init(Minecraft.java:581)
	at net.minecraft.client.Minecraft.run(Minecraft.java:421)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)
Caused by: java.lang.NoSuchMethodException: net.minecraft.client.audio.MusicTicker$MusicType.<init>(java.lang.String, int, net.minecraft.util.SoundEvent, java.lang.Integer, java.lang.Integer)
	at java.lang.Class.getConstructor0(Unknown Source)
	at java.lang.Class.getDeclaredConstructor(Unknown Source)
	at net.minecraftforge.common.util.EnumHelper.getConstructorAccessor(EnumHelper.java:198)
	at net.minecraftforge.common.util.EnumHelper.makeEnum(EnumHelper.java:211)
	at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:397)
	... 49 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

 

My code, before any init methods or anything:

public static MusicTicker.MusicType musicType = EnumHelper.addEnum(MusicTicker.MusicType.class, "GVI", new Class[]{SoundEvent.class, Integer.class, Integer.class}, GVISoundManager.gvi_music, 270, 540);

I haven't used EnumHelper much before. The MusicTicker.MusicType Enum constructor uses a SoundEvent, and two ints.

My code, before any init methods or anything:

public static MusicTicker.MusicType musicType = EnumHelper.addEnum(MusicTicker.MusicType.class, "GVI", new Class[]{SoundEvent.class, Integer.class, Integer.class}, GVISoundManager.gvi_music, 270, 540);

I haven't used EnumHelper much before. The MusicTicker.MusicType Enum constructor uses a SoundEvent, and two ints.

private MusicType(SoundEvent musicLocationIn, int minDelayIn, int maxDelayIn)
{
    this.musicLocation = musicLocationIn;
    this.minDelay = minDelayIn;
    this.maxDelay = maxDelayIn;
}

I am using Forge 1.12.2-14.23.2.2611. According to the changelog, they fixed the MusicType error. http://www.minecraftforge.net/forum/topic/62903-forge-14232-minecraft-1122/?tab=comments#comment-296005

Edited by creepersgalore

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.