Fix ClientModEvents example not subscribing to client-sided events (#9097)

This commit is contained in:
Nexus-Dino 2022-10-21 21:22:57 +01:00 committed by GitHub
parent 800cd6407e
commit f66aa6f727

View file

@ -9,6 +9,7 @@ import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material; import net.minecraft.world.level.material.Material;
import net.minecraftforge.api.distmarker.Dist
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
@ -75,7 +76,7 @@ public class ExampleMod
} }
// You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent
@Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD) @Mod.EventBusSubscriber(modid = MODID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public static class ClientModEvents public static class ClientModEvents
{ {
@SubscribeEvent @SubscribeEvent