Search in sources :

Example 1 with DimletMapping

use of mcjty.rftools.items.dimlets.DimletMapping in project RFTools by McJty.

the class RfToolsDimensionManager method checkDimletConfigFromServer.

/**
 * Here the information from the server arrives. This code is executed on the client.
 */
public void checkDimletConfigFromServer(Map<Integer, DimletKey> dimlets, World world) {
    Logging.log("Getting dimlet mapping from server");
    DimletMapping mapping = DimletMapping.getDimletMapping(world);
    mapping.overrideServerMapping(dimlets);
    KnownDimletConfiguration.init(world, false);
    KnownDimletConfiguration.initCrafting(world);
}
Also used : DimletMapping(mcjty.rftools.items.dimlets.DimletMapping)

Example 2 with DimletMapping

use of mcjty.rftools.items.dimlets.DimletMapping in project RFTools by McJty.

the class RfToolsDimensionManager method checkDimletConfig.

/**
 * Check if the client dimlet id's match with the server.
 * This is executed on the server to the clients.
 */
public void checkDimletConfig(EntityPlayer player) {
    if (!player.getEntityWorld().isRemote) {
        // Send over dimlet configuration to the client so that the client can check that the id's match.
        Logging.log("Send validation data to the client");
        DimletMapping mapping = DimletMapping.getDimletMapping(player.getEntityWorld());
        Map<Integer, DimletKey> dimlets = new HashMap<Integer, DimletKey>();
        for (Integer id : mapping.getIds()) {
            dimlets.put(id, mapping.getKey(id));
        }
        RFToolsMessages.INSTANCE.sendTo(new PacketCheckDimletConfig(dimlets), (EntityPlayerMP) player);
    }
}
Also used : DimletMapping(mcjty.rftools.items.dimlets.DimletMapping) DimletKey(mcjty.rftools.items.dimlets.DimletKey) PacketCheckDimletConfig(mcjty.rftools.dimension.network.PacketCheckDimletConfig)

Aggregations

DimletMapping (mcjty.rftools.items.dimlets.DimletMapping)2 PacketCheckDimletConfig (mcjty.rftools.dimension.network.PacketCheckDimletConfig)1 DimletKey (mcjty.rftools.items.dimlets.DimletKey)1