Search in sources :

Example 6 with PacketRegistry

use of pl.asie.charset.lib.network.PacketRegistry in project Charset by CharsetMC.

the class ModCharsetTweaks method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    packet = new PacketRegistry(ModCharsetTweaks.MODID);
    packet.registerPacket(0x01, PacketMinecartUpdate.class);
    packet.registerPacket(0x02, PacketMinecartRequest.class);
    for (Tweak t : tweakSet) {
        if (t.isEnabled()) {
            if (!t.init()) {
                ModCharsetLib.logger.error("Tweak " + t.getClass().getSimpleName() + " failed to load! Please disable it in the config.");
                tweakSet.remove(t);
            }
        }
    }
}
Also used : PacketRegistry(pl.asie.charset.lib.network.PacketRegistry) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 7 with PacketRegistry

use of pl.asie.charset.lib.network.PacketRegistry in project Charset by CharsetMC.

the class ModCharsetPipes method init.

@EventHandler
public void init(FMLInitializationEvent event) {
    proxy.registerRenderers();
    packet = new PacketRegistry(ModCharsetPipes.MODID);
    packet.registerPacket(0x01, PacketItemUpdate.class);
    packet.registerPacket(0x02, PacketPipeSyncRequest.class);
    ModCharsetLib.proxy.registerRecipeShaped(new ItemStack(shifterBlock), "cPc", "c^c", "crc", 'c', Blocks.cobblestone, 'P', Blocks.piston, 'r', Items.redstone, '^', Items.arrow);
    if (!Loader.isModLoaded("BuildCraft|Transport")) {
        ModCharsetLib.proxy.registerRecipeShaped(new ItemStack(itemPipe, 8), "mgm", 'g', Blocks.glass, 'm', Blocks.obsidian);
    }
    ModCharsetLib.proxy.registerRecipeShaped(new ItemStack(itemPipe, 8), "m", "g", "m", 'g', Blocks.glass, 'm', Blocks.obsidian);
}
Also used : PacketRegistry(pl.asie.charset.lib.network.PacketRegistry) ItemStack(net.minecraft.item.ItemStack) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Aggregations

PacketRegistry (pl.asie.charset.lib.network.PacketRegistry)7 ItemStack (net.minecraft.item.ItemStack)5 EventHandler (net.minecraftforge.fml.common.Mod.EventHandler)4 ShapedOreRecipe (net.minecraftforge.oredict.ShapedOreRecipe)4 Joiner (com.google.common.base.Joiner)1 com.google.common.collect (com.google.common.collect)1 MethodHandle (java.lang.invoke.MethodHandle)1 MethodHandles (java.lang.invoke.MethodHandles)1 MethodType (java.lang.invoke.MethodType)1 Field (java.lang.reflect.Field)1 java.util (java.util)1 BiConsumer (java.util.function.BiConsumer)1 MinecraftForge (net.minecraftforge.common.MinecraftForge)1 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)1 Configuration (net.minecraftforge.common.config.Configuration)1 Property (net.minecraftforge.common.config.Property)1 FMLCommonHandler (net.minecraftforge.fml.common.FMLCommonHandler)1 Loader (net.minecraftforge.fml.common.Loader)1 Mod (net.minecraftforge.fml.common.Mod)1 ASMDataTable (net.minecraftforge.fml.common.discovery.ASMDataTable)1