use of net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper in project RebornCore by TechReborn.
the class NetworkManager method createOrGetNetworkWrapper.
public static SimpleNetworkWrapper createOrGetNetworkWrapper(Class<? extends INetworkPacket> packetClass) {
String wrapperName = getWrapperName(packetClass);
if (packageWrapperMap.containsKey(wrapperName)) {
return packageWrapperMap.get(wrapperName);
} else {
SimpleNetworkWrapper newNetworkWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(wrapperName);
RebornCore.logHelper.info("Created new network wrapper " + wrapperName);
packageWrapperMap.put(wrapperName, newNetworkWrapper);
return newNetworkWrapper;
}
}
use of net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper in project RFToolsDimensions by McJty.
the class CommonProxy method preInit.
public void preInit(FMLPreInitializationEvent e) {
GeneralConfig.preInit(e);
modConfigDir = e.getModConfigurationDirectory();
mainConfig = new Configuration(new File(modConfigDir.getPath() + File.separator + "rftools", "dimensions.cfg"));
readMainConfig();
SimpleNetworkWrapper network = PacketHandler.registerMessages(RFToolsDim.MODID, "rftoolsdim");
RFToolsDimMessages.registerNetworkMessages(network);
ModItems.init();
ModBlocks.init();
ModDimensions.init();
KnownDimletConfiguration.setupChestLoot();
DimletRules.readRules(modConfigDir);
}
use of net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper in project RebornCore by TechReborn.
the class NetworkManager method registerPacket.
public static PacketDetails registerPacket(Class<? extends INetworkPacket> packetClass, Side side) {
SimpleNetworkWrapper wrapper = createOrGetNetworkWrapper(packetClass);
int id = getNextIDForWrapper(wrapper);
wrapper.registerMessage(PacketWrapper.PacketWrapperHandler.class, PacketWrapper.class, id, side);
packetWrapperMap.put(packetClass, wrapper);
RebornCore.logHelper.info("Registed packet to " + getWrapperName(packetClass) + " side: " + side + " id:" + id);
PacketDetails packetDetails = new PacketDetails(packetClass, id, wrapper);
packetList.add(packetDetails);
return packetDetails;
}
use of net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper in project Logistical-Automation by Zundrel.
the class LogisticalAutomation method init.
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
TileRegistry.init();
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());
networkWrapper = new SimpleNetworkWrapper(ModInfo.MOD_ID);
networkWrapper.registerMessage(MessageButton.class, MessageButton.class, 0, Side.SERVER);
}
use of net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper in project RFToolsControl by McJty.
the class CommonProxy method preInit.
public void preInit(FMLPreInitializationEvent e) {
MinecraftForge.EVENT_BUS.register(new ForgeEventHandlers());
McJtyLib.preInit(e);
CommandHandler.registerCommands();
GeneralConfig.preInit(e);
modConfigDir = e.getModConfigurationDirectory();
mainConfig = new Configuration(new File(modConfigDir.getPath() + File.separator + "rftools", "control.cfg"));
readMainConfig();
SimpleNetworkWrapper network = PacketHandler.registerMessages(RFToolsControl.MODID, "rftoolsctrl");
RFToolsCtrlMessages.registerNetworkMessages(network);
Opcodes.init();
Functions.init();
ModBlocks.init();
ModItems.init();
// if (RFToolsControl.mcmpPresent) {
// MCMPSetup.init();
// }
}
Aggregations