Skip to content

Commit

Permalink
Switch to mod bus
Browse files Browse the repository at this point in the history
  • Loading branch information
Minecraftschurli committed Aug 16, 2023
1 parent a524a21 commit 116af92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ public static void initClientHooks(Minecraft mc, ReloadableResourceManager resou
initializedClientHooks = true;

ForgeGameTestHooks.registerGametests();
MinecraftForge.EVENT_BUS.post(new RegisterSpriteSourceTypesEvent(SPRITE_SOURCE_TYPES_MAP));
ModLoader.get().postEvent(new RegisterSpriteSourceTypesEvent(SPRITE_SOURCE_TYPES_MAP));
ModLoader.get().postEvent(new RegisterClientReloadListenersEvent(resourceManager));
ModLoader.get().postEvent(new EntityRenderersEvent.RegisterLayerDefinitions());
ModLoader.get().postEvent(new EntityRenderersEvent.RegisterRenderers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@
import net.minecraft.client.renderer.texture.atlas.SpriteSource;
import net.minecraft.client.renderer.texture.atlas.SpriteSourceType;
import net.minecraft.resources.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.Cancelable;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.fml.LogicalSide;
import net.minecraftforge.fml.event.IModBusEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

/**
* Fired to allow mods to register their own SpriteSourceTypes.
* This event is fired once during the construction of the {@link Minecraft} instance.
*
* <p>This event is not {@linkplain Cancelable cancellable}, and does not {@linkplain HasResult have a result}.</p>
*
* <p>This event is fired on the {@linkplain MinecraftForge#EVENT_BUS forge event bus},
* <p>This event is fired on the {@linkplain FMLJavaModLoadingContext#getModEventBus() mod-specific event bus},
* only on the {@linkplain LogicalSide#CLIENT logical client}.</p>
*/
public class RegisterSpriteSourceTypesEvent extends Event
public class RegisterSpriteSourceTypesEvent extends Event implements IModBusEvent
{
private final BiMap<ResourceLocation, SpriteSourceType> types;

Expand Down

0 comments on commit 116af92

Please sign in to comment.