mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-14 22:44:07 +01:00
63 lines
1.8 KiB
Java
63 lines
1.8 KiB
Java
|
package com.simibubi.create;
|
||
|
|
||
|
import org.apache.logging.log4j.Logger;
|
||
|
|
||
|
import com.simibubi.create.networking.Packets;
|
||
|
|
||
|
import net.minecraft.block.Block;
|
||
|
import net.minecraft.item.Item;
|
||
|
import net.minecraft.item.ItemGroup;
|
||
|
import net.minecraftforge.event.RegistryEvent;
|
||
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||
|
import net.minecraftforge.fml.common.Mod;
|
||
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
|
||
|
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
||
|
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||
|
|
||
|
@EventBusSubscriber(bus = Bus.FORGE)
|
||
|
@Mod(Create.ID)
|
||
|
public class Create {
|
||
|
|
||
|
public static final String ID = "create";
|
||
|
public static final String NAME = "Create";
|
||
|
public static final String VERSION = "0.0.1";
|
||
|
|
||
|
public static Logger logger;
|
||
|
|
||
|
public static ItemGroup creativeTab = new CreateItemGroup();
|
||
|
|
||
|
public Create() {
|
||
|
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||
|
modEventBus.addListener(this::clientInit);
|
||
|
modEventBus.addListener(this::init);
|
||
|
}
|
||
|
|
||
|
private void clientInit(FMLClientSetupEvent event) {
|
||
|
AllItems.initColorHandlers();
|
||
|
|
||
|
// ScrollFixer.init();
|
||
|
}
|
||
|
|
||
|
private void init(final FMLCommonSetupEvent event) {
|
||
|
Packets.registerPackets();
|
||
|
}
|
||
|
|
||
|
@EventBusSubscriber(bus = Bus.MOD)
|
||
|
public static class RegistryListener {
|
||
|
|
||
|
@SubscribeEvent
|
||
|
public static void registerItems(RegistryEvent.Register<Item> event) {
|
||
|
AllItems.registerItems(event.getRegistry());
|
||
|
AllBlocks.registerItemBlocks(event.getRegistry());
|
||
|
}
|
||
|
|
||
|
@SubscribeEvent
|
||
|
public static void registerBlocks(RegistryEvent.Register<Block> event) {
|
||
|
AllBlocks.registerBlocks(event.getRegistry());
|
||
|
}
|
||
|
}
|
||
|
}
|